-
Notifications
You must be signed in to change notification settings - Fork 80
Expand file tree
/
Copy pathPluginBrowser.xaml
More file actions
143 lines (130 loc) · 6.34 KB
/
PluginBrowser.xaml
File metadata and controls
143 lines (130 loc) · 6.34 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<Window x:Class="Torch.Server.Views.PluginBrowser"
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:Markdown.Xaml;assembly=Markdown.Xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib"
xmlns:views="clr-namespace:Torch.Server.Views"
mc:Ignorable="d"
Title="PluginBrowser" Height="557.5" Width="1161"
DataContext="{Binding RelativeSource={RelativeSource Self}}">
<Window.Resources>
<Style TargetType="FlowDocument" x:Key="DocumentStyle">
<Setter Property="FontFamily"
Value="Calibri" />
<Setter Property="TextAlignment"
Value="Left" />
</Style>
<Style x:Key="H1Style"
TargetType="Paragraph">
<Setter Property="FontSize"
Value="42" />
<Setter Property="Foreground"
Value="#ff000000" />
<Setter Property="FontWeight"
Value="Light" />
</Style>
<Style x:Key="H2Style"
TargetType="Paragraph">
<Setter Property="FontSize"
Value="20" />
<Setter Property="Foreground"
Value="#ff000000" />
<Setter Property="FontWeight"
Value="Light" />
</Style>
<Style x:Key="H3Style"
TargetType="Paragraph">
<Setter Property="FontSize"
Value="20" />
<Setter Property="Foreground"
Value="#99000000" />
<Setter Property="FontWeight"
Value="Light" />
</Style>
<Style x:Key="H4Style"
TargetType="Paragraph">
<Setter Property="FontSize"
Value="14" />
<Setter Property="Foreground"
Value="#99000000" />
<Setter Property="FontWeight"
Value="Light" />
</Style>
<Style x:Key="LinkStyle"
TargetType="Hyperlink">
<Setter Property="TextDecorations"
Value="None" />
</Style>
<Style x:Key="ImageStyle"
TargetType="Image">
<Setter Property="RenderOptions.BitmapScalingMode"
Value="NearestNeighbor" />
<Style.Triggers>
<Trigger Property="Tag"
Value="imageright">
<Setter Property="Margin"
Value="20,0,0,0" />
</Trigger>
</Style.Triggers>
</Style>
<Style x:Key="SeparatorStyle"
TargetType="Line">
<Setter Property="X2"
Value="{Binding ActualWidth, RelativeSource={RelativeSource AncestorType=FlowDocumentScrollViewer}}" />
<Setter Property="Stroke"
Value="#99000000" />
<Setter Property="StrokeThickness"
Value="2" />
</Style>
<local:Markdown x:Key="Markdown"
DocumentStyle="{StaticResource DocumentStyle}"
Heading1Style="{StaticResource H1Style}"
Heading2Style="{StaticResource H2Style}"
Heading3Style="{StaticResource H3Style}"
Heading4Style="{StaticResource H4Style}"
LinkStyle="{StaticResource LinkStyle}"
ImageStyle="{StaticResource ImageStyle}"
SeparatorStyle="{StaticResource SeparatorStyle}"
AssetPathRoot="{x:Static system:Environment.CurrentDirectory}"/>
<local:TextToFlowDocumentConverter x:Key="TextToFlowDocumentConverter"
Markdown="{StaticResource Markdown}"/>
</Window.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto" MinWidth="293"/>
</Grid.ColumnDefinitions>
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<ListView Name="PluginsList" Height="Auto" Margin="3,32,3,3" ItemsSource="{Binding Plugins}" SelectionChanged="PluginsList_SelectionChanged">
<ListView.View>
<GridView>
<GridViewColumn Width="220" Header="Name">
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBlock Margin="5, 0" Text="{Binding Name}"/>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn Header="Installed?">
<GridViewColumn.CellTemplate>
<DataTemplate>
<CheckBox Margin="5, 0" IsChecked="{Binding Installed}" IsHitTestVisible="False"/>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
</GridView>
</ListView.View>
</ListView>
<Button Name="DownloadButton" Grid.Row ="1" Content="Install" Margin="0,3,3,3" Height="30" Click="DownloadButton_OnClick" IsEnabled="False" HorizontalAlignment="Right" Width="144"/>
<Button Name="UninstallButton" Grid.Row ="1" Content="Uninstall" Margin="3,3,0,3" Height="30" Click="UninstallButton_OnClick" IsEnabled="False" HorizontalAlignment="Left" Width="144"/>
<TextBox x:Name="txtPluginsSearch" Height="23" Margin="3,4,3,0" TextWrapping="Wrap" Text="Plugins search..." VerticalAlignment="Top" GotFocus="TxtPluginsSearch_GotFocus" LostFocus="TxtPluginsSearch_LostFocus" Foreground="Gray" TextChanged="TxtPluginsSearch_TextChanged"/>
</Grid>
<FlowDocumentScrollViewer Name="MarkdownFlow" VerticalAlignment="Stretch" Margin="0,3,3,3" Document="{Binding CurrentDescription, Converter={StaticResource TextToFlowDocumentConverter}}" Grid.Column="1"/>
</Grid>
</Window>