|
| 1 | +<UserControl x:Class="NETworkManager.Views.DropdownDialog" |
| 2 | + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| 3 | + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 4 | + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
| 5 | + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
| 6 | + xmlns:viewModels="clr-namespace:NETworkManager.ViewModels" |
| 7 | + xmlns:converters="clr-namespace:NETworkManager.Converters;assembly=NETworkManager.Converters" |
| 8 | + xmlns:localization="clr-namespace:NETworkManager.Localization.Resources;assembly=NETworkManager.Localization" |
| 9 | + mc:Ignorable="d" Loaded="UserControl_Loaded" d:DataContext="{d:DesignInstance viewModels:DropdownViewModel}"> |
| 10 | + <UserControl.Resources> |
| 11 | + <converters:StringIsNotNullOrEmptyToBooleanConverter x:Key="StringIsNotNullOrEmptyToBooleanConverter" /> |
| 12 | + </UserControl.Resources> |
| 13 | + <Grid Margin="0,20"> |
| 14 | + <Grid.RowDefinitions> |
| 15 | + <RowDefinition Height="*" /> |
| 16 | + <RowDefinition Height="10" /> |
| 17 | + <RowDefinition Height="Auto" /> |
| 18 | + </Grid.RowDefinitions> |
| 19 | + <Grid Grid.Row="0"> |
| 20 | + <Grid.Resources> |
| 21 | + <Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource CenterTextBlock}" /> |
| 22 | + <Style TargetType="{x:Type TextBox}" BasedOn="{StaticResource DefaultTextBox}" /> |
| 23 | + </Grid.Resources> |
| 24 | + <Grid.ColumnDefinitions> |
| 25 | + <ColumnDefinition Width="1*" /> |
| 26 | + <ColumnDefinition Width="10" /> |
| 27 | + <ColumnDefinition Width="1*" /> |
| 28 | + </Grid.ColumnDefinitions> |
| 29 | + <Grid.RowDefinitions> |
| 30 | + <RowDefinition Height="Auto" /> |
| 31 | + </Grid.RowDefinitions> |
| 32 | + <TextBlock Grid.Column="0" Grid.Row="0" Text="{Binding ValueDescription}" /> |
| 33 | + <ComboBox Grid.Column="2" Grid.Row="0" ItemsSource="{Binding Values}" SelectedItem="{Binding SelectedValue, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" /> |
| 34 | + </Grid> |
| 35 | + <StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Right"> |
| 36 | + <Button Content="{x:Static localization:Strings.OK}" Command="{Binding OKCommand}" IsDefault="True" Margin="0,0,10,0"> |
| 37 | + <Button.Style> |
| 38 | + <Style TargetType="{x:Type Button}" BasedOn="{StaticResource HighlightedButton}"> |
| 39 | + <Setter Property="IsEnabled" Value="False" /> |
| 40 | + <Style.Triggers> |
| 41 | + <MultiDataTrigger> |
| 42 | + <MultiDataTrigger.Conditions> |
| 43 | + <Condition Binding="{Binding SelectedValue, Converter={StaticResource StringIsNotNullOrEmptyToBooleanConverter}}" Value="True" /> |
| 44 | + </MultiDataTrigger.Conditions> |
| 45 | + <MultiDataTrigger.Setters> |
| 46 | + <Setter Property="IsEnabled" Value="True" /> |
| 47 | + </MultiDataTrigger.Setters> |
| 48 | + </MultiDataTrigger> |
| 49 | + </Style.Triggers> |
| 50 | + </Style> |
| 51 | + </Button.Style> |
| 52 | + </Button> |
| 53 | + <Button Content="{x:Static localization:Strings.Cancel}" Command="{Binding CancelCommand}" IsCancel="True" Style="{StaticResource DefaultButton}" /> |
| 54 | + </StackPanel> |
| 55 | + </Grid> |
| 56 | +</UserControl> |
0 commit comments