|
15 | 15 | <UserControl.Resources> |
16 | 16 | <Style x:Key="OptionTextBlock" TargetType="TextBlock" BasedOn="{StaticResource MaterialDesignTextBlock}"> |
17 | 17 | <Setter Property="FontSize" Value="14"/> |
| 18 | + <Setter Property="LineHeight" Value="20"/> |
18 | 19 | <Setter Property="TextWrapping" Value="Wrap"/> |
19 | 20 | </Style> |
20 | 21 | <Style x:Key="OptionTextBox" TargetType="TextBox" BasedOn="{StaticResource MaterialDesignTextBox}"> |
|
28 | 29 | <Style x:Key="OptionDoubleBox" TargetType="{x:Type local:DoubleNumericBox}" BasedOn="{StaticResource OptionTextBox}"> |
29 | 30 | <Setter Property="InputMethod.IsInputMethodEnabled" Value="False"/> |
30 | 31 | </Style> |
31 | | - <Style x:Key="OptionInformationIcon" TargetType="materialDesign:PackIcon"> |
32 | | - <Setter Property="Kind" Value="Information"/> |
| 32 | + <Style x:Key="OptionTipsIcon" TargetType="materialDesign:PackIcon"> |
| 33 | + <Setter Property="Kind" Value="HelpCircle"/> |
33 | 34 | <Setter Property="VerticalAlignment" Value="Center"/> |
34 | | - <Setter Property="Margin" Value="8"/> |
| 35 | + <Setter Property="Margin" Value="8 0 0 0"/> |
35 | 36 | <Setter Property="Width"> |
36 | 37 | <Setter.Value> |
37 | 38 | <Binding Path="OptionInfo.Tips" Mode="OneWay"> |
|
49 | 50 | <Setter Property="Opacity" Value="0.8"/> |
50 | 51 | <Setter Property="ToolTip"> |
51 | 52 | <Setter.Value> |
52 | | - <TextBlock FontSize="13" Text="{Binding OptionInfo.Tips}" MaxWidth="320" TextWrapping="Wrap"/> |
| 53 | + <TextBlock Text="{Binding OptionInfo.Tips}" MaxWidth="320" TextWrapping="Wrap"/> |
53 | 54 | </Setter.Value> |
54 | 55 | </Setter> |
| 56 | + <Setter Property="Cursor" Value="Help"/> |
55 | 57 | </Style> |
56 | 58 | <DataTemplate x:Key="String" d:DataType="{x:Type local:OptionViewModel}"> |
57 | 59 | <WrapPanel |
|
60 | 62 | d:DataContext="{d:DesignInstance Type=local:OptionViewModel}" |
61 | 63 | DataContext="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=TreeViewItem}, Path=DataContext}"> |
62 | 64 | <TextBlock x:Name="TextBlockNearTextBox" Style="{StaticResource OptionTextBlock}" VerticalAlignment="Center" Text="{Binding Path=OptionInfo.Notes, StringFormat={}{0}:}"/> |
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> |
| 65 | + <TextBox Style="{StaticResource OptionTextBox}" VerticalAlignment="Center" Text="{Binding Path=OptionValue}" Margin="0 1 0 0" MinWidth="80"/> |
67 | 66 | </WrapPanel> |
68 | 67 | </DataTemplate> |
69 | 68 | <DataTemplate x:Key="Integer"> |
|
73 | 72 | d:DataContext="{d:DesignInstance Type=local:OptionViewModel}" |
74 | 73 | DataContext="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=TreeViewItem}, Path=DataContext}"> |
75 | 74 | <TextBlock Style="{StaticResource OptionTextBlock}" VerticalAlignment="Center" Text="{Binding Path=OptionInfo.Notes, StringFormat={}{0}:}"/> |
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> |
| 75 | + <local:IntegerNumericBox Style="{StaticResource OptionIntegerBox}" VerticalAlignment="Center" Margin="0 2 0 0" Padding="4 2" d:Text="60" Text="{Binding Path=OptionValue}" MinWidth="35"/> |
80 | 76 | </WrapPanel> |
81 | 77 | </DataTemplate> |
82 | 78 | <DataTemplate x:Key="Double"> |
|
86 | 82 | d:DataContext="{d:DesignInstance Type=local:OptionViewModel}" |
87 | 83 | DataContext="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=TreeViewItem}, Path=DataContext}"> |
88 | 84 | <TextBlock Style="{StaticResource OptionTextBlock}" VerticalAlignment="Center" Text="{Binding Path=OptionInfo.Notes, StringFormat={}{0}:}"/> |
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> |
| 85 | + <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"/> |
93 | 86 | </WrapPanel> |
94 | 87 | </DataTemplate> |
95 | 88 | <DataTemplate x:Key="Boolean"> |
|
102 | 95 | Margin="-2 0 0 0" |
103 | 96 | Cursor="Hand" |
104 | 97 | IsChecked="{Binding Path=OptionValue}"/> |
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> |
| 98 | + <TextBlock x:Name="AutoDetectText" Style="{StaticResource OptionTextBlock}" VerticalAlignment="Center" Margin="5 2 5 0" Text="{Binding Path=OptionInfo.Notes}"/> |
109 | 99 | </WrapPanel> |
110 | 100 | </DataTemplate> |
111 | 101 | <DataTemplate x:Key="Enum"> |
|
115 | 105 | d:DataContext="{d:DesignInstance Type=local:OptionViewModel}" |
116 | 106 | DataContext="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=TreeViewItem}, Path=DataContext}"> |
117 | 107 | <TextBlock Style="{StaticResource OptionTextBlock}" VerticalAlignment="Center" Text="{Binding Path=OptionInfo.Notes, StringFormat={}{0}:}"/> |
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> |
| 108 | + <ComboBox |
| 109 | + Margin="0 5 0 0" |
| 110 | + Padding="0 0 0 4" |
| 111 | + ItemsSource="{Binding Path=OptionInfo.EnumChoices}" |
| 112 | + SelectedIndex="{Binding ChoiceIndex}" |
| 113 | + ToolTip="{Binding RelativeSource={RelativeSource Mode=Self}, Path=SelectedItem.Label}"> |
| 114 | + <ComboBox.ItemTemplate> |
| 115 | + <DataTemplate DataType="{x:Type framwork:Choice}"> |
| 116 | + <TextBlock Style="{StaticResource OptionTextBlock}" TextAlignment="Center" Text="{Binding Name}" Padding="0" ToolTip="{Binding Label}"/> |
| 117 | + </DataTemplate> |
| 118 | + </ComboBox.ItemTemplate> |
| 119 | + </ComboBox> |
133 | 120 | </WrapPanel> |
134 | 121 | </DataTemplate> |
135 | 122 | </UserControl.Resources> |
136 | 123 | <Grid> |
137 | | - <ContentControl x:Name="TaskStatusContentControl" Content="{Binding}"> |
| 124 | + <Grid.ColumnDefinitions> |
| 125 | + <ColumnDefinition/> |
| 126 | + <ColumnDefinition Width="Auto"/> |
| 127 | + </Grid.ColumnDefinitions> |
| 128 | + <ContentControl x:Name="TaskStatusContentControl" Grid.Column="0" Content="{Binding}"> |
138 | 129 | <ContentControl.ContentTemplateSelector> |
139 | 130 | <local:OptionTreeViewItemTemplateSelector |
140 | 131 | StringTemplate="{StaticResource String}" |
|
156 | 147 | </StackPanel> |
157 | 148 | </d:ContentControl.Content> |
158 | 149 | </ContentControl> |
| 150 | + <materialDesign:PackIcon Grid.Column="1" Style="{StaticResource OptionTipsIcon}"/> |
159 | 151 | </Grid> |
160 | 152 | </UserControl> |
0 commit comments