|
27 | 27 | <converters:Bytes1000ToSpeedConverter x:Key="Bytes1000ToSpeedConverter" /> |
28 | 28 | <converters:BandwidthBytesToSpeedConverter x:Key="BandwidthBytesToSpeedConverter" /> |
29 | 29 | <converters:IPAddressArrayToStringConverter x:Key="IPAddressArrayToStringConverter" /> |
| 30 | + <converters:IntZeroReverseToVisibilityCollapsedConverter x:Key="IntZeroReverseToVisibilityCollapsedConverter" /> |
| 31 | + <converters:IntZeroToVisibilityCollapsedConverter x:Key="IntZeroToVisibilityCollapsedConverter" /> |
30 | 32 | <converters:NullOrEmptyToBoolConverter x:Key="NullOrEmptyToBoolConverter" /> |
31 | 33 | <converters:OperationalStatusToStringConverter x:Key="OperationalStatusToStringConverter" /> |
32 | 34 | <converters:PhysicalAddressToStringConverter x:Key="PhysicalAddressToStringConverter" /> |
33 | 35 | <converters:ValidateNetworkInterfaceConfigConverter x:Key="ValidateNetworkInterfaceConfigConverter" /> |
34 | 36 | </UserControl.Resources> |
35 | 37 | <TabControl Style="{StaticResource DefaultTabControl}"> |
36 | 38 | <TabItem Header="{x:Static localization:Strings.Information}"> |
37 | | - <Grid Margin="10"> |
38 | | - <Grid> |
39 | | - <Grid.Style> |
40 | | - <Style TargetType="{x:Type Grid}" > |
41 | | - <Setter Property="Visibility" Value="Visible" /> |
42 | | - <Style.Triggers> |
43 | | - <DataTrigger Binding="{Binding NetworkInterfaces.Count}" Value="0"> |
44 | | - <Setter Property="Visibility" Value="Collapsed" /> |
45 | | - </DataTrigger> |
46 | | - </Style.Triggers> |
47 | | - </Style> |
48 | | - </Grid.Style> |
| 39 | + <Grid Margin="10" > |
| 40 | + <Grid Visibility="{Binding NetworkInterfaces.Count, Converter={StaticResource IntZeroReverseToVisibilityCollapsedConverter}}"> |
49 | 41 | <Grid.RowDefinitions> |
50 | 42 | <RowDefinition Height="Auto" /> |
51 | 43 | <RowDefinition Height="Auto" /> |
|
240 | 232 | </Button.Content> |
241 | 233 | </Button> |
242 | 234 | </Grid> |
243 | | - <StackPanel VerticalAlignment="Center" HorizontalAlignment="Center"> |
| 235 | + <StackPanel VerticalAlignment="Center" HorizontalAlignment="Center" Visibility="{Binding NetworkInterfaces.Count, Converter={StaticResource IntZeroToVisibilityCollapsedConverter}}"> |
244 | 236 | <StackPanel.Style> |
245 | 237 | <Style TargetType="{x:Type StackPanel}"> |
246 | 238 | <Setter Property="Visibility" Value="Collapsed" /> |
|
273 | 265 | </TabItem> |
274 | 266 | <TabItem Header="{x:Static localization:Strings.Bandwidth}"> |
275 | 267 | <Grid Margin="10"> |
276 | | - <Grid> |
277 | | - <Grid.Style> |
278 | | - <Style TargetType="{x:Type Grid}" > |
279 | | - <Setter Property="Visibility" Value="Visible" /> |
280 | | - <Style.Triggers> |
281 | | - <DataTrigger Binding="{Binding NetworkInterfaces.Count}" Value="0"> |
282 | | - <Setter Property="Visibility" Value="Collapsed" /> |
283 | | - </DataTrigger> |
284 | | - </Style.Triggers> |
285 | | - </Style> |
286 | | - </Grid.Style> |
| 268 | + <Grid Visibility="{Binding NetworkInterfaces.Count, Converter={StaticResource IntZeroReverseToVisibilityCollapsedConverter}}"> |
287 | 269 | <Grid.RowDefinitions> |
288 | 270 | <RowDefinition Height="Auto" /> |
289 | 271 | <RowDefinition Height="Auto" /> |
|
437 | 419 | <TextBox Grid.Column="2" Grid.Row="3" Text="{Binding BandwidthBytesSentSpeed, Converter={StaticResource BandwidthBytesToSpeedConverter}}" /> |
438 | 420 | </Grid> |
439 | 421 | </Grid> |
440 | | - <StackPanel VerticalAlignment="Center" HorizontalAlignment="Center"> |
441 | | - <StackPanel.Style> |
442 | | - <Style TargetType="{x:Type StackPanel}"> |
443 | | - <Setter Property="Visibility" Value="Collapsed" /> |
444 | | - <Style.Triggers> |
445 | | - <DataTrigger Binding="{Binding NetworkInterfaces.Count}" Value="0"> |
446 | | - <Setter Property="Visibility" Value="Visible" /> |
447 | | - </DataTrigger> |
448 | | - </Style.Triggers> |
449 | | - </Style> |
450 | | - </StackPanel.Style> |
| 422 | + <StackPanel VerticalAlignment="Center" HorizontalAlignment="Center" Visibility="{Binding NetworkInterfaces.Count, Converter={StaticResource IntZeroToVisibilityCollapsedConverter}}"> |
451 | 423 | <TextBlock Text="{x:Static localization:Strings.NoEnabledNetworkAdaptersFound}" Style="{StaticResource MessageTextBlock}" Margin="0,0,0,10" /> |
452 | 424 | <Button Command="{Binding OpenNetworkConnectionsCommand}" HorizontalAlignment="Center" Style="{StaticResource ImageWithTextButton}"> |
453 | 425 | <Button.Content> |
|
470 | 442 | </TabItem> |
471 | 443 | <TabItem Header="{x:Static localization:Strings.Configure}"> |
472 | 444 | <Grid> |
473 | | - <Grid> |
474 | | - <Grid.Style> |
475 | | - <Style TargetType="{x:Type Grid}" > |
476 | | - <Setter Property="Visibility" Value="Visible" /> |
477 | | - <Style.Triggers> |
478 | | - <DataTrigger Binding="{Binding NetworkInterfaces.Count}" Value="0"> |
479 | | - <Setter Property="Visibility" Value="Collapsed" /> |
480 | | - </DataTrigger> |
481 | | - </Style.Triggers> |
482 | | - </Style> |
483 | | - </Grid.Style> |
| 445 | + <Grid Visibility="{Binding NetworkInterfaces.Count, Converter={StaticResource IntZeroReverseToVisibilityCollapsedConverter}}"> |
484 | 446 | <Grid.ColumnDefinitions> |
485 | 447 | <ColumnDefinition Width="*" /> |
486 | 448 | <ColumnDefinition Width="Auto" /> |
|
1088 | 1050 | </Grid> |
1089 | 1051 | </Expander> |
1090 | 1052 | </Grid> |
1091 | | - <StackPanel VerticalAlignment="Center" HorizontalAlignment="Center"> |
1092 | | - <StackPanel.Style> |
1093 | | - <Style TargetType="{x:Type StackPanel}"> |
1094 | | - <Setter Property="Visibility" Value="Collapsed" /> |
1095 | | - <Style.Triggers> |
1096 | | - <DataTrigger Binding="{Binding NetworkInterfaces.Count}" Value="0"> |
1097 | | - <Setter Property="Visibility" Value="Visible" /> |
1098 | | - </DataTrigger> |
1099 | | - </Style.Triggers> |
1100 | | - </Style> |
1101 | | - </StackPanel.Style> |
| 1053 | + <StackPanel VerticalAlignment="Center" HorizontalAlignment="Center" Visibility="{Binding NetworkInterfaces.Count, Converter={StaticResource IntZeroToVisibilityCollapsedConverter}}"> |
1102 | 1054 | <TextBlock Text="{x:Static localization:Strings.NoEnabledNetworkAdaptersFound}" Style="{StaticResource MessageTextBlock}" Margin="0,0,0,10" /> |
1103 | 1055 | <Button Command="{Binding OpenNetworkConnectionsCommand}" HorizontalAlignment="Center" Style="{StaticResource ImageWithTextButton}"> |
1104 | 1056 | <Button.Content> |
|
0 commit comments