|
94 | 94 | </ResourceDictionary>
|
95 | 95 | </UserControl.Resources>
|
96 | 96 |
|
97 |
| - <Grid ColumnSpacing="5"> |
98 |
| - <Grid.ColumnDefinitions> |
99 |
| - <ColumnDefinition Width="Auto" /> |
100 |
| - <ColumnDefinition Width="Auto" /> |
101 |
| - </Grid.ColumnDefinitions> |
102 |
| - |
| 97 | + <StackPanel x:Name="ContentStackPanel" |
| 98 | + Orientation="Horizontal" |
| 99 | + Spacing="5"> |
103 | 100 | <ContentDialog x:Name="ColorPickerDialog"
|
104 | 101 | x:Uid="NullableColorPicker_ColorPickerContentDialog"
|
105 | 102 | DefaultButton="Primary"
|
|
119 | 116 | Orientation="Horizontal" />
|
120 | 117 | </ContentDialog>
|
121 | 118 |
|
122 |
| - <ContentPresenter Grid.Column="0" |
123 |
| - Content="{x:Bind ColorSchemeVM, Mode=OneWay}" |
| 119 | + <ContentPresenter Content="{x:Bind ColorSchemeVM, Mode=OneWay}" |
124 | 120 | ContentTemplate="{StaticResource ColorSchemeTemplate}" />
|
125 | 121 |
|
126 |
| - <StackPanel Grid.Column="1" |
127 |
| - Spacing="5"> |
128 |
| - <ToggleButton AutomationProperties.Name="{x:Bind NullColorButtonLabel}" |
129 |
| - Click="NullColorButton_Clicked" |
130 |
| - IsChecked="{x:Bind IsNull(CurrentColor), Mode=OneWay}"> |
131 |
| - <Grid ColumnSpacing="5"> |
132 |
| - <Grid.ColumnDefinitions> |
133 |
| - <ColumnDefinition Width="Auto" /> |
134 |
| - <ColumnDefinition Width="*" /> |
135 |
| - </Grid.ColumnDefinitions> |
| 122 | + <Grid> |
| 123 | + <Grid.ColumnDefinitions> |
| 124 | + <ColumnDefinition Width="Auto" /> |
| 125 | + </Grid.ColumnDefinitions> |
| 126 | + <StackPanel Spacing="5"> |
| 127 | + <ToggleButton AutomationProperties.Name="{x:Bind NullColorButtonLabel}" |
| 128 | + Click="NullColorButton_Clicked" |
| 129 | + IsChecked="{x:Bind IsNull(CurrentColor), Mode=OneWay}"> |
| 130 | + <Grid ColumnSpacing="5"> |
| 131 | + <Grid.ColumnDefinitions> |
| 132 | + <ColumnDefinition Width="Auto" /> |
| 133 | + <ColumnDefinition Width="*" /> |
| 134 | + </Grid.ColumnDefinitions> |
| 135 | + |
| 136 | + <Border Grid.Column="0" |
| 137 | + Width="20" |
| 138 | + Height="20" |
| 139 | + Background="{x:Bind mtu:Converters.ColorToBrush(NullColorPreview), Mode=OneWay}" |
| 140 | + BorderThickness="1" |
| 141 | + CornerRadius="{ThemeResource ControlCornerRadius}" /> |
136 | 142 |
|
137 |
| - <Border Grid.Column="0" |
138 |
| - Width="20" |
139 |
| - Height="20" |
140 |
| - Background="{x:Bind mtu:Converters.ColorToBrush(NullColorPreview), Mode=OneWay}" |
141 |
| - BorderThickness="1" |
142 |
| - CornerRadius="{ThemeResource ControlCornerRadius}" /> |
| 143 | + <TextBlock Grid.Column="1" |
| 144 | + Text="{x:Bind NullColorButtonLabel}" /> |
| 145 | + </Grid> |
| 146 | + </ToggleButton> |
143 | 147 |
|
144 |
| - <TextBlock Grid.Column="1" |
145 |
| - Text="{x:Bind NullColorButtonLabel}" /> |
146 |
| - </Grid> |
147 |
| - </ToggleButton> |
| 148 | + <Button x:Uid="NullableColorPicker_MoreColorsButton" |
| 149 | + HorizontalAlignment="Stretch" |
| 150 | + Click="MoreColors_Clicked" /> |
| 151 | + </StackPanel> |
| 152 | + </Grid> |
148 | 153 |
|
149 |
| - <Button x:Uid="NullableColorPicker_MoreColorsButton" |
150 |
| - HorizontalAlignment="Stretch" |
151 |
| - Click="MoreColors_Clicked" /> |
152 |
| - </StackPanel> |
153 |
| - </Grid> |
| 154 | + <VisualStateManager.VisualStateGroups> |
| 155 | + <VisualStateGroup> |
| 156 | + <VisualState x:Name="Narrow"> |
| 157 | + <VisualState.StateTriggers> |
| 158 | + <AdaptiveTrigger MinWindowWidth="0" /> |
| 159 | + </VisualState.StateTriggers> |
| 160 | + <VisualState.Setters> |
| 161 | + <Setter Target="ContentStackPanel.Orientation" Value="Vertical" /> |
| 162 | + </VisualState.Setters> |
| 163 | + </VisualState> |
| 164 | + <VisualState x:Name="Wide"> |
| 165 | + <VisualState.StateTriggers> |
| 166 | + <AdaptiveTrigger MinWindowWidth="600" /> |
| 167 | + </VisualState.StateTriggers> |
| 168 | + <VisualState.Setters> |
| 169 | + <Setter Target="ContentStackPanel.Orientation" Value="Horizontal" /> |
| 170 | + </VisualState.Setters> |
| 171 | + </VisualState> |
| 172 | + </VisualStateGroup> |
| 173 | + </VisualStateManager.VisualStateGroups> |
| 174 | + </StackPanel> |
154 | 175 |
|
155 | 176 | </UserControl>
|
0 commit comments