Skip to content

Commit dc0bb62

Browse files
committed
Address feedback
1 parent ded613c commit dc0bb62

5 files changed

Lines changed: 41 additions & 31 deletions

File tree

WinUIGallery/MainWindow.xaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,11 @@
177177
AutomationProperties.AutomationId="CustomUserControls"
178178
Content="Custom & User Controls"
179179
Tag="CustomUserControls" />
180+
<NavigationViewItem
181+
x:Name="CustomXamlConditionalsPage"
182+
AutomationProperties.AutomationId="CustomXamlConditionals"
183+
Content="XAML Conditions"
184+
Tag="CustomXamlConditionals" />
180185
<NavigationViewItem
181186
x:Name="ScratchPadPage"
182187
AutomationProperties.AutomationId="ScratchPad"

WinUIGallery/Samples/ControlPages/CustomXamlConditionalsPage.xaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,9 @@
6969
<StackPanel.Resources>
7070
<Style x:Key="ConditionalButtonStyle" TargetType="Button">
7171
<newExp:Setter Property="Background" Value="{ThemeResource AccentFillColorDefaultBrush}" />
72+
<newExp:Setter Property="Foreground" Value="{ThemeResource TextOnAccentFillColorPrimaryBrush}" />
7273
<legacy:Setter Property="Background" Value="{ThemeResource ControlFillColorTertiaryBrush}" />
73-
<Setter Property="Foreground" Value="White" />
74+
<legacy:Setter Property="Foreground" Value="{ThemeResource TextFillColorPrimaryBrush}" />
7475
<Setter Property="Padding" Value="20,10" />
7576
<Setter Property="CornerRadius" Value="6" />
7677
</Style>

WinUIGallery/Samples/ControlPages/CustomXamlConditionalsPage.xaml.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@ public CustomXamlConditionalsPage()
1212
// Feature flags must be set before InitializeComponent so the XAML
1313
// parser sees the desired values when it evaluates the conditions.
1414
// The result for each (condition, argument) pair is then cached for
15-
// the lifetime of the process.
16-
FeatureFlagCondition.FeatureFlags["NewExperience"] = true;
17-
FeatureFlagCondition.FeatureFlags["LegacyMode"] = false;
15+
// the lifetime of the process. The defaults declared on
16+
// FeatureFlagCondition.FeatureFlags are used here, but the same
17+
// dictionary can be updated to flip the active variant, e.g.:
18+
//
19+
// FeatureFlagCondition.FeatureFlags["NewExperience"] = false;
20+
// FeatureFlagCondition.FeatureFlags["LegacyMode"] = true;
1821

1922
this.InitializeComponent();
2023
}

WinUIGallery/Samples/ControlPages/WrapPanelPage.xaml

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -29,34 +29,34 @@
2929
<WrapPanel.Resources>
3030
<Style TargetType="Rectangle">
3131
<Setter Property="Height" Value="40" />
32-
<Setter Property="Width" Value="40" />
3332
</Style>
3433
</WrapPanel.Resources>
35-
<Rectangle Fill="Red" />
36-
<Rectangle Fill="Blue" />
37-
<Rectangle Fill="Green" />
38-
<Rectangle Fill="Yellow" />
39-
<Rectangle Fill="Orange" />
40-
<Rectangle Fill="Purple" />
41-
<Rectangle Fill="Teal" />
42-
<Rectangle Fill="Salmon" />
43-
<Rectangle Fill="CornflowerBlue" />
44-
<Rectangle Fill="Crimson" />
45-
<Rectangle Fill="DodgerBlue" />
46-
<Rectangle Fill="ForestGreen" />
47-
<Rectangle Fill="Gold" />
48-
<Rectangle Fill="HotPink" />
49-
<Rectangle Fill="Indigo" />
50-
<Rectangle Fill="Khaki" />
51-
<Rectangle Fill="LimeGreen" />
52-
<Rectangle Fill="Maroon" />
53-
<Rectangle Fill="Navy" />
54-
<Rectangle Fill="Olive" />
55-
<Rectangle Fill="Plum" />
56-
<Rectangle Fill="RosyBrown" />
57-
<Rectangle Fill="SlateBlue" />
58-
<Rectangle Fill="Tomato" />
59-
<Rectangle Fill="Violet" />
34+
<!-- Items have varying widths to highlight that WrapPanel sizes each child to its desired size, unlike GridView which uses uniform item sizes. -->
35+
<Rectangle Width="60" Fill="Red" />
36+
<Rectangle Width="100" Fill="Blue" />
37+
<Rectangle Width="40" Fill="Green" />
38+
<Rectangle Width="80" Fill="Yellow" />
39+
<Rectangle Width="120" Fill="Orange" />
40+
<Rectangle Width="50" Fill="Purple" />
41+
<Rectangle Width="90" Fill="Teal" />
42+
<Rectangle Width="70" Fill="Salmon" />
43+
<Rectangle Width="110" Fill="CornflowerBlue" />
44+
<Rectangle Width="45" Fill="Crimson" />
45+
<Rectangle Width="85" Fill="DodgerBlue" />
46+
<Rectangle Width="65" Fill="ForestGreen" />
47+
<Rectangle Width="100" Fill="Gold" />
48+
<Rectangle Width="55" Fill="HotPink" />
49+
<Rectangle Width="95" Fill="Indigo" />
50+
<Rectangle Width="75" Fill="Khaki" />
51+
<Rectangle Width="115" Fill="LimeGreen" />
52+
<Rectangle Width="50" Fill="Maroon" />
53+
<Rectangle Width="80" Fill="Navy" />
54+
<Rectangle Width="60" Fill="Olive" />
55+
<Rectangle Width="105" Fill="Plum" />
56+
<Rectangle Width="70" Fill="RosyBrown" />
57+
<Rectangle Width="90" Fill="SlateBlue" />
58+
<Rectangle Width="55" Fill="Tomato" />
59+
<Rectangle Width="85" Fill="Violet" />
6060
</WrapPanel>
6161

6262
<controls:ControlExample.Options>

WinUIGallery/Samples/SampleCode/CustomXamlConditionals/CustomXamlConditionalsSample3_xaml.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@
88
<Style x:Key="ConditionalButtonStyle" TargetType="Button">
99
<!-- Setters can also be qualified with a conditional namespace. -->
1010
<newExp:Setter Property="Background" Value="{ThemeResource AccentFillColorDefaultBrush}" />
11+
<newExp:Setter Property="Foreground" Value="{ThemeResource TextOnAccentFillColorPrimaryBrush}" />
1112
<legacy:Setter Property="Background" Value="{ThemeResource ControlFillColorTertiaryBrush}" />
12-
<Setter Property="Foreground" Value="White" />
13+
<legacy:Setter Property="Foreground" Value="{ThemeResource TextFillColorPrimaryBrush}" />
1314
<Setter Property="Padding" Value="20,10" />
1415
<Setter Property="CornerRadius" Value="6" />
1516
</Style>

0 commit comments

Comments
 (0)