-
Notifications
You must be signed in to change notification settings - Fork 225
Expand file tree
/
Copy pathPluginManagerWindow.xaml
More file actions
92 lines (85 loc) · 4.91 KB
/
PluginManagerWindow.xaml
File metadata and controls
92 lines (85 loc) · 4.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<Window x:Class="VisualHFT.View.PluginManagerWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:VisualHFT.View"
mc:Ignorable="d"
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
TextElement.FontWeight="Regular"
TextElement.FontSize="15"
TextOptions.TextFormattingMode="Ideal"
TextOptions.TextRenderingMode="Auto"
Background="{DynamicResource MaterialDesignPaper}"
FontFamily="{StaticResource MaterialDesignFont}"
Title="Plugin Manager" Height="450" Width="900">
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../GlobalStyle.xaml" />
</ResourceDictionary.MergedDictionaries>
<!-- CollectionViewSource to group by PluginType -->
<CollectionViewSource x:Key="GroupedPlugins" Source="{Binding Plugins}">
<CollectionViewSource.GroupDescriptions>
<PropertyGroupDescription PropertyName="PluginType" />
</CollectionViewSource.GroupDescriptions>
</CollectionViewSource>
</ResourceDictionary>
</Window.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<!-- Bind ListView to CollectionViewSource -->
<ListView ItemsSource="{Binding Source={StaticResource GroupedPlugins}}" Grid.Column="0" SelectionMode="Single" HorizontalAlignment="Stretch">
<ListView.GroupStyle>
<GroupStyle>
<GroupStyle.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=Name}" FontWeight="Bold" FontSize="16" Padding="5"/>
</DataTemplate>
</GroupStyle.HeaderTemplate>
</GroupStyle>
</ListView.GroupStyle>
<ListView.ItemContainerStyle>
<Style TargetType="ListViewItem">
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="HorizontalContentAlignment" Value="Left"/>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Foreground" Value="Black" />
</Trigger>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Foreground" Value="Black" />
</Trigger>
</Style.Triggers>
</Style>
</ListView.ItemContainerStyle>
<ListView.View>
<GridView>
<GridViewColumn Header="Plugin Name" DisplayMemberBinding="{Binding Name}" Width="200" />
<GridViewColumn Header="Version" DisplayMemberBinding="{Binding Version}" Width="120" />
<GridViewColumn Header="Description" Width="250" >
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBlock TextWrapping="Wrap" Text="{Binding Description}" />
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn Header="Status" Width="120" DisplayMemberBinding="{Binding Status}" />
<GridViewColumn Header="Actions" Width="180">
<GridViewColumn.CellTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<Button Content="▶" Command="{Binding DataContext.StartPluginCommand, RelativeSource={RelativeSource FindAncestor, AncestorType=ListView}}" CommandParameter="{Binding}" Margin="0, 0, 10, 0" />
<Button Content="⏹️" Command="{Binding DataContext.StopPluginCommand, RelativeSource={RelativeSource FindAncestor, AncestorType=ListView}}" CommandParameter="{Binding}" Margin="0, 0, 10, 0"/>
<Button Content="⚙" Command="{Binding DataContext.ConfigurePluginCommand, RelativeSource={RelativeSource FindAncestor, AncestorType=ListView}}" CommandParameter="{Binding}" Margin="0, 0, 10, 0"/>
</StackPanel>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
</GridView>
</ListView.View>
</ListView>
</Grid>
</Window>