Skip to content

Commit dcdebfb

Browse files
committed
Added about UI
1 parent 210c451 commit dcdebfb

File tree

8 files changed

+247
-117
lines changed

8 files changed

+247
-117
lines changed

LiveWriterPluginManager/App.xaml

Lines changed: 114 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,120 @@
3434

3535
<Style TargetType="{x:Type dragablz:TabablzControl}"
3636
BasedOn="{StaticResource MaterialDesignTabablzControlStyle}" />
37-
37+
38+
<Style TargetType="{x:Type ListViewItem}">
39+
<Setter Property="Foreground"
40+
Value="{DynamicResource BlackBrush}" />
41+
<Setter Property="HorizontalContentAlignment"
42+
Value="Stretch" />
43+
<Setter Property="VerticalContentAlignment"
44+
Value="Center" />
45+
<Setter Property="MinHeight"
46+
Value="25" />
47+
<Setter Property="Margin"
48+
Value="0" />
49+
<Setter Property="BorderBrush"
50+
Value="{DynamicResource GrayBrush1}" />
51+
<Setter Property="Focusable"
52+
Value="false" />
53+
<Setter Property="Template">
54+
<Setter.Value>
55+
<ControlTemplate TargetType="{x:Type ListViewItem}">
56+
<Border x:Name="Bd"
57+
Background="{TemplateBinding Background}"
58+
SnapsToDevicePixels="True">
59+
<Grid>
60+
<GridViewRowPresenter Columns="{TemplateBinding GridView.ColumnCollection}"
61+
Content="{TemplateBinding Content}"
62+
VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
63+
<GridViewRowPresenter.Resources>
64+
<Style x:Key="{x:Type TextBlock}"
65+
TargetType="{x:Type TextBlock}">
66+
<Setter Property="Foreground"
67+
Value="{Binding Foreground, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type ListViewItem}}}" />
68+
<Style.Triggers>
69+
<DataTrigger Binding="{Binding IsSelected, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type ListViewItem}}}"
70+
Value="True">
71+
<Setter Property="Foreground"
72+
Value="{DynamicResource AccentSelectedColorBrush}" />
73+
</DataTrigger>
74+
<DataTrigger Binding="{Binding IsEnabled, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type ListView}}}"
75+
Value="False">
76+
<Setter Property="Foreground"
77+
Value="{DynamicResource GrayNormalBrush}" />
78+
</DataTrigger>
79+
<MultiDataTrigger>
80+
<MultiDataTrigger.Conditions>
81+
<Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type ListView}}}"
82+
Value="False" />
83+
<Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type ListViewItem}}}"
84+
Value="True" />
85+
</MultiDataTrigger.Conditions>
86+
<Setter Property="Foreground"
87+
Value="{DynamicResource AccentSelectedColorBrush}" />
88+
</MultiDataTrigger>
89+
</Style.Triggers>
90+
</Style>
91+
</GridViewRowPresenter.Resources>
92+
</GridViewRowPresenter>
93+
<ContentPresenter x:Name="contentPresenter"
94+
ContentTemplate="{TemplateBinding ContentTemplate}"
95+
Content="{TemplateBinding Content}"
96+
ContentStringFormat="{TemplateBinding ContentStringFormat}"
97+
Visibility="Collapsed" />
98+
</Grid>
99+
</Border>
100+
<ControlTemplate.Triggers>
101+
<Trigger Property="GridView.ColumnCollection"
102+
Value="{x:Null}">
103+
<Setter Property="Visibility"
104+
TargetName="contentPresenter"
105+
Value="Visible" />
106+
</Trigger>
107+
<Trigger Property="IsSelected"
108+
Value="True">
109+
<Setter Property="BorderBrush"
110+
TargetName="Bd"
111+
Value="#FF143C65" />
112+
<Setter Property="Background"
113+
TargetName="Bd"
114+
Value="{DynamicResource AccentColorBrush}" />
115+
<Setter Property="Foreground"
116+
Value="{DynamicResource AccentSelectedColorBrush}" />
117+
</Trigger>
118+
<MultiTrigger>
119+
<MultiTrigger.Conditions>
120+
<Condition Property="IsSelected"
121+
Value="True" />
122+
<Condition Property="Selector.IsSelectionActive"
123+
Value="True" />
124+
</MultiTrigger.Conditions>
125+
<Setter Property="Background"
126+
TargetName="Bd"
127+
Value="{DynamicResource AccentColorBrush2}" />
128+
<Setter Property="BorderBrush"
129+
TargetName="Bd"
130+
Value="#FF143C65" />
131+
<Setter Property="Foreground"
132+
Value="{DynamicResource AccentSelectedColorBrush}" />
133+
</MultiTrigger>
134+
<MultiTrigger>
135+
<MultiTrigger.Conditions>
136+
<Condition Property="IsEnabled"
137+
Value="False" />
138+
<Condition Property="IsSelected"
139+
Value="True" />
140+
</MultiTrigger.Conditions>
141+
<Setter Property="Background"
142+
TargetName="Bd"
143+
Value="{DynamicResource GrayBrush7}" />
144+
</MultiTrigger>
145+
</ControlTemplate.Triggers>
146+
</ControlTemplate>
147+
</Setter.Value>
148+
</Setter>
149+
</Style>
150+
38151
</ResourceDictionary>
39152
</Application.Resources>
40153
</Application>

LiveWriterPluginManager/Controls/AboutControl.xaml

Lines changed: 63 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,70 @@
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
44
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
55
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6+
xmlns:model="clr-namespace:LiveWriterPluginManager.Model"
67
mc:Ignorable="d"
78
d:DesignHeight="300"
8-
d:DesignWidth="300"
9-
Background="LightSkyBlue">
10-
<Grid>
9+
d:DesignWidth="600"
10+
DataContext="{Binding About, Source={StaticResource Locator}}">
11+
<ScrollViewer>
12+
<Grid>
13+
<Grid.RowDefinitions>
14+
<RowDefinition Height="Auto" />
15+
<RowDefinition Height="Auto" />
16+
<RowDefinition Height="*" />
17+
</Grid.RowDefinitions>
18+
<Grid.ColumnDefinitions>
19+
<ColumnDefinition Width="Auto" />
20+
<ColumnDefinition Width="*" />
21+
</Grid.ColumnDefinitions>
1122

12-
</Grid>
23+
<TextBlock Text="Version:"
24+
Margin="27,10,10,0" />
25+
26+
<TextBlock Text="{Binding Version}"
27+
Grid.Row="0"
28+
Grid.Column="1"
29+
Margin="0,10,0,0" />
30+
31+
<TextBlock Text="Built by:"
32+
Grid.Row="1"
33+
Grid.Column="0"
34+
Margin="27,10,10,0"/>
35+
36+
<TextBlock Grid.Row="1"
37+
Grid.Column="1"
38+
Margin="0,10,0,0">
39+
<Underline>
40+
<Hyperlink Command="{Binding SayHiToScottCommand}">
41+
<Run Text="@scottisafool"/>
42+
</Hyperlink>
43+
</Underline>
44+
</TextBlock>
45+
46+
<ItemsControl Grid.Row="2"
47+
Grid.Column="0"
48+
Grid.ColumnSpan="2"
49+
ItemsSource="{Binding Libraries}"
50+
Background="Transparent"
51+
Margin="10,15,10,10">
52+
<ItemsControl.ItemTemplate>
53+
<DataTemplate DataType="{x:Type model:Library}">
54+
<Button Style="{StaticResource MaterialDesignFlatButton}"
55+
Height="50"
56+
VerticalContentAlignment="Top"
57+
HorizontalContentAlignment="Left"
58+
Command="{Binding About.GoToCommand, Source={StaticResource Locator}}"
59+
CommandParameter="{Binding}">
60+
<StackPanel>
61+
<TextBlock Text="{Binding Name}"
62+
FontSize="18" />
63+
<TextBlock Text="{Binding Url}"
64+
Opacity="0.7" />
65+
</StackPanel>
66+
</Button>
67+
</DataTemplate>
68+
</ItemsControl.ItemTemplate>
69+
</ItemsControl>
70+
</Grid>
71+
</ScrollViewer>
1372
</UserControl>

LiveWriterPluginManager/Controls/RemovePluginControl.xaml

Lines changed: 0 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -61,118 +61,6 @@
6161
</Grid>
6262
</Border>
6363
</DataTemplate>
64-
<Style TargetType="{x:Type ListViewItem}">
65-
<Setter Property="Foreground"
66-
Value="{DynamicResource BlackBrush}" />
67-
<Setter Property="HorizontalContentAlignment"
68-
Value="Stretch" />
69-
<Setter Property="VerticalContentAlignment"
70-
Value="Center" />
71-
<Setter Property="MinHeight"
72-
Value="25" />
73-
<Setter Property="Margin"
74-
Value="0" />
75-
<Setter Property="BorderBrush"
76-
Value="{DynamicResource GrayBrush1}" />
77-
<Setter Property="Focusable"
78-
Value="false" />
79-
<Setter Property="Template">
80-
<Setter.Value>
81-
<ControlTemplate TargetType="{x:Type ListViewItem}">
82-
<Border x:Name="Bd"
83-
Background="{TemplateBinding Background}"
84-
SnapsToDevicePixels="True">
85-
<Grid>
86-
<GridViewRowPresenter Columns="{TemplateBinding GridView.ColumnCollection}"
87-
Content="{TemplateBinding Content}"
88-
VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
89-
<GridViewRowPresenter.Resources>
90-
<Style x:Key="{x:Type TextBlock}"
91-
TargetType="{x:Type TextBlock}">
92-
<Setter Property="Foreground"
93-
Value="{Binding Foreground, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type ListViewItem}}}" />
94-
<Style.Triggers>
95-
<DataTrigger Binding="{Binding IsSelected, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type ListViewItem}}}"
96-
Value="True">
97-
<Setter Property="Foreground"
98-
Value="{DynamicResource AccentSelectedColorBrush}" />
99-
</DataTrigger>
100-
<DataTrigger Binding="{Binding IsEnabled, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type ListView}}}"
101-
Value="False">
102-
<Setter Property="Foreground"
103-
Value="{DynamicResource GrayNormalBrush}" />
104-
</DataTrigger>
105-
<MultiDataTrigger>
106-
<MultiDataTrigger.Conditions>
107-
<Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type ListView}}}"
108-
Value="False" />
109-
<Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type ListViewItem}}}"
110-
Value="True" />
111-
</MultiDataTrigger.Conditions>
112-
<Setter Property="Foreground"
113-
Value="{DynamicResource AccentSelectedColorBrush}" />
114-
</MultiDataTrigger>
115-
</Style.Triggers>
116-
</Style>
117-
</GridViewRowPresenter.Resources>
118-
</GridViewRowPresenter>
119-
<ContentPresenter x:Name="contentPresenter"
120-
ContentTemplate="{TemplateBinding ContentTemplate}"
121-
Content="{TemplateBinding Content}"
122-
ContentStringFormat="{TemplateBinding ContentStringFormat}"
123-
Visibility="Collapsed" />
124-
</Grid>
125-
</Border>
126-
<ControlTemplate.Triggers>
127-
<Trigger Property="GridView.ColumnCollection"
128-
Value="{x:Null}">
129-
<Setter Property="Visibility"
130-
TargetName="contentPresenter"
131-
Value="Visible" />
132-
</Trigger>
133-
<Trigger Property="IsSelected"
134-
Value="True">
135-
<Setter Property="BorderBrush"
136-
TargetName="Bd"
137-
Value="#FF143C65" />
138-
<Setter Property="Background"
139-
TargetName="Bd"
140-
Value="{DynamicResource AccentColorBrush}" />
141-
<Setter Property="Foreground"
142-
Value="{DynamicResource AccentSelectedColorBrush}" />
143-
</Trigger>
144-
<MultiTrigger>
145-
<MultiTrigger.Conditions>
146-
<Condition Property="IsSelected"
147-
Value="True" />
148-
<Condition Property="Selector.IsSelectionActive"
149-
Value="True" />
150-
</MultiTrigger.Conditions>
151-
<Setter Property="Background"
152-
TargetName="Bd"
153-
Value="{DynamicResource AccentColorBrush2}" />
154-
<Setter Property="BorderBrush"
155-
TargetName="Bd"
156-
Value="#FF143C65" />
157-
<Setter Property="Foreground"
158-
Value="{DynamicResource AccentSelectedColorBrush}" />
159-
</MultiTrigger>
160-
<MultiTrigger>
161-
<MultiTrigger.Conditions>
162-
<Condition Property="IsEnabled"
163-
Value="False" />
164-
<Condition Property="IsSelected"
165-
Value="True" />
166-
</MultiTrigger.Conditions>
167-
<Setter Property="Background"
168-
TargetName="Bd"
169-
Value="{DynamicResource GrayBrush7}" />
170-
</MultiTrigger>
171-
</ControlTemplate.Triggers>
172-
</ControlTemplate>
173-
</Setter.Value>
174-
</Setter>
175-
</Style>
17664
</UserControl.Resources>
17765

17866
<UserControl.DataContext>

LiveWriterPluginManager/Helpers/AppHelper.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Diagnostics;
33
using System.IO;
44
using System.Linq;
5+
using System.Reflection;
56
using System.Security.Principal;
67
using System.Threading;
78
using System.Threading.Tasks;
@@ -71,5 +72,12 @@ public static void CheckForUpdates()
7172
}
7273
});
7374
}
75+
76+
public static Version GetAppVersion()
77+
{
78+
var version = Assembly.GetExecutingAssembly().GetName().Version;
79+
80+
return version;
81+
}
7482
}
7583
}

0 commit comments

Comments
 (0)