|
28 | 28 | <Style x:Key="OptionDoubleBox" TargetType="{x:Type local:DoubleNumericBox}" BasedOn="{StaticResource OptionTextBox}"> |
29 | 29 | <Setter Property="InputMethod.IsInputMethodEnabled" Value="False"/> |
30 | 30 | </Style> |
| 31 | + <Style x:Key="OptionInformationIcon" TargetType="materialDesign:PackIcon"> |
| 32 | + <Setter Property="Kind" Value="Information"/> |
| 33 | + <Setter Property="VerticalAlignment" Value="Center"/> |
| 34 | + <Setter Property="Margin" Value="8"/> |
| 35 | + <Setter Property="Width"> |
| 36 | + <Setter.Value> |
| 37 | + <Binding Path="OptionInfo.Tips" Mode="OneWay"> |
| 38 | + <Binding.Converter> |
| 39 | + <local:ValueConverterGroup> |
| 40 | + <local:NotNullConverter/> |
| 41 | + <local:BooleanSwitchOperationConverter/> |
| 42 | + </local:ValueConverterGroup> |
| 43 | + </Binding.Converter> |
| 44 | + <Binding.ConverterParameter>19;0</Binding.ConverterParameter> |
| 45 | + </Binding> |
| 46 | + </Setter.Value> |
| 47 | + </Setter> |
| 48 | + <Setter Property="Height" Value="{Binding Height, RelativeSource={RelativeSource Mode=Self}}"/> |
| 49 | + <Setter Property="Opacity" Value="0.8"/> |
| 50 | + <Setter Property="ToolTip"> |
| 51 | + <Setter.Value> |
| 52 | + <TextBlock FontSize="13" Text="{Binding OptionInfo.Tips}" MaxWidth="320" TextWrapping="Wrap"/> |
| 53 | + </Setter.Value> |
| 54 | + </Setter> |
| 55 | + </Style> |
31 | 56 | <DataTemplate x:Key="String" d:DataType="{x:Type local:OptionViewModel}"> |
32 | 57 | <WrapPanel |
33 | 58 | Grid.Row="0" |
34 | 59 | Orientation="Horizontal" |
35 | 60 | d:DataContext="{d:DesignInstance Type=local:OptionViewModel}" |
36 | 61 | DataContext="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=TreeViewItem}, Path=DataContext}"> |
37 | 62 | <TextBlock x:Name="TextBlockNearTextBox" Style="{StaticResource OptionTextBlock}" VerticalAlignment="Center" Text="{Binding Path=OptionInfo.Notes, StringFormat={}{0}:}"/> |
38 | | - <TextBox Style="{StaticResource OptionTextBox}" VerticalAlignment="Center" Text="{Binding Path=OptionValue}" Margin="0 1 0 0" MinWidth="80"/> |
| 63 | + <StackPanel Orientation="Horizontal"> |
| 64 | + <TextBox Style="{StaticResource OptionTextBox}" VerticalAlignment="Center" Text="{Binding Path=OptionValue}" Margin="0 1 0 0" MinWidth="80"/> |
| 65 | + <materialDesign:PackIcon Style="{StaticResource OptionInformationIcon}"/> |
| 66 | + </StackPanel> |
39 | 67 | </WrapPanel> |
40 | 68 | </DataTemplate> |
41 | 69 | <DataTemplate x:Key="Integer"> |
|
45 | 73 | d:DataContext="{d:DesignInstance Type=local:OptionViewModel}" |
46 | 74 | DataContext="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=TreeViewItem}, Path=DataContext}"> |
47 | 75 | <TextBlock Style="{StaticResource OptionTextBlock}" VerticalAlignment="Center" Text="{Binding Path=OptionInfo.Notes, StringFormat={}{0}:}"/> |
48 | | - <local:IntegerNumericBox Style="{StaticResource OptionIntegerBox}" VerticalAlignment="Center" Margin="0 2 0 0" Padding="4 2" d:Text="60" Text="{Binding Path=OptionValue}" MinWidth="35"/> |
| 76 | + <StackPanel Orientation="Horizontal"> |
| 77 | + <local:IntegerNumericBox Style="{StaticResource OptionIntegerBox}" VerticalAlignment="Center" Margin="0 2 0 0" Padding="4 2" d:Text="60" Text="{Binding Path=OptionValue}" MinWidth="35"/> |
| 78 | + <materialDesign:PackIcon Style="{StaticResource OptionInformationIcon}"/> |
| 79 | + </StackPanel> |
49 | 80 | </WrapPanel> |
50 | 81 | </DataTemplate> |
51 | 82 | <DataTemplate x:Key="Double"> |
|
55 | 86 | d:DataContext="{d:DesignInstance Type=local:OptionViewModel}" |
56 | 87 | DataContext="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=TreeViewItem}, Path=DataContext}"> |
57 | 88 | <TextBlock Style="{StaticResource OptionTextBlock}" VerticalAlignment="Center" Text="{Binding Path=OptionInfo.Notes, StringFormat={}{0}:}"/> |
58 | | - <local:DoubleNumericBox Style="{StaticResource OptionDoubleTextBox}" VerticalAlignment="Center" Margin="0 2 0 0" Padding="4 2" d:Text="60" Text="{Binding Path=OptionValue}" MinWidth="50" Digits="3"/> |
| 89 | + <StackPanel Orientation="Horizontal"> |
| 90 | + <local:DoubleNumericBox Style="{StaticResource OptionDoubleTextBox}" VerticalAlignment="Center" Margin="0 2 0 0" Padding="4 2" d:Text="60" Text="{Binding Path=OptionValue}" MinWidth="50" Digits="3"/> |
| 91 | + <materialDesign:PackIcon Style="{StaticResource OptionInformationIcon}"/> |
| 92 | + </StackPanel> |
59 | 93 | </WrapPanel> |
60 | 94 | </DataTemplate> |
61 | 95 | <DataTemplate x:Key="Boolean"> |
|
68 | 102 | Margin="-2 0 0 0" |
69 | 103 | Cursor="Hand" |
70 | 104 | IsChecked="{Binding Path=OptionValue}"/> |
71 | | - <TextBlock x:Name="AutoDetectText" Style="{StaticResource OptionTextBlock}" VerticalAlignment="Center" Margin="5 0" Text="{Binding Path=OptionInfo.Notes}"/> |
| 105 | + <StackPanel Orientation="Horizontal"> |
| 106 | + <TextBlock x:Name="AutoDetectText" Style="{StaticResource OptionTextBlock}" VerticalAlignment="Center" Margin="5 0" Text="{Binding Path=OptionInfo.Notes}"/> |
| 107 | + <materialDesign:PackIcon Style="{StaticResource OptionInformationIcon}"/> |
| 108 | + </StackPanel> |
72 | 109 | </WrapPanel> |
73 | 110 | </DataTemplate> |
74 | 111 | <DataTemplate x:Key="Enum"> |
|
78 | 115 | d:DataContext="{d:DesignInstance Type=local:OptionViewModel}" |
79 | 116 | DataContext="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=TreeViewItem}, Path=DataContext}"> |
80 | 117 | <TextBlock Style="{StaticResource OptionTextBlock}" VerticalAlignment="Center" Text="{Binding Path=OptionInfo.Notes, StringFormat={}{0}:}"/> |
81 | | - <ComboBox |
82 | | - ItemsSource="{Binding Path=OptionInfo.EnumChoices}" |
83 | | - SelectedIndex="{Binding ChoiceIndex}" |
84 | | - ToolTip="{Binding RelativeSource={RelativeSource Mode=Self}, Path=SelectedItem.Label}"> |
85 | | - <ComboBox.ItemTemplate> |
86 | | - <DataTemplate DataType="{x:Type framwork:Choice}"> |
87 | | - <TextBlock Style="{StaticResource OptionTextBlock}" Opacity="1" TextAlignment="Center" Text="{Binding Name}" Padding="0" ToolTip="{Binding Label}"/> |
88 | | - </DataTemplate> |
89 | | - </ComboBox.ItemTemplate> |
90 | | - </ComboBox> |
| 118 | + <StackPanel Orientation="Horizontal"> |
| 119 | + <ComboBox |
| 120 | + Margin="0 5 0 0" |
| 121 | + Padding="0 0 0 4" |
| 122 | + ItemsSource="{Binding Path=OptionInfo.EnumChoices}" |
| 123 | + SelectedIndex="{Binding ChoiceIndex}" |
| 124 | + ToolTip="{Binding RelativeSource={RelativeSource Mode=Self}, Path=SelectedItem.Label}"> |
| 125 | + <ComboBox.ItemTemplate> |
| 126 | + <DataTemplate DataType="{x:Type framwork:Choice}"> |
| 127 | + <TextBlock Style="{StaticResource OptionTextBlock}" Opacity="1" TextAlignment="Center" Text="{Binding Name}" Padding="0" ToolTip="{Binding Label}"/> |
| 128 | + </DataTemplate> |
| 129 | + </ComboBox.ItemTemplate> |
| 130 | + </ComboBox> |
| 131 | + <materialDesign:PackIcon Style="{StaticResource OptionInformationIcon}"/> |
| 132 | + </StackPanel> |
91 | 133 | </WrapPanel> |
92 | 134 | </DataTemplate> |
93 | 135 | </UserControl.Resources> |
|
0 commit comments