|
16 | 16 | xmlns:networkManager="clr-namespace:NETworkManager"
|
17 | 17 | xmlns:models="clr-namespace:NETworkManager.Models;assembly=NETworkManager.Models"
|
18 | 18 | mc:Ignorable="d"
|
19 |
| - Style="{DynamicResource DefaultWindow}" |
20 |
| - dialogs:DialogParticipation.Register="{Binding}" |
21 |
| - MinWidth="800" Width="1024" Height="768" MinHeight="600" |
| 19 | + Style="{DynamicResource ResourceKey=DefaultWindow}" |
| 20 | + dialogs:DialogParticipation.Register="{Binding }" |
| 21 | + MinWidth="800" MinHeight="600" |
| 22 | + Width="1024" Height="768" |
22 | 23 | SaveWindowPosition="True" TitleAlignment="Left"
|
23 | 24 | ContentRendered="MetroMainWindow_ContentRendered" StateChanged="MetroWindowMain_StateChanged"
|
24 | 25 | Activated="MetroMainWindow_Activated" Closing="MetroWindowMain_Closing"
|
25 | 26 | d:DataContext="{d:DesignInstance networkManager:MainWindow}">
|
26 | 27 | <!-- MetroDialogStyles.xaml must be adjusted if MinWidth/MinHeight is changed -->
|
27 | 28 | <mah:MetroWindow.Resources>
|
28 | 29 | <converters:BooleanToVisibilityCollapsedConverter x:Key="BooleanToVisibilityCollapsedConverter" />
|
| 30 | + <converters:BooleanReverseConverter x:Key="BooleanReverseConverter"></converters:BooleanReverseConverter> |
29 | 31 | <converters:ApplicationNameToTranslatedStringConverter x:Key="ApplicationNameToTranslatedStringConverter" />
|
30 | 32 | <converters:ApplicationNameToIconConverter x:Key="ApplicationNameToIconConverter" />
|
31 | 33 | <converters:IntZeroToVisibilityCollapsedConverter x:Key="IntZeroToVisibilityCollapsedConverter" />
|
32 | 34 | <converters:BooleanReverseToVisibilityCollapsedConverter x:Key="BooleanReverseToVisibilityCollapsedConverter" />
|
33 | 35 | <!-- ReSharper disable once Xaml.RedundantResource - Used in TrayIcon -->
|
34 | 36 | <ContextMenu x:Key="ContextMenuNotifyIcon" MinWidth="200" Opened="ContextMenu_Opened" x:Shared="False">
|
35 |
| - <MenuItem Header="{x:Static localization:Strings.Show}" Command="{Binding ShowWindowCommand}"> |
| 37 | + <MenuItem Header="{x:Static Member=localization:Strings.Show}" Command="{Binding Path=ShowWindowCommand}"> |
36 | 38 | <MenuItem.Icon>
|
37 |
| - <Rectangle Width="16" Height="16" Fill="{DynamicResource MahApps.Brushes.Gray3}"> |
| 39 | + <Rectangle Width="16" Height="16" Fill="{DynamicResource ResourceKey=MahApps.Brushes.Gray3}"> |
38 | 40 | <Rectangle.OpacityMask>
|
39 | 41 | <VisualBrush Stretch="Uniform" Visual="{iconPacks:Material Kind=OpenInNew}" />
|
40 | 42 | </Rectangle.OpacityMask>
|
41 | 43 | </Rectangle>
|
42 | 44 | </MenuItem.Icon>
|
43 | 45 | </MenuItem>
|
44 |
| - <MenuItem Header="{x:Static localization:Strings.Status}" Command="{Binding OpenStatusWindowCommand}"> |
| 46 | + <MenuItem Header="{x:Static Member=localization:Strings.Status}" Command="{Binding Path=OpenStatusWindowCommand}"> |
45 | 47 | <MenuItem.Icon>
|
46 |
| - <Rectangle Width="16" Height="16" Fill="{DynamicResource MahApps.Brushes.Gray3}"> |
| 48 | + <Rectangle Width="16" Height="16" Fill="{DynamicResource ResourceKey=MahApps.Brushes.Gray3}"> |
47 | 49 | <Rectangle.OpacityMask>
|
48 | 50 | <VisualBrush Stretch="Uniform" Visual="{iconPacks:Material Kind=Pulse}" />
|
49 | 51 | </Rectangle.OpacityMask>
|
50 | 52 | </Rectangle>
|
51 | 53 | </MenuItem.Icon>
|
52 | 54 | </MenuItem>
|
53 |
| - <MenuItem Header="{x:Static localization:Strings.Settings}" Command="{Binding OpenSettingsFromTrayCommand}"> |
| 55 | + <MenuItem Header="{x:Static Member=localization:Strings.Settings}" Command="{Binding Path=OpenSettingsFromTrayCommand}"> |
54 | 56 | <MenuItem.Icon>
|
55 |
| - <Rectangle Width="16" Height="16" Fill="{DynamicResource MahApps.Brushes.Gray3}"> |
| 57 | + <Rectangle Width="16" Height="16" Fill="{DynamicResource ResourceKey=MahApps.Brushes.Gray3}"> |
56 | 58 | <Rectangle.OpacityMask>
|
57 | 59 | <VisualBrush Stretch="Uniform" Visual="{iconPacks:MaterialLight Kind=Cog}" />
|
58 | 60 | </Rectangle.OpacityMask>
|
59 | 61 | </Rectangle>
|
60 | 62 | </MenuItem.Icon>
|
61 | 63 | </MenuItem>
|
62 |
| - <MenuItem Header="{x:Static localization:Strings.Close}" Command="{Binding CloseApplicationCommand}"> |
| 64 | + <MenuItem Header="{x:Static Member=localization:Strings.Close}" Command="{Binding Path=CloseApplicationCommand}"> |
63 | 65 | <MenuItem.Icon>
|
64 | 66 | <Rectangle Width="16" Height="16" Fill="Red">
|
65 | 67 | <Rectangle.OpacityMask>
|
|
71 | 73 | </ContextMenu>
|
72 | 74 | </mah:MetroWindow.Resources>
|
73 | 75 | <mah:MetroWindow.InputBindings>
|
74 |
| - <KeyBinding Command="{Binding OpenRunCommand}" Modifiers="Control+Shift" Key="P" /> |
| 76 | + <KeyBinding Command="{Binding Path=OpenRunCommand}" Modifiers="Control+Shift" Key="P" /> |
75 | 77 | </mah:MetroWindow.InputBindings>
|
76 | 78 | <mah:MetroWindow.WindowButtonCommands>
|
77 |
| - <mah:WindowButtonCommands Template="{DynamicResource MahApps.Templates.WindowButtonCommands.Win10}" /> |
| 79 | + <mah:WindowButtonCommands Template="{DynamicResource ResourceKey=MahApps.Templates.WindowButtonCommands.Win10}" /> |
78 | 80 | </mah:MetroWindow.WindowButtonCommands>
|
79 | 81 | <mah:MetroWindow.LeftWindowCommands>
|
80 | 82 | <mah:WindowCommands ShowSeparators="False">
|
81 | 83 | <!-- Fix some design issues with margin -2 and -1 -->
|
82 |
| - <Grid Background="{DynamicResource MahApps.Brushes.Gray10}" |
83 |
| - Visibility="{Binding Source={x:Static settings:ConfigurationManager.Current}, Path=IsAdmin, Converter={StaticResource BooleanToVisibilityCollapsedConverter}}" |
| 84 | + <Grid Background="{DynamicResource ResourceKey=MahApps.Brushes.Gray10}" |
| 85 | + Visibility="{Binding Source={x:Static Member=settings:ConfigurationManager.Current}, Path=IsAdmin, Converter={StaticResource ResourceKey=BooleanToVisibilityCollapsedConverter}}" |
84 | 86 | Margin="-2,-1,0,0">
|
85 |
| - <TextBlock Text="Administrator" Foreground="{DynamicResource MahApps.Brushes.Gray3}" |
86 |
| - Style="{StaticResource CenterTextBlock}" Margin="10,0" /> |
| 87 | + <TextBlock Text="Administrator" Foreground="{DynamicResource ResourceKey=MahApps.Brushes.Gray3}" |
| 88 | + Style="{StaticResource ResourceKey=CenterTextBlock}" Margin="10,0" /> |
87 | 89 | </Grid>
|
88 | 90 | </mah:WindowCommands>
|
89 | 91 | </mah:MetroWindow.LeftWindowCommands>
|
90 | 92 | <mah:MetroWindow.RightWindowCommands>
|
91 |
| - <mah:WindowCommands ShowSeparators="False" Visibility="{Binding Source={x:Static settings:ConfigurationManager.Current}, Path=IsChildWindowOpen, Converter={StaticResource BooleanReverseToVisibilityCollapsedConverter}}"> |
92 |
| - <Button Command="{Binding OpenRunCommand}" |
| 93 | + <mah:WindowCommands ShowSeparators="False" IsEnabled="{Binding Source={x:Static Member=settings:ConfigurationManager.Current}, Path=IsChildWindowOpen, Converter={StaticResource ResourceKey=BooleanReverseConverter}}"> |
| 94 | + <Button Command="{Binding Path=OpenRunCommand}" |
93 | 95 | Visibility="{Binding Path=FlyoutRunCommandIsOpen, Converter={StaticResource ResourceKey=BooleanReverseToVisibilityCollapsedConverter}}"
|
94 |
| - ToolTip="{x:Static localization:Strings.ToolTip_RunCommandWithHotKey}" |
| 96 | + ToolTip="{x:Static Member=localization:Strings.ToolTip_RunCommandWithHotKey}" |
95 | 97 | Cursor="Hand"
|
96 | 98 | Focusable="False">
|
97 | 99 | <StackPanel Orientation="Horizontal">
|
|
103 | 105 | </Rectangle>
|
104 | 106 | </StackPanel>
|
105 | 107 | </Button>
|
106 |
| - <Button Command="{Binding RestartApplicationCommand}" |
| 108 | + <Button Command="{Binding Path=RestartApplicationCommand}" |
107 | 109 | Opacity="1"
|
108 |
| - Visibility="{Binding IsRestartRequired, Converter={StaticResource BooleanToVisibilityCollapsedConverter}}" |
109 |
| - ToolTip="{x:Static localization:Strings.RestartRequired}" |
| 110 | + Visibility="{Binding Path=IsRestartRequired, Converter={StaticResource ResourceKey=BooleanToVisibilityCollapsedConverter}}" |
| 111 | + ToolTip="{x:Static Member=localization:Strings.RestartRequired}" |
110 | 112 | Cursor="Hand">
|
111 | 113 | <Rectangle Width="20" Height="20"
|
112 |
| - Fill="{DynamicResource MahApps.Brushes.Accent}"> |
| 114 | + Fill="{DynamicResource ResourceKey=MahApps.Brushes.Accent}"> |
113 | 115 | <Rectangle.OpacityMask>
|
114 | 116 | <VisualBrush Stretch="Uniform" Visual="{iconPacks:Material Kind=ReloadAlert}" />
|
115 | 117 | </Rectangle.OpacityMask>
|
116 | 118 | </Rectangle>
|
117 | 119 | </Button>
|
118 |
| - <Button Command="{Binding OpenWebsiteCommand}" |
| 120 | + <Button Command="{Binding Path=OpenWebsiteCommand}" |
119 | 121 | Opacity="1"
|
120 |
| - Visibility="{Binding IsUpdateAvailable, Converter={StaticResource BooleanToVisibilityCollapsedConverter}}" |
121 |
| - CommandParameter="{Binding UpdateReleaseUrl, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" |
| 122 | + Visibility="{Binding Path=IsUpdateAvailable, Converter={StaticResource ResourceKey=BooleanToVisibilityCollapsedConverter}}" |
| 123 | + CommandParameter="{Binding Path=UpdateReleaseUrl, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" |
122 | 124 | Cursor="Hand"
|
123 |
| - ToolTip="{x:Static localization:Strings.UpdateAvailable}" |
| 125 | + ToolTip="{x:Static Member=localization:Strings.UpdateAvailable}" |
124 | 126 | Focusable="False">
|
125 | 127 | <Rectangle Width="20" Height="20"
|
126 |
| - Fill="{DynamicResource MahApps.Brushes.Accent}"> |
| 128 | + Fill="{DynamicResource ResourceKey=MahApps.Brushes.Accent}"> |
127 | 129 | <Rectangle.OpacityMask>
|
128 | 130 | <VisualBrush Stretch="Uniform" Visual="{iconPacks:Material Kind=RocketLaunchOutline}" />
|
129 | 131 | </Rectangle.OpacityMask>
|
130 | 132 | </Rectangle>
|
131 | 133 | </Button>
|
132 |
| - <Button Command="{Binding UnlockProfileCommand}" |
| 134 | + <Button Command="{Binding Path=UnlockProfileCommand}" |
133 | 135 | Opacity="1"
|
134 |
| - Visibility="{Binding Source={x:Static settings:ConfigurationManager.Current}, Path=ProfileManagerShowUnlock, Converter={StaticResource BooleanToVisibilityCollapsedConverter}}" |
135 |
| - CommandParameter="{Binding UpdateReleaseUrl, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" |
| 136 | + Visibility="{Binding Source={x:Static Member=settings:ConfigurationManager.Current}, Path=ProfileManagerShowUnlock, Converter={StaticResource ResourceKey=BooleanToVisibilityCollapsedConverter}}" |
| 137 | + CommandParameter="{Binding Path=UpdateReleaseUrl, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" |
136 | 138 | Cursor="Hand"
|
137 |
| - ToolTip="{x:Static localization:Strings.UnlockProfile}" |
| 139 | + ToolTip="{x:Static Member=localization:Strings.UnlockProfile}" |
138 | 140 | Focusable="False">
|
139 | 141 | <Rectangle Width="20" Height="20"
|
140 |
| - Fill="{DynamicResource MahApps.Brushes.Accent}"> |
| 142 | + Fill="{DynamicResource ResourceKey=MahApps.Brushes.Accent}"> |
141 | 143 | <Rectangle.OpacityMask>
|
142 | 144 | <VisualBrush Stretch="Uniform" Visual="{iconPacks:Modern Kind=InterfacePassword}" />
|
143 | 145 | </Rectangle.OpacityMask>
|
144 | 146 | </Rectangle>
|
145 | 147 | </Button>
|
146 |
| - <ComboBox ItemsSource="{Binding ProfileFiles}" |
147 |
| - SelectedItem="{Binding SelectedProfileFile, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" |
148 |
| - IsDropDownOpen="{Binding IsProfileFileDropDownOpened}" |
149 |
| - Background="{DynamicResource MahApps.Brushes.Gray10}" |
| 148 | + <ComboBox ItemsSource="{Binding Path=ProfileFiles}" |
| 149 | + SelectedItem="{Binding Path=SelectedProfileFile, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" |
| 150 | + IsDropDownOpen="{Binding Path=IsProfileFileDropDownOpened}" |
| 151 | + Background="{DynamicResource ResourceKey=MahApps.Brushes.Gray10}" |
150 | 152 | BorderThickness="0"
|
151 | 153 | MinWidth="180"
|
152 | 154 | HorizontalAlignment="Left"
|
153 | 155 | Focusable="False"
|
154 | 156 | VerticalAlignment="Center"
|
155 | 157 | Height="30">
|
| 158 | + <ComboBox.Resources> |
| 159 | + <!-- ReSharper disable once Xaml.RedundantResource - Override MahApps default style --> |
| 160 | + <SolidColorBrush x:Key="MahApps.Brushes.Control.Disabled" Color="{DynamicResource ResourceKey=MahApps.Colors.Gray8}" /> |
| 161 | + </ComboBox.Resources> |
156 | 162 | <ComboBox.ItemTemplate>
|
157 | 163 | <DataTemplate>
|
158 | 164 | <Grid>
|
|
162 | 168 | <ColumnDefinition MinWidth="70" />
|
163 | 169 | </Grid.ColumnDefinitions>
|
164 | 170 | <Rectangle Grid.Column="0" Grid.Row="0" Width="20" Height="20"
|
165 |
| - Fill="{DynamicResource MahApps.Brushes.Gray3}"> |
| 171 | + Fill="{DynamicResource ResourceKey=MahApps.Brushes.Gray3}"> |
166 | 172 | <Rectangle.Style>
|
167 | 173 | <Style TargetType="Rectangle">
|
168 | 174 | <Setter Property="OpacityMask">
|
|
172 | 178 | </Setter.Value>
|
173 | 179 | </Setter>
|
174 | 180 | <Style.Triggers>
|
175 |
| - <DataTrigger Binding="{Binding IsEncrypted}" Value="True"> |
| 181 | + <DataTrigger Binding="{Binding Path=IsEncrypted}" Value="True"> |
176 | 182 | <Setter Property="OpacityMask">
|
177 | 183 | <Setter.Value>
|
178 | 184 | <VisualBrush Stretch="Uniform"
|
|
184 | 190 | </Style>
|
185 | 191 | </Rectangle.Style>
|
186 | 192 | </Rectangle>
|
187 |
| - <TextBlock Grid.Column="2" Grid.Row="0" Text="{Binding Name}" /> |
| 193 | + <TextBlock Grid.Column="2" Grid.Row="0" Text="{Binding Path=Name}" /> |
188 | 194 | </Grid>
|
189 | 195 | </DataTemplate>
|
190 | 196 | </ComboBox.ItemTemplate>
|
191 | 197 | </ComboBox>
|
192 |
| - <Button Command="{Binding OpenWebsiteCommand}" |
193 |
| - ToolTip="{x:Static localization:Strings.ToolTip_StarForkProjectOnGitHub}" |
194 |
| - CommandParameter="{x:Static resources:Resources.NETworkManager_GitHubRepoUrl}" |
| 198 | + <Button Command="{Binding Path=OpenWebsiteCommand}" |
| 199 | + ToolTip="{x:Static Member=localization:Strings.ToolTip_StarForkProjectOnGitHub}" |
| 200 | + CommandParameter="{x:Static Member=resources:Resources.NETworkManager_GitHubRepoUrl}" |
195 | 201 | Cursor="Hand"
|
196 | 202 | Focusable="False">
|
197 | 203 | <StackPanel Orientation="Horizontal">
|
|
204 | 210 | </StackPanel>
|
205 | 211 | </Button>
|
206 | 212 |
|
207 |
| - <Button Command="{Binding OpenWebsiteCommand}" |
208 |
| - ToolTip="{x:Static localization:Strings.ToolTip_ReportIssueOrCreateFeatureRequest}" |
209 |
| - CommandParameter="{x:Static resources:Resources.NETworkManager_GitHubNewIssueUrl}" |
| 213 | + <Button Command="{Binding Path=OpenWebsiteCommand}" |
| 214 | + ToolTip="{x:Static Member=localization:Strings.ToolTip_ReportIssueOrCreateFeatureRequest}" |
| 215 | + CommandParameter="{x:Static Member=resources:Resources.NETworkManager_GitHubNewIssueUrl}" |
210 | 216 | Cursor="Hand"
|
211 | 217 | Focusable="False">
|
212 | 218 | <StackPanel Orientation="Horizontal">
|
|
0 commit comments