From 6614a50a8d4c9245fcc74fc6809803f68ebe7aa7 Mon Sep 17 00:00:00 2001 From: Tasha Titova Date: Fri, 19 Feb 2021 11:38:16 -0800 Subject: [PATCH 01/50] Progress bar visual update (#4158) * bug fixes * updated to progress bar * remove default style * reverting change to test * removing valuse from test file * reverting padding * moving padding back to parent border, updating the test progress bar size as 100 is not enough to see animations properly * Fixing interactive ProgressBar tests. Co-authored-by: Regis Brid --- .../InteractionTests/ProgressBarTests.cs | 38 ++- dev/ProgressBar/ProgressBar.xaml | 273 ++++++++-------- .../ProgressBar_themeresources.xaml | 291 ++---------------- dev/ProgressBar/TestUI/ProgressBarPage.xaml | 21 +- .../TestUI/ProgressBarPage.xaml.cs | 23 +- .../TestUI/ProgressBarReTemplatePage.xaml | 3 + .../TestUI/ProgressBarReTemplatePage.xaml.cs | 14 +- 7 files changed, 235 insertions(+), 428 deletions(-) diff --git a/dev/ProgressBar/InteractionTests/ProgressBarTests.cs b/dev/ProgressBar/InteractionTests/ProgressBarTests.cs index 65eae151fc..2b2b1b2d52 100644 --- a/dev/ProgressBar/InteractionTests/ProgressBarTests.cs +++ b/dev/ProgressBar/InteractionTests/ProgressBarTests.cs @@ -84,12 +84,16 @@ public void UpdateIndicatorWidthTest() TextBlock widthInputText = FindElement.ByName("WidthInputText"); TextBlock indicatorWidthText = FindElement.ByName("IndicatorWidthText"); + Button updateMinMaxButton = FindElement.ByName + diff --git a/dev/ProgressBar/TestUI/ProgressBarPage.xaml.cs b/dev/ProgressBar/TestUI/ProgressBarPage.xaml.cs index 2b10a07d45..0ea4f6ecdc 100644 --- a/dev/ProgressBar/TestUI/ProgressBarPage.xaml.cs +++ b/dev/ProgressBar/TestUI/ProgressBarPage.xaml.cs @@ -30,11 +30,24 @@ private void ProgressBarPage_Loaded(object sender, RoutedEventArgs e) var progressBarRoot = VisualTreeHelper.GetChild(layoutRoot, 0); var clip = VisualTreeHelper.GetChild(progressBarRoot, 0); - var stackPanel = VisualTreeHelper.GetChild(clip, 0); - var indicator = (Rectangle)VisualTreeHelper.GetChild(stackPanel, 0); + var grid = VisualTreeHelper.GetChild(clip, 0); + Rectangle indicator = null; + int child = 0; + + do + { + indicator = VisualTreeHelper.GetChild(grid, child) as Rectangle; + child++; + } + while ((indicator == null || indicator.Name != "DeterminateProgressBarIndicator") && child < VisualTreeHelper.GetChildrenCount(grid)); + + if (indicator != null) + { + indicator.SizeChanged += this.Indicator_SizeChanged; + } - indicator.SizeChanged += this.Indicator_SizeChanged; IndicatorWidthText.Text = indicator.ActualWidth.ToString(); + ROValueText.Text = TestProgressBar.Value.ToString(); Loaded -= ProgressBarPage_Loaded; } @@ -53,6 +66,7 @@ public void UpdateMinMax_Click(object sender, RoutedEventArgs e) { TestProgressBar.Maximum = String.IsNullOrEmpty(MaximumInput.Text) ? Double.Parse(MaximumInput.PlaceholderText) : Double.Parse(MaximumInput.Text); TestProgressBar.Minimum = String.IsNullOrEmpty(MinimumInput.Text) ? Double.Parse(MinimumInput.PlaceholderText) : Double.Parse(MinimumInput.Text); + ROValueText.Text = TestProgressBar.Value.ToString(); } public void UpdateWidth_Click(object sender, RoutedEventArgs e) @@ -63,6 +77,7 @@ public void UpdateWidth_Click(object sender, RoutedEventArgs e) public void UpdateValue_Click(object sender, RoutedEventArgs e) { TestProgressBar.Value = String.IsNullOrEmpty(ValueInput.Text) ? Double.Parse(ValueInput.PlaceholderText) : Double.Parse(ValueInput.Text); + ROValueText.Text = TestProgressBar.Value.ToString(); } public void ChangeValue_Click(object sender, RoutedEventArgs e) @@ -75,6 +90,7 @@ public void ChangeValue_Click(object sender, RoutedEventArgs e) { TestProgressBar.Value += 1; } + ROValueText.Text = TestProgressBar.Value.ToString(); } public void UpdatePadding_Click(object sender, RoutedEventArgs e) @@ -83,6 +99,7 @@ public void UpdatePadding_Click(object sender, RoutedEventArgs e) double paddingRight = String.IsNullOrEmpty(PaddingRightInput.Text) ? Double.Parse(PaddingRightInput.PlaceholderText) : Double.Parse(PaddingRightInput.Text); TestProgressBar.Padding = new Thickness(paddingLeft, 0, paddingRight, 0); + ROValueText.Text = TestProgressBar.Value.ToString(); } } diff --git a/dev/ProgressBar/TestUI/ProgressBarReTemplatePage.xaml b/dev/ProgressBar/TestUI/ProgressBarReTemplatePage.xaml index 99ce20b228..c8cbb27a02 100644 --- a/dev/ProgressBar/TestUI/ProgressBarReTemplatePage.xaml +++ b/dev/ProgressBar/TestUI/ProgressBarReTemplatePage.xaml @@ -386,6 +386,9 @@ Style="{ThemeResource StandardGroupingStackPanel}"> + + + diff --git a/dev/ProgressBar/TestUI/ProgressBarReTemplatePage.xaml.cs b/dev/ProgressBar/TestUI/ProgressBarReTemplatePage.xaml.cs index a5f3c1e2b5..71528584a7 100644 --- a/dev/ProgressBar/TestUI/ProgressBarReTemplatePage.xaml.cs +++ b/dev/ProgressBar/TestUI/ProgressBarReTemplatePage.xaml.cs @@ -2,7 +2,6 @@ using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Media; -using Windows.UI.Xaml.Data; using Windows.UI.Xaml.Shapes; namespace MUXControlsTestApp @@ -22,9 +21,14 @@ private void ProgressBarReTemplatePage_Loaded(object sender, RoutedEventArgs e) VisualStateManager.GetVisualStateGroups(layoutRoot)[0].CurrentStateChanged += this.ProgressBarReTemplatePage_CurrentStateChanged; VisualStateText.Text = VisualStateManager.GetVisualStateGroups(layoutRoot)[0].CurrentState.Name; - var progressBarRoot = VisualTreeHelper.GetChild(layoutRoot, 0); + var progressBarRoot = VisualTreeHelper.GetChild(layoutRoot, 1); var clip = VisualTreeHelper.GetChild(progressBarRoot, 0); - var stackPanel = VisualTreeHelper.GetChild(clip, 0); + var indicator = VisualTreeHelper.GetChild(clip, 0) as Rectangle; + + indicator.SizeChanged += this.Indicator_SizeChanged; + + IndicatorWidthText.Text = indicator.ActualWidth.ToString(); + ROValueText.Text = TestProgressBar.Value.ToString(); Loaded -= ProgressBarReTemplatePage_Loaded; } @@ -43,6 +47,7 @@ public void UpdateMinMax_Click(object sender, RoutedEventArgs e) { TestProgressBar.Maximum = String.IsNullOrEmpty(MaximumInput.Text) ? Double.Parse(MaximumInput.PlaceholderText) : Double.Parse(MaximumInput.Text); TestProgressBar.Minimum = String.IsNullOrEmpty(MinimumInput.Text) ? Double.Parse(MinimumInput.PlaceholderText) : Double.Parse(MinimumInput.Text); + ROValueText.Text = TestProgressBar.Value.ToString(); } public void UpdateWidth_Click(object sender, RoutedEventArgs e) @@ -53,6 +58,7 @@ public void UpdateWidth_Click(object sender, RoutedEventArgs e) public void UpdateValue_Click(object sender, RoutedEventArgs e) { TestProgressBar.Value = String.IsNullOrEmpty(ValueInput.Text) ? Double.Parse(ValueInput.PlaceholderText) : Double.Parse(ValueInput.Text); + ROValueText.Text = TestProgressBar.Value.ToString(); } public void ChangeValue_Click(object sender, RoutedEventArgs e) @@ -65,6 +71,7 @@ public void ChangeValue_Click(object sender, RoutedEventArgs e) { TestProgressBar.Value += 1; } + ROValueText.Text = TestProgressBar.Value.ToString(); } public void UpdatePadding_Click(object sender, RoutedEventArgs e) @@ -73,6 +80,7 @@ public void UpdatePadding_Click(object sender, RoutedEventArgs e) double paddingRight = String.IsNullOrEmpty(PaddingRightInput.Text) ? Double.Parse(PaddingRightInput.PlaceholderText) : Double.Parse(PaddingRightInput.Text); TestProgressBar.Padding = new Thickness(paddingLeft, 0, paddingRight, 0); + ROValueText.Text = TestProgressBar.Value.ToString(); } } } From 1032f29233d89d34dbfa3918ea227f05f25e144f Mon Sep 17 00:00:00 2001 From: Ana Wishnoff Date: Fri, 19 Feb 2021 16:39:22 -0500 Subject: [PATCH 02/50] Updating Window.Current syntax (#4245) --- docs/winrt-apis-for-desktop.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/winrt-apis-for-desktop.md b/docs/winrt-apis-for-desktop.md index 5ac9b88f65..65328e78a0 100644 --- a/docs/winrt-apis-for-desktop.md +++ b/docs/winrt-apis-for-desktop.md @@ -14,7 +14,7 @@ This doc is a live document and will continue to be updated as we identify more Use `Window.ExtendsContentIntoTitleBar` instead. This API was added in Preview 4 and is intended as a permanent replacement in WinUI 3. API reference documentation for this is coming soon. -As mentioned above, `GetForCurrentView()` methods have a dependence on `ApplicationView` and are not supported in Desktop apps. Note that some `GetForCurrentView` methods will not only return null, but will also throw exceptions. We advise checking if `Window.Current()` is null before calling these APIs - although `Window.Current()` returning null may be expected in some scenarios, such as during background activation. +As mentioned above, `GetForCurrentView()` methods have a dependence on `ApplicationView` and are not supported in Desktop apps. Note that some `GetForCurrentView` methods will not only return null, but will also throw exceptions. We advise checking if `Window.Current` is null before calling these APIs - although `Window.Current` returning null may be expected in some scenarios, such as during background activation. ## CoreWindow From 3f0ca9fda0a5a10fb81b37af3d114bf29f898055 Mon Sep 17 00:00:00 2001 From: Marcel Wagner Date: Fri, 19 Feb 2021 22:39:57 +0100 Subject: [PATCH 03/50] Add new TextBlock styles (#4108) * Add new TextBlock styles and update test page for textbox to include samples * Update 2.5 file * Add lightweight styling resources * CR feedback * Update verification files * Update verification files --- dev/CommonStyles/CommonStyles.vcxitems | 12 +++- .../TestUI/CommonStyles_TestUI.projitems | 6 +- ...TextBoxPage.xaml => TextControlsPage.xaml} | 14 ++++- ...xPage.xaml.cs => TextControlsPage.xaml.cs} | 6 +- .../TextBlock_themeresources.xaml | 56 +++++++++++++++++++ .../TextBlock_themeresources_v2.5.xaml | 26 +++++++++ .../verification/NavigationViewAuto-4.xml | 2 +- .../verification/NavigationViewAuto-5.xml | 2 +- .../verification/NavigationViewAuto-6.xml | 2 +- .../verification/NavigationViewAuto-7.xml | 2 +- .../verification/NavigationViewAuto-8.xml | 2 +- .../NavigationViewLeftCompact-4.xml | 2 +- .../NavigationViewLeftCompact-5.xml | 2 +- .../NavigationViewLeftCompact-6.xml | 2 +- .../NavigationViewLeftCompact-7.xml | 2 +- .../NavigationViewLeftCompact-8.xml | 2 +- .../NavigationViewLeftMinimal-4.xml | 2 +- .../NavigationViewLeftMinimal-5.xml | 2 +- .../NavigationViewLeftMinimal-6.xml | 2 +- .../NavigationViewLeftMinimal-7.xml | 2 +- .../NavigationViewLeftMinimal-8.xml | 2 +- .../NavigationViewLeftPaneContent-4.xml | 2 +- .../NavigationViewLeftPaneContent-5.xml | 2 +- .../NavigationViewLeftPaneContent-6.xml | 2 +- .../NavigationViewLeftPaneContent-7.xml | 2 +- .../NavigationViewLeftPaneContent-8.xml | 2 +- .../NavigationViewScrolling-4.xml | 2 +- .../NavigationViewScrolling-5.xml | 2 +- .../NavigationViewScrolling-6.xml | 2 +- .../NavigationViewScrolling-7.xml | 2 +- .../NavigationViewScrolling-8.xml | 2 +- 31 files changed, 136 insertions(+), 34 deletions(-) rename dev/CommonStyles/TestUI/{TextBoxPage.xaml => TextControlsPage.xaml} (79%) rename dev/CommonStyles/TestUI/{TextBoxPage.xaml.cs => TextControlsPage.xaml.cs} (71%) create mode 100644 dev/CommonStyles/TextBlock_themeresources.xaml create mode 100644 dev/CommonStyles/TextBlock_themeresources_v2.5.xaml diff --git a/dev/CommonStyles/CommonStyles.vcxitems b/dev/CommonStyles/CommonStyles.vcxitems index bbe1c31808..c93434efa3 100755 --- a/dev/CommonStyles/CommonStyles.vcxitems +++ b/dev/CommonStyles/CommonStyles.vcxitems @@ -168,13 +168,23 @@ Latest RS1 - ThemeResources + ThemeResources V2dot5 RS1 ThemeResources + + Latest + RS1 + ThemeResources + + + V2dot5 + RS1 + ThemeResources + Latest RS1 diff --git a/dev/CommonStyles/TestUI/CommonStyles_TestUI.projitems b/dev/CommonStyles/TestUI/CommonStyles_TestUI.projitems index a876e95dce..e720a435fb 100644 --- a/dev/CommonStyles/TestUI/CommonStyles_TestUI.projitems +++ b/dev/CommonStyles/TestUI/CommonStyles_TestUI.projitems @@ -30,7 +30,7 @@ MSBuild:Compile false - + Designer MSBuild:Compile false @@ -54,8 +54,8 @@ CornerRadiusPage.xaml - - TextBoxPage.xaml + + TextControlsPage.xaml VisualStatesPage.xaml diff --git a/dev/CommonStyles/TestUI/TextBoxPage.xaml b/dev/CommonStyles/TestUI/TextControlsPage.xaml similarity index 79% rename from dev/CommonStyles/TestUI/TextBoxPage.xaml rename to dev/CommonStyles/TestUI/TextControlsPage.xaml index 438d269ba1..b8f0fb64f9 100644 --- a/dev/CommonStyles/TestUI/TextBoxPage.xaml +++ b/dev/CommonStyles/TestUI/TextControlsPage.xaml @@ -1,6 +1,6 @@  - + @@ -61,6 +61,16 @@ + + + + + + + + + + diff --git a/dev/CommonStyles/TestUI/TextBoxPage.xaml.cs b/dev/CommonStyles/TestUI/TextControlsPage.xaml.cs similarity index 71% rename from dev/CommonStyles/TestUI/TextBoxPage.xaml.cs rename to dev/CommonStyles/TestUI/TextControlsPage.xaml.cs index ea15bbddea..6e16741558 100644 --- a/dev/CommonStyles/TestUI/TextBoxPage.xaml.cs +++ b/dev/CommonStyles/TestUI/TextControlsPage.xaml.cs @@ -6,10 +6,10 @@ namespace MUXControlsTestApp { - [TopLevelTestPage(Name = "TextBox")] - public sealed partial class TextBoxPage : TestPage + [TopLevelTestPage(Name = "TextControls")] + public sealed partial class TextControlsPage : TestPage { - public TextBoxPage() + public TextControlsPage() { this.InitializeComponent(); } diff --git a/dev/CommonStyles/TextBlock_themeresources.xaml b/dev/CommonStyles/TextBlock_themeresources.xaml new file mode 100644 index 0000000000..30d3aee0b9 --- /dev/null +++ b/dev/CommonStyles/TextBlock_themeresources.xaml @@ -0,0 +1,56 @@ + + + + 12 + 14 + 20 + 28 + 40 + 68 + + + + + + + + + + + + + + + + + diff --git a/dev/CommonStyles/TextBlock_themeresources_v2.5.xaml b/dev/CommonStyles/TextBlock_themeresources_v2.5.xaml new file mode 100644 index 0000000000..9677856396 --- /dev/null +++ b/dev/CommonStyles/TextBlock_themeresources_v2.5.xaml @@ -0,0 +1,26 @@ + + + + 14 + 40 + 68 + + + + + + + + + diff --git a/test/MUXControlsTestApp/verification/NavigationViewAuto-4.xml b/test/MUXControlsTestApp/verification/NavigationViewAuto-4.xml index 8bd1ca246f..0838add076 100755 --- a/test/MUXControlsTestApp/verification/NavigationViewAuto-4.xml +++ b/test/MUXControlsTestApp/verification/NavigationViewAuto-4.xml @@ -302,7 +302,7 @@ FocusVisualPrimaryThickness=2,2,2,2 FocusVisualPrimaryBrush=#FF000000 Visibility=Visible - RenderSize=30,20 + RenderSize=32,22 [Windows.UI.Xaml.Controls.Grid] Padding=0,0,0,0 CornerRadius=0,0,0,0 diff --git a/test/MUXControlsTestApp/verification/NavigationViewAuto-5.xml b/test/MUXControlsTestApp/verification/NavigationViewAuto-5.xml index 8bd1ca246f..0838add076 100644 --- a/test/MUXControlsTestApp/verification/NavigationViewAuto-5.xml +++ b/test/MUXControlsTestApp/verification/NavigationViewAuto-5.xml @@ -302,7 +302,7 @@ FocusVisualPrimaryThickness=2,2,2,2 FocusVisualPrimaryBrush=#FF000000 Visibility=Visible - RenderSize=30,20 + RenderSize=32,22 [Windows.UI.Xaml.Controls.Grid] Padding=0,0,0,0 CornerRadius=0,0,0,0 diff --git a/test/MUXControlsTestApp/verification/NavigationViewAuto-6.xml b/test/MUXControlsTestApp/verification/NavigationViewAuto-6.xml index 8bd1ca246f..0838add076 100644 --- a/test/MUXControlsTestApp/verification/NavigationViewAuto-6.xml +++ b/test/MUXControlsTestApp/verification/NavigationViewAuto-6.xml @@ -302,7 +302,7 @@ FocusVisualPrimaryThickness=2,2,2,2 FocusVisualPrimaryBrush=#FF000000 Visibility=Visible - RenderSize=30,20 + RenderSize=32,22 [Windows.UI.Xaml.Controls.Grid] Padding=0,0,0,0 CornerRadius=0,0,0,0 diff --git a/test/MUXControlsTestApp/verification/NavigationViewAuto-7.xml b/test/MUXControlsTestApp/verification/NavigationViewAuto-7.xml index 0d7f0920e8..4d7e76ad84 100755 --- a/test/MUXControlsTestApp/verification/NavigationViewAuto-7.xml +++ b/test/MUXControlsTestApp/verification/NavigationViewAuto-7.xml @@ -306,7 +306,7 @@ FocusVisualPrimaryThickness=2,2,2,2 FocusVisualPrimaryBrush=#FF000000 Visibility=Visible - RenderSize=28,19 + RenderSize=32,22 [Windows.UI.Xaml.Controls.Grid] Padding=0,0,0,0 CornerRadius=0,0,0,0 diff --git a/test/MUXControlsTestApp/verification/NavigationViewAuto-8.xml b/test/MUXControlsTestApp/verification/NavigationViewAuto-8.xml index 3183d0a26b..a01a757b4c 100755 --- a/test/MUXControlsTestApp/verification/NavigationViewAuto-8.xml +++ b/test/MUXControlsTestApp/verification/NavigationViewAuto-8.xml @@ -306,7 +306,7 @@ FocusVisualPrimaryThickness=2,2,2,2 FocusVisualPrimaryBrush=#FF000000 Visibility=Visible - RenderSize=28,19 + RenderSize=32,22 [Windows.UI.Xaml.Controls.Grid] Padding=0,0,0,0 CornerRadius=0,0,0,0 diff --git a/test/MUXControlsTestApp/verification/NavigationViewLeftCompact-4.xml b/test/MUXControlsTestApp/verification/NavigationViewLeftCompact-4.xml index e43f469c6e..4dd1fccc55 100755 --- a/test/MUXControlsTestApp/verification/NavigationViewLeftCompact-4.xml +++ b/test/MUXControlsTestApp/verification/NavigationViewLeftCompact-4.xml @@ -255,7 +255,7 @@ FocusVisualPrimaryThickness=2,2,2,2 FocusVisualPrimaryBrush=#FF000000 Visibility=Collapsed - RenderSize=30,20 + RenderSize=32,22 [Windows.UI.Xaml.Controls.Grid] Padding=0,0,0,0 CornerRadius=0,0,0,0 diff --git a/test/MUXControlsTestApp/verification/NavigationViewLeftCompact-5.xml b/test/MUXControlsTestApp/verification/NavigationViewLeftCompact-5.xml index e43f469c6e..8359e22750 100644 --- a/test/MUXControlsTestApp/verification/NavigationViewLeftCompact-5.xml +++ b/test/MUXControlsTestApp/verification/NavigationViewLeftCompact-5.xml @@ -255,7 +255,7 @@ FocusVisualPrimaryThickness=2,2,2,2 FocusVisualPrimaryBrush=#FF000000 Visibility=Collapsed - RenderSize=30,20 + RenderSize=22,22 [Windows.UI.Xaml.Controls.Grid] Padding=0,0,0,0 CornerRadius=0,0,0,0 diff --git a/test/MUXControlsTestApp/verification/NavigationViewLeftCompact-6.xml b/test/MUXControlsTestApp/verification/NavigationViewLeftCompact-6.xml index e43f469c6e..8359e22750 100644 --- a/test/MUXControlsTestApp/verification/NavigationViewLeftCompact-6.xml +++ b/test/MUXControlsTestApp/verification/NavigationViewLeftCompact-6.xml @@ -255,7 +255,7 @@ FocusVisualPrimaryThickness=2,2,2,2 FocusVisualPrimaryBrush=#FF000000 Visibility=Collapsed - RenderSize=30,20 + RenderSize=22,22 [Windows.UI.Xaml.Controls.Grid] Padding=0,0,0,0 CornerRadius=0,0,0,0 diff --git a/test/MUXControlsTestApp/verification/NavigationViewLeftCompact-7.xml b/test/MUXControlsTestApp/verification/NavigationViewLeftCompact-7.xml index 22a405d67d..d02da6a903 100755 --- a/test/MUXControlsTestApp/verification/NavigationViewLeftCompact-7.xml +++ b/test/MUXControlsTestApp/verification/NavigationViewLeftCompact-7.xml @@ -259,7 +259,7 @@ FocusVisualPrimaryThickness=2,2,2,2 FocusVisualPrimaryBrush=#FF000000 Visibility=Collapsed - RenderSize=28,19 + RenderSize=22,22 [Windows.UI.Xaml.Controls.Grid] Padding=0,0,0,0 CornerRadius=0,0,0,0 diff --git a/test/MUXControlsTestApp/verification/NavigationViewLeftCompact-8.xml b/test/MUXControlsTestApp/verification/NavigationViewLeftCompact-8.xml index 7753c6700c..2ba9d21713 100755 --- a/test/MUXControlsTestApp/verification/NavigationViewLeftCompact-8.xml +++ b/test/MUXControlsTestApp/verification/NavigationViewLeftCompact-8.xml @@ -259,7 +259,7 @@ FocusVisualPrimaryThickness=2,2,2,2 FocusVisualPrimaryBrush=#FF000000 Visibility=Collapsed - RenderSize=28,19 + RenderSize=22,22 [Windows.UI.Xaml.Controls.Grid] Padding=0,0,0,0 CornerRadius=0,0,0,0 diff --git a/test/MUXControlsTestApp/verification/NavigationViewLeftMinimal-4.xml b/test/MUXControlsTestApp/verification/NavigationViewLeftMinimal-4.xml index 81ec2a62e2..7497fb0141 100755 --- a/test/MUXControlsTestApp/verification/NavigationViewLeftMinimal-4.xml +++ b/test/MUXControlsTestApp/verification/NavigationViewLeftMinimal-4.xml @@ -302,7 +302,7 @@ FocusVisualPrimaryThickness=2,2,2,2 FocusVisualPrimaryBrush=#FF000000 Visibility=Visible - RenderSize=30,20 + RenderSize=22,22 [Windows.UI.Xaml.Controls.Grid] Padding=0,0,0,0 CornerRadius=0,0,0,0 diff --git a/test/MUXControlsTestApp/verification/NavigationViewLeftMinimal-5.xml b/test/MUXControlsTestApp/verification/NavigationViewLeftMinimal-5.xml index 81ec2a62e2..7497fb0141 100644 --- a/test/MUXControlsTestApp/verification/NavigationViewLeftMinimal-5.xml +++ b/test/MUXControlsTestApp/verification/NavigationViewLeftMinimal-5.xml @@ -302,7 +302,7 @@ FocusVisualPrimaryThickness=2,2,2,2 FocusVisualPrimaryBrush=#FF000000 Visibility=Visible - RenderSize=30,20 + RenderSize=22,22 [Windows.UI.Xaml.Controls.Grid] Padding=0,0,0,0 CornerRadius=0,0,0,0 diff --git a/test/MUXControlsTestApp/verification/NavigationViewLeftMinimal-6.xml b/test/MUXControlsTestApp/verification/NavigationViewLeftMinimal-6.xml index 81ec2a62e2..7497fb0141 100644 --- a/test/MUXControlsTestApp/verification/NavigationViewLeftMinimal-6.xml +++ b/test/MUXControlsTestApp/verification/NavigationViewLeftMinimal-6.xml @@ -302,7 +302,7 @@ FocusVisualPrimaryThickness=2,2,2,2 FocusVisualPrimaryBrush=#FF000000 Visibility=Visible - RenderSize=30,20 + RenderSize=22,22 [Windows.UI.Xaml.Controls.Grid] Padding=0,0,0,0 CornerRadius=0,0,0,0 diff --git a/test/MUXControlsTestApp/verification/NavigationViewLeftMinimal-7.xml b/test/MUXControlsTestApp/verification/NavigationViewLeftMinimal-7.xml index 0124615982..5c99bca1ba 100755 --- a/test/MUXControlsTestApp/verification/NavigationViewLeftMinimal-7.xml +++ b/test/MUXControlsTestApp/verification/NavigationViewLeftMinimal-7.xml @@ -306,7 +306,7 @@ FocusVisualPrimaryThickness=2,2,2,2 FocusVisualPrimaryBrush=#FF000000 Visibility=Visible - RenderSize=28,19 + RenderSize=22,22 [Windows.UI.Xaml.Controls.Grid] Padding=0,0,0,0 CornerRadius=0,0,0,0 diff --git a/test/MUXControlsTestApp/verification/NavigationViewLeftMinimal-8.xml b/test/MUXControlsTestApp/verification/NavigationViewLeftMinimal-8.xml index 6dfe3278bb..c206480149 100755 --- a/test/MUXControlsTestApp/verification/NavigationViewLeftMinimal-8.xml +++ b/test/MUXControlsTestApp/verification/NavigationViewLeftMinimal-8.xml @@ -306,7 +306,7 @@ FocusVisualPrimaryThickness=2,2,2,2 FocusVisualPrimaryBrush=#FF000000 Visibility=Visible - RenderSize=28,19 + RenderSize=22,22 [Windows.UI.Xaml.Controls.Grid] Padding=0,0,0,0 CornerRadius=0,0,0,0 diff --git a/test/MUXControlsTestApp/verification/NavigationViewLeftPaneContent-4.xml b/test/MUXControlsTestApp/verification/NavigationViewLeftPaneContent-4.xml index 5e04ca8bb3..5696292fd6 100755 --- a/test/MUXControlsTestApp/verification/NavigationViewLeftPaneContent-4.xml +++ b/test/MUXControlsTestApp/verification/NavigationViewLeftPaneContent-4.xml @@ -255,7 +255,7 @@ FocusVisualPrimaryThickness=2,2,2,2 FocusVisualPrimaryBrush=#FF000000 Visibility=Visible - RenderSize=0,20 + RenderSize=0,21.28125 [Windows.UI.Xaml.Controls.Grid] Padding=0,0,0,0 CornerRadius=0,0,0,0 diff --git a/test/MUXControlsTestApp/verification/NavigationViewLeftPaneContent-5.xml b/test/MUXControlsTestApp/verification/NavigationViewLeftPaneContent-5.xml index 5e04ca8bb3..5696292fd6 100644 --- a/test/MUXControlsTestApp/verification/NavigationViewLeftPaneContent-5.xml +++ b/test/MUXControlsTestApp/verification/NavigationViewLeftPaneContent-5.xml @@ -255,7 +255,7 @@ FocusVisualPrimaryThickness=2,2,2,2 FocusVisualPrimaryBrush=#FF000000 Visibility=Visible - RenderSize=0,20 + RenderSize=0,21.28125 [Windows.UI.Xaml.Controls.Grid] Padding=0,0,0,0 CornerRadius=0,0,0,0 diff --git a/test/MUXControlsTestApp/verification/NavigationViewLeftPaneContent-6.xml b/test/MUXControlsTestApp/verification/NavigationViewLeftPaneContent-6.xml index 5e04ca8bb3..5696292fd6 100644 --- a/test/MUXControlsTestApp/verification/NavigationViewLeftPaneContent-6.xml +++ b/test/MUXControlsTestApp/verification/NavigationViewLeftPaneContent-6.xml @@ -255,7 +255,7 @@ FocusVisualPrimaryThickness=2,2,2,2 FocusVisualPrimaryBrush=#FF000000 Visibility=Visible - RenderSize=0,20 + RenderSize=0,21.28125 [Windows.UI.Xaml.Controls.Grid] Padding=0,0,0,0 CornerRadius=0,0,0,0 diff --git a/test/MUXControlsTestApp/verification/NavigationViewLeftPaneContent-7.xml b/test/MUXControlsTestApp/verification/NavigationViewLeftPaneContent-7.xml index 3faf4627f1..f9c56d8ba5 100755 --- a/test/MUXControlsTestApp/verification/NavigationViewLeftPaneContent-7.xml +++ b/test/MUXControlsTestApp/verification/NavigationViewLeftPaneContent-7.xml @@ -259,7 +259,7 @@ FocusVisualPrimaryThickness=2,2,2,2 FocusVisualPrimaryBrush=#FF000000 Visibility=Visible - RenderSize=0,19 + RenderSize=0,21.28125 [Windows.UI.Xaml.Controls.Grid] Padding=0,0,0,0 CornerRadius=0,0,0,0 diff --git a/test/MUXControlsTestApp/verification/NavigationViewLeftPaneContent-8.xml b/test/MUXControlsTestApp/verification/NavigationViewLeftPaneContent-8.xml index 75b6922828..9d57db6b29 100755 --- a/test/MUXControlsTestApp/verification/NavigationViewLeftPaneContent-8.xml +++ b/test/MUXControlsTestApp/verification/NavigationViewLeftPaneContent-8.xml @@ -259,7 +259,7 @@ FocusVisualPrimaryThickness=2,2,2,2 FocusVisualPrimaryBrush=#FF000000 Visibility=Visible - RenderSize=0,19 + RenderSize=0,21.28125 [Windows.UI.Xaml.Controls.Grid] Padding=0,0,0,0 CornerRadius=0,0,0,0 diff --git a/test/MUXControlsTestApp/verification/NavigationViewScrolling-4.xml b/test/MUXControlsTestApp/verification/NavigationViewScrolling-4.xml index e0ff76cbd2..8ef4a697b8 100755 --- a/test/MUXControlsTestApp/verification/NavigationViewScrolling-4.xml +++ b/test/MUXControlsTestApp/verification/NavigationViewScrolling-4.xml @@ -255,7 +255,7 @@ FocusVisualPrimaryThickness=2,2,2,2 FocusVisualPrimaryBrush=#FF000000 Visibility=Visible - RenderSize=0,20 + RenderSize=0,21.28125 [Windows.UI.Xaml.Controls.Grid] Padding=0,0,0,0 CornerRadius=0,0,0,0 diff --git a/test/MUXControlsTestApp/verification/NavigationViewScrolling-5.xml b/test/MUXControlsTestApp/verification/NavigationViewScrolling-5.xml index e0ff76cbd2..8ef4a697b8 100644 --- a/test/MUXControlsTestApp/verification/NavigationViewScrolling-5.xml +++ b/test/MUXControlsTestApp/verification/NavigationViewScrolling-5.xml @@ -255,7 +255,7 @@ FocusVisualPrimaryThickness=2,2,2,2 FocusVisualPrimaryBrush=#FF000000 Visibility=Visible - RenderSize=0,20 + RenderSize=0,21.28125 [Windows.UI.Xaml.Controls.Grid] Padding=0,0,0,0 CornerRadius=0,0,0,0 diff --git a/test/MUXControlsTestApp/verification/NavigationViewScrolling-6.xml b/test/MUXControlsTestApp/verification/NavigationViewScrolling-6.xml index e0ff76cbd2..8ef4a697b8 100644 --- a/test/MUXControlsTestApp/verification/NavigationViewScrolling-6.xml +++ b/test/MUXControlsTestApp/verification/NavigationViewScrolling-6.xml @@ -255,7 +255,7 @@ FocusVisualPrimaryThickness=2,2,2,2 FocusVisualPrimaryBrush=#FF000000 Visibility=Visible - RenderSize=0,20 + RenderSize=0,21.28125 [Windows.UI.Xaml.Controls.Grid] Padding=0,0,0,0 CornerRadius=0,0,0,0 diff --git a/test/MUXControlsTestApp/verification/NavigationViewScrolling-7.xml b/test/MUXControlsTestApp/verification/NavigationViewScrolling-7.xml index a7a58dc518..ba0759a97d 100755 --- a/test/MUXControlsTestApp/verification/NavigationViewScrolling-7.xml +++ b/test/MUXControlsTestApp/verification/NavigationViewScrolling-7.xml @@ -259,7 +259,7 @@ FocusVisualPrimaryThickness=2,2,2,2 FocusVisualPrimaryBrush=#FF000000 Visibility=Visible - RenderSize=0,19 + RenderSize=0,21.28125 [Windows.UI.Xaml.Controls.Grid] Padding=0,0,0,0 CornerRadius=0,0,0,0 diff --git a/test/MUXControlsTestApp/verification/NavigationViewScrolling-8.xml b/test/MUXControlsTestApp/verification/NavigationViewScrolling-8.xml index 1ba077b8a6..dda8529431 100755 --- a/test/MUXControlsTestApp/verification/NavigationViewScrolling-8.xml +++ b/test/MUXControlsTestApp/verification/NavigationViewScrolling-8.xml @@ -259,7 +259,7 @@ FocusVisualPrimaryThickness=2,2,2,2 FocusVisualPrimaryBrush=#FF000000 Visibility=Visible - RenderSize=0,19 + RenderSize=0,21.28125 [Windows.UI.Xaml.Controls.Grid] Padding=0,0,0,0 CornerRadius=0,0,0,0 From cabc667de128fffd9eaf50d72a4b8dfb51301f5c Mon Sep 17 00:00:00 2001 From: Vsevolod Date: Fri, 19 Feb 2021 15:05:27 -0800 Subject: [PATCH 04/50] Update color elevation strokes (#4250) --- dev/CommonStyles/Common_themeresources_any.xaml | 8 ++++---- dev/CommonStyles/TextBox_themeresources.xaml | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) mode change 100644 => 100755 dev/CommonStyles/Common_themeresources_any.xaml mode change 100644 => 100755 dev/CommonStyles/TextBox_themeresources.xaml diff --git a/dev/CommonStyles/Common_themeresources_any.xaml b/dev/CommonStyles/Common_themeresources_any.xaml old mode 100644 new mode 100755 index 9a34fb01e0..9d94c08cde --- a/dev/CommonStyles/Common_themeresources_any.xaml +++ b/dev/CommonStyles/Common_themeresources_any.xaml @@ -211,7 +211,7 @@ - + @@ -228,7 +228,7 @@ - + @@ -440,7 +440,7 @@ - + @@ -457,7 +457,7 @@ - + diff --git a/dev/CommonStyles/TextBox_themeresources.xaml b/dev/CommonStyles/TextBox_themeresources.xaml old mode 100644 new mode 100755 index cb6f8be738..29a156fd4e --- a/dev/CommonStyles/TextBox_themeresources.xaml +++ b/dev/CommonStyles/TextBox_themeresources.xaml @@ -62,17 +62,17 @@ - + - + - + @@ -159,17 +159,17 @@ - + - + - + From 902c257424a3f15b70eff486b3d520509565c9af Mon Sep 17 00:00:00 2001 From: Marcel Wagner Date: Sun, 21 Feb 2021 16:17:10 +0100 Subject: [PATCH 05/50] Add scrolling into view on selection (#3966) --- dev/TabView/TabViewItem.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/dev/TabView/TabViewItem.cpp b/dev/TabView/TabViewItem.cpp index 4487ace0f4..517c82f3fe 100644 --- a/dev/TabView/TabViewItem.cpp +++ b/dev/TabView/TabViewItem.cpp @@ -97,6 +97,7 @@ void TabViewItem::OnIsSelectedPropertyChanged(const winrt::DependencyObject& sen if (IsSelected()) { SetValue(winrt::Canvas::ZIndexProperty(),box_value(20)); + StartBringIntoView(); } else { From 2ac5f5daa127751b1f345e2fad378655f8468772 Mon Sep 17 00:00:00 2001 From: Ana Wishnoff Date: Mon, 22 Feb 2021 10:12:39 -0500 Subject: [PATCH 06/50] Adding more to WinRT API changes doc (#4259) * Updating ordering * Adding a few more APIs to the list --- docs/winrt-apis-for-desktop.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/winrt-apis-for-desktop.md b/docs/winrt-apis-for-desktop.md index 65328e78a0..9b22e01f1a 100644 --- a/docs/winrt-apis-for-desktop.md +++ b/docs/winrt-apis-for-desktop.md @@ -58,3 +58,13 @@ This API is no longer supported in Desktop apps, and neither are any of its memb - [`SystemNavigationManager.GetForCurrentView()`](https://docs.microsoft.com/uwp/api/windows.ui.core.systemnavigationmanager.getforcurrentview) No alternative - this functionality is not intended to be supported in Desktop apps. + +## CoreTextServicesManager +- [`CoreTextServicesManager.GetForCurrentView()`](https://docs.microsoft.com/uwp/api/windows.ui.text.core.coretextservicesmanager?view=winrt-19041) + + This method will be supported for Desktop apps in future Windows versions, and is currently only supported in Insider builds. For non-Insider builds, this API is unsupported and there is no current workaround. + +## CoreInputView +- [`CoreInputView.GetForCurrentView()`](https://docs.microsoft.com/uwp/api/windows.ui.viewmanagement.core.coreinputview.getforcurrentview?view=winrt-19041) + + This method is **still working and supported for Desktop apps**, even without [CoreWindow](https://docs.microsoft.com/uwp/api/windows.ui.core.corewindow?view=winrt-19041). It can be created on any thread, and if that thread has a foreground window, it will produce events. \ No newline at end of file From 7323c1c82f6aa48559cc00f9987bf005383390c5 Mon Sep 17 00:00:00 2001 From: Stephen L Peters Date: Mon, 22 Feb 2021 08:01:21 -0800 Subject: [PATCH 07/50] Move ImageIcon and ImageIconSource out of preview. (#4281) --- dev/IconSource/IconSource.idl | 2 +- dev/ImageIcon/ImageIcon.idl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dev/IconSource/IconSource.idl b/dev/IconSource/IconSource.idl index 14ec4067f8..84aa463411 100644 --- a/dev/IconSource/IconSource.idl +++ b/dev/IconSource/IconSource.idl @@ -75,7 +75,7 @@ unsealed runtimeclass PathIconSource : IconSource static Windows.UI.Xaml.DependencyProperty DataProperty { get; }; } -[MUX_PREVIEW] +[MUX_PUBLIC] [webhosthidden] unsealed runtimeclass ImageIconSource : IconSource { diff --git a/dev/ImageIcon/ImageIcon.idl b/dev/ImageIcon/ImageIcon.idl index 6b9c2adcd2..efdea84985 100644 --- a/dev/ImageIcon/ImageIcon.idl +++ b/dev/ImageIcon/ImageIcon.idl @@ -1,7 +1,7 @@ namespace MU_XC_NAMESPACE { -[MUX_PREVIEW] +[MUX_PUBLIC] [webhosthidden] unsealed runtimeclass ImageIcon : Windows.UI.Xaml.Controls.IconElement { From 2abfc8384db62d69994c81662efd3d753f02ae6e Mon Sep 17 00:00:00 2001 From: almedina-ms <35784165+almedina-ms@users.noreply.github.com> Date: Mon, 22 Feb 2021 09:27:28 -0800 Subject: [PATCH 08/50] [Breadcrumb] Update Breadcrumb API, design and interaction tests (#4090) * Wrap PreviewKeyDown event assignation to avoid test failure * Update github issue * Add tests to cover basic mouse scenarios * Add one keyboard interaction test * Add sharing version * Update styles for font color * Update design * Add style for button to respect transparent background * Fix enter key on ellipsis bug * Add key down handler * Fix keyboard navigation for control and breadcrumb items * Update brushes names and HC * Add sharing version * Update styles for font color * Update design * Add style for button to respect transparent background * Fix enter key on ellipsis bug * Add key down handler * Fix keyboard navigation for control and breadcrumb items * Update API * Functional version 1 * Accessibility tweaks: Landmark & Invoke impl. * Add index and item count automation properties * Add index to ClickedEventArgs * Mostly BreadcrumbDropDownItem updates * Update some tests to handle the new design * Code cleanup & fixes, mostly in BreadcrumbItem * Using BreadcrumbDropDownItem resources instead of MenuFlyoutItem * Update interaction tests * Update keyboard navigation bug where ellipis item would gain focus when not in view * Adding ellipsis button's automation name 'More' and more code cleanup * Fix pipeline build break * Fix pipeline Breadcrumb build break. * Fix pipeline Breadcrumb build break. * Fix focus setting in Rs3 and previous versions * Provide workaround for merging * Try to fix tests for RS2 & 3 by adding extra button and tabbing three tiems * Fix funky behaviour for data template * Replace twopane control for grid to make RS2&3 versions work * Add fixes for dropdown navigation and test patches * Test to check if RS3+ os versions require more than 1 TAB * Fix test helper function * Add log comments for sanity check * Add version with all focus method trying * Fixing Breadcrumb theme resources location Co-authored-by: Regis Brid --- dev/Breadcrumb/APITests/BreadcrumbTests.cs | 88 ++- dev/Breadcrumb/Breadcrumb.cpp | 139 +++- dev/Breadcrumb/Breadcrumb.h | 23 +- dev/Breadcrumb/Breadcrumb.idl | 18 +- dev/Breadcrumb/Breadcrumb.vcxitems | 14 +- dev/Breadcrumb/Breadcrumb.xaml | 278 ++++++- dev/Breadcrumb/BreadcrumbAutomationPeer.idl | 20 + .../BreadcrumbDropDownElementFactory.cpp | 69 ++ .../BreadcrumbDropDownElementFactory.h | 21 + dev/Breadcrumb/BreadcrumbDropDownItem.cpp | 274 +++++++ dev/Breadcrumb/BreadcrumbDropDownItem.h | 65 ++ .../BreadcrumbDropDownItemAutomationPeer.cpp | 55 ++ .../BreadcrumbDropDownItemAutomationPeer.h | 27 + dev/Breadcrumb/BreadcrumbElementFactory.cpp | 11 +- dev/Breadcrumb/BreadcrumbItem.cpp | 261 +++++-- dev/Breadcrumb/BreadcrumbItem.h | 74 +- .../BreadcrumbItemAutomationPeer.cpp | 55 ++ dev/Breadcrumb/BreadcrumbItemAutomationPeer.h | 26 + .../BreadcrumbItemClickedEventArgs.cpp | 10 + .../BreadcrumbItemClickedEventArgs.h | 4 + dev/Breadcrumb/BreadcrumbIterable.cpp | 3 - dev/Breadcrumb/BreadcrumbIterator.cpp | 3 - dev/Breadcrumb/BreadcrumbLayout.cpp | 55 +- dev/Breadcrumb/BreadcrumbLayout.h | 19 +- dev/Breadcrumb/Breadcrumb_themeresources.xaml | 98 ++- .../InteractionTests/BreadcrumbTests.cs | 719 +++++++++++++++++- dev/Breadcrumb/Strings/en-us/Resources.resw | 124 +++ dev/Breadcrumb/TestUI/BreadcrumbPage.xaml | 109 ++- dev/Breadcrumb/TestUI/BreadcrumbPage.xaml.cs | 32 +- dev/Breadcrumb/TestUI/TreeStructure.cs | 5 + dev/Generated/Breadcrumb.properties.cpp | 22 +- dev/Generated/Breadcrumb.properties.h | 10 +- .../BreadcrumbDropDownItem.properties.cpp | 16 + ...bDropDownItemAutomationPeer.properties.cpp | 16 + ...readcrumbItemAutomationPeer.properties.cpp | 16 + dev/ResourceHelper/ResourceAccessor.h | 2 + dev/Telemetry/RuntimeProfiler.h | 1 + 37 files changed, 2480 insertions(+), 302 deletions(-) create mode 100644 dev/Breadcrumb/BreadcrumbAutomationPeer.idl create mode 100644 dev/Breadcrumb/BreadcrumbDropDownElementFactory.cpp create mode 100644 dev/Breadcrumb/BreadcrumbDropDownElementFactory.h create mode 100644 dev/Breadcrumb/BreadcrumbDropDownItem.cpp create mode 100644 dev/Breadcrumb/BreadcrumbDropDownItem.h create mode 100644 dev/Breadcrumb/BreadcrumbDropDownItemAutomationPeer.cpp create mode 100644 dev/Breadcrumb/BreadcrumbDropDownItemAutomationPeer.h create mode 100644 dev/Breadcrumb/BreadcrumbItemAutomationPeer.cpp create mode 100644 dev/Breadcrumb/BreadcrumbItemAutomationPeer.h create mode 100644 dev/Breadcrumb/Strings/en-us/Resources.resw create mode 100644 dev/Generated/BreadcrumbDropDownItem.properties.cpp create mode 100644 dev/Generated/BreadcrumbDropDownItemAutomationPeer.properties.cpp create mode 100644 dev/Generated/BreadcrumbItemAutomationPeer.properties.cpp diff --git a/dev/Breadcrumb/APITests/BreadcrumbTests.cs b/dev/Breadcrumb/APITests/BreadcrumbTests.cs index 9820be87e0..b0c66ec34d 100644 --- a/dev/Breadcrumb/APITests/BreadcrumbTests.cs +++ b/dev/Breadcrumb/APITests/BreadcrumbTests.cs @@ -44,7 +44,7 @@ public void VerifyBreadcrumbDefaultAPIValues() Verify.IsNull(breadcrumb.ItemsSource, "The default ItemsSource property value must be null"); Verify.IsNull(breadcrumb.ItemTemplate, "The default ItemTemplate property value must be null"); - Verify.IsNull(breadcrumb.DropdownItemTemplate, "The default DropdownItemTemplate property value must be null"); + Verify.IsNull(breadcrumb.DropDownItemTemplate, "The default DropdownItemTemplate property value must be null"); }); } @@ -245,6 +245,84 @@ public void VerifyDropdownItemTemplate() { Breadcrumb breadcrumb = null; + RunOnUIThread.Execute(() => + { + breadcrumb = new Breadcrumb(); + breadcrumb.ItemsSource = new List() { + new MockClass { MockProperty = "Node 1" }, + new MockClass { MockProperty = "Node 2" }, + }; + + // Set a custom ItemTemplate to be wrapped in a BreadcrumbItem. + var itemTemplate = (DataTemplate)XamlReader.Load( + @" + + + + + + + + "); + + breadcrumb.DropDownItemTemplate = itemTemplate; + + var stackPanel = new StackPanel(); + stackPanel.Width = 60; + stackPanel.Children.Add(breadcrumb); + + Content = stackPanel; + Content.UpdateLayout(); + }); + + IdleSynchronizer.Wait(); + + Button ellipsisButton = null; + RunOnUIThread.Execute(() => + { + ItemsRepeater breadcrumbItemsRepeater = (ItemsRepeater)breadcrumb.FindVisualChildByName("PART_BreadcrumbItemsRepeater"); + Verify.IsNotNull(breadcrumbItemsRepeater, "The underlying items repeater (1) could not be retrieved"); + + var breadcrumbNode1 = breadcrumbItemsRepeater.TryGetElement(0) as BreadcrumbItem; + Verify.IsNotNull(breadcrumbNode1, "Our custom ItemTemplate (1) should have been wrapped in a BreadcrumbItem."); + + ellipsisButton = (Button)breadcrumbNode1.FindVisualChildByName("PART_BreadcrumbItemButton"); + Verify.IsNotNull(ellipsisButton, "The ellipsis item (1) could not be retrieved"); + + var automationPeer = new ButtonAutomationPeer(ellipsisButton); + var invokationPattern = automationPeer.GetPattern(PatternInterface.Invoke) as IInvokeProvider; + invokationPattern?.Invoke(); + }); + + IdleSynchronizer.Wait(); + + RunOnUIThread.Execute(() => + { + Flyout ellipsisFlyout = (Flyout)ellipsisButton.Flyout; + Verify.IsNotNull(ellipsisButton, "The ellipsis flyout (1) could not be retrieved"); + + ItemsRepeater ellipsisItemsRepeater = (ItemsRepeater)ellipsisFlyout.Content; + Verify.IsNotNull(ellipsisItemsRepeater, "The underlying flyout items repeater (1) could not be retrieved"); + + ellipsisItemsRepeater.Loaded += (object sender, RoutedEventArgs e) => { + TextBlock ellipsisNode1 = ellipsisItemsRepeater.TryGetElement(0) as TextBlock; + Verify.IsNotNull(ellipsisNode1, "Our flyout ItemTemplate (1) should have been wrapped in a TextBlock."); + + // change this conditions + bool testCondition = !(ellipsisNode1.Foreground is SolidColorBrush brush && brush.Color == Colors.Blue); + Verify.IsTrue(testCondition, "Default foreground color of the BreadcrumbItem should not have been [blue]."); + }; + }); + } + + [TestMethod] + public void VerifyDropdownItemTemplateWithNoControl() + { + Breadcrumb breadcrumb = null; + RunOnUIThread.Execute(() => { breadcrumb = new Breadcrumb(); @@ -252,14 +330,14 @@ public void VerifyDropdownItemTemplate() // Set a custom ItemTemplate to be wrapped in a BreadcrumbItem. var itemTemplate = (DataTemplate)XamlReader.Load( - @" + @" "); - breadcrumb.DropdownItemTemplate = itemTemplate; + breadcrumb.DropDownItemTemplate = itemTemplate; var stackPanel = new StackPanel(); - stackPanel.Width = 130; + stackPanel.Width = 60; stackPanel.Children.Add(breadcrumb); Content = stackPanel; @@ -282,7 +360,7 @@ public void VerifyDropdownItemTemplate() var automationPeer = new ButtonAutomationPeer(ellipsisButton); var invokationPattern = automationPeer.GetPattern(PatternInterface.Invoke) as IInvokeProvider; - invokationPattern?.Invoke(); + invokationPattern?.Invoke(); }); IdleSynchronizer.Wait(); diff --git a/dev/Breadcrumb/Breadcrumb.cpp b/dev/Breadcrumb/Breadcrumb.cpp index e67b5b1c55..22d441489a 100644 --- a/dev/Breadcrumb/Breadcrumb.cpp +++ b/dev/Breadcrumb/Breadcrumb.cpp @@ -7,7 +7,6 @@ #include "Breadcrumb.h" #include "RuntimeProfiler.h" #include "ResourceAccessor.h" - #include "BreadcrumbItem.h" #include "BreadcrumbLayout.h" #include "BreadcrumbItemClickedEventArgs.h" @@ -18,15 +17,16 @@ Breadcrumb::Breadcrumb() SetDefaultStyleKey(this); m_itemsRepeaterElementFactory = winrt::make_self(); + m_itemsRepeaterLayout = winrt::make_self(*this); m_itemsIterable = winrt::make_self(); } void Breadcrumb::RevokeListeners() { m_itemsRepeaterLoadedRevoker.revoke(); - m_itemRepeaterElementPreparedRevoker.revoke(); - m_itemRepeaterElementIndexChangedRevoker.revoke(); - m_itemRepeaterElementClearingRevoker.revoke(); + m_itemsRepeaterElementPreparedRevoker.revoke(); + m_itemsRepeaterElementIndexChangedRevoker.revoke(); + m_itemsRepeaterElementClearingRevoker.revoke(); m_itemsSourceChanged.revoke(); m_itemsSourceAsObservableVectorChanged.revoke(); } @@ -39,12 +39,18 @@ void Breadcrumb::OnApplyTemplate() winrt::IControlProtected controlProtected{ *this }; - m_itemsRepeater.set(GetTemplateChildT(L"PART_BreadcrumbItemsRepeater", controlProtected)); + m_itemsRepeater.set(GetTemplateChildT(s_breadcrumbItemsRepeaterPartName, controlProtected)); if (auto const& thisAsIUIElement7 = this->try_as()) { thisAsIUIElement7.PreviewKeyDown({ this, &Breadcrumb::OnChildPreviewKeyDown }); } + else if (auto const& thisAsUIElement = this->try_as()) + { + m_breadcrumbKeyDownHandlerRevoker = AddRoutedEventHandler(thisAsUIElement, + { this, &Breadcrumb::OnChildPreviewKeyDown }, + true /*handledEventsToo*/); + } AccessKeyInvoked({ this, &Breadcrumb::OnAccessKeyInvoked }); GettingFocus({ this, &Breadcrumb::OnGettingFocus }); @@ -53,14 +59,15 @@ void Breadcrumb::OnApplyTemplate() if (const auto& itemsRepeater = m_itemsRepeater.get()) { + itemsRepeater.Layout(*m_itemsRepeaterLayout); itemsRepeater.ItemsSource(winrt::make>()); itemsRepeater.ItemTemplate(*m_itemsRepeaterElementFactory); - m_itemRepeaterElementPreparedRevoker = itemsRepeater.ElementPrepared(winrt::auto_revoke, { this, &Breadcrumb::OnElementPreparedEvent }); - m_itemRepeaterElementIndexChangedRevoker = itemsRepeater.ElementIndexChanged(winrt::auto_revoke, { this, &Breadcrumb::OnElementIndexChangedEvent }); - m_itemRepeaterElementClearingRevoker = itemsRepeater.ElementClearing(winrt::auto_revoke, { this, &Breadcrumb::OnElementClearingEvent }); + m_itemsRepeaterElementPreparedRevoker = itemsRepeater.ElementPrepared(winrt::auto_revoke, { this, &Breadcrumb::OnElementPreparedEvent }); + m_itemsRepeaterElementIndexChangedRevoker = itemsRepeater.ElementIndexChanged(winrt::auto_revoke, { this, &Breadcrumb::OnElementIndexChangedEvent }); + m_itemsRepeaterElementClearingRevoker = itemsRepeater.ElementClearing(winrt::auto_revoke, { this, &Breadcrumb::OnElementClearingEvent }); - m_itemsRepeaterLoadedRevoker = itemsRepeater.Loaded(winrt::auto_revoke, { this, &Breadcrumb::OnBreadcrumbItemRepeaterLoaded }); + m_itemsRepeaterLoadedRevoker = itemsRepeater.Loaded(winrt::auto_revoke, { this, &Breadcrumb::OnBreadcrumbItemsRepeaterLoaded }); } UpdateItemsRepeaterItemsSource(); @@ -78,9 +85,9 @@ void Breadcrumb::OnPropertyChanged(const winrt::DependencyPropertyChangedEventAr { UpdateItemTemplate(); } - else if (property == s_DropdownItemTemplateProperty) + else if (property == s_DropDownItemTemplateProperty) { - UpdateEllipsisBreadcrumbItemDropdownItemTemplate(); + UpdateEllipsisBreadcrumbItemDropDownItemTemplate(); } } @@ -89,9 +96,9 @@ void Breadcrumb::OnFlowDirectionChanged(winrt::DependencyObject const& o, winrt: UpdateBreadcrumbItemsFlowDirection(); } -void Breadcrumb::OnBreadcrumbItemRepeaterLoaded(const winrt::IInspectable&, const winrt::RoutedEventArgs&) +void Breadcrumb::OnBreadcrumbItemsRepeaterLoaded(const winrt::IInspectable&, const winrt::RoutedEventArgs&) { - if (const auto& breadcrumbItemRepeater = m_itemsRepeater.get()) + if (const auto& breadcrumbItemsRepeater = m_itemsRepeater.get()) { OnBreadcrumbItemsSourceCollectionChanged(nullptr, nullptr); } @@ -103,16 +110,16 @@ void Breadcrumb::UpdateItemTemplate() m_itemsRepeaterElementFactory->UserElementFactory(newItemTemplate); } -void Breadcrumb::UpdateEllipsisBreadcrumbItemDropdownItemTemplate() +void Breadcrumb::UpdateEllipsisBreadcrumbItemDropDownItemTemplate() { - const winrt::IInspectable& newItemTemplate = DropdownItemTemplate(); + const winrt::IInspectable& newItemTemplate = DropDownItemTemplate(); // Copy the item template to the ellipsis button too if (const auto& ellipsisBreadcrumbItem = m_ellipsisBreadcrumbItem.get()) { if (const auto& itemImpl = winrt::get_self(ellipsisBreadcrumbItem)) { - itemImpl->SetFlyoutDataTemplate(newItemTemplate); + itemImpl->SetDropDownItemDataTemplate(newItemTemplate); } } } @@ -220,15 +227,21 @@ void Breadcrumb::OnElementPreparedEvent(const winrt::ItemsRepeater&, const winrt { if (const auto& itemImpl = winrt::get_self(item)) { - // The first element is always the ellipsis item + // Set the parent breadcrumb reference for raising click events itemImpl->SetParentBreadcrumb(*this); + // Set the item index to fill the Index parameter in the ClickedEventArgs const uint32_t itemIndex = args.Index(); + itemImpl->SetIndex(itemIndex); + + // The first element is always the ellipsis item if (itemIndex == 0) { itemImpl->SetPropertiesForEllipsisNode(); m_ellipsisBreadcrumbItem.set(item); - UpdateEllipsisBreadcrumbItemDropdownItemTemplate(); + UpdateEllipsisBreadcrumbItemDropDownItemTemplate(); + + winrt::AutomationProperties::SetName(item, ResourceAccessor::GetLocalizedStringResource(SR_AutomationNameEllipsisBreadcrumbItem)); } else { @@ -245,17 +258,30 @@ void Breadcrumb::OnElementPreparedEvent(const winrt::ItemsRepeater&, const winrt // Any other element just resets the visual properties itemImpl->ResetVisualProperties(); } + + winrt::AutomationProperties::SetName(item, s_breadcrumbItemAutomationName + winrt::to_hstring(itemIndex)); } } } } } -void Breadcrumb::OnElementIndexChangedEvent(const winrt::ItemsRepeater&, const winrt::ItemsRepeaterElementIndexChangedEventArgs& args) +void Breadcrumb::OnElementIndexChangedEvent(const winrt::ItemsRepeater& sender, const winrt::ItemsRepeaterElementIndexChangedEventArgs& args) { if (m_focusedIndex == args.OldIndex()) { - FocusElementAt(args.NewIndex()); + const uint32_t newIndex = args.NewIndex(); + + if (const auto& item = args.Element().try_as()) + { + if (const auto& itemImpl = winrt::get_self(item)) + { + itemImpl->SetIndex(newIndex); + } + } + + FocusElementAt(newIndex); + winrt::AutomationProperties::SetName(args.Element(), s_breadcrumbItemAutomationName + winrt::to_hstring(newIndex)); } } @@ -265,13 +291,16 @@ void Breadcrumb::OnElementClearingEvent(const winrt::ItemsRepeater&, const winrt { const auto& itemImpl = winrt::get_self(item); itemImpl->ResetVisualProperties(); + + winrt::AutomationProperties::SetName(item, winrt::hstring()); } } -void Breadcrumb::RaiseItemClickedEvent(const winrt::IInspectable& content) +void Breadcrumb::RaiseItemClickedEvent(const winrt::IInspectable& content, const uint32_t index) { const auto& eventArgs = winrt::make_self(); eventArgs->Item(content); + eventArgs->Index(index); if (m_itemClickedEventSource) { @@ -300,11 +329,11 @@ winrt::IVector Breadcrumb::HiddenElements() const // the arrange method, so we retrieve the list from it if (const auto& itemsRepeater = m_itemsRepeater.get()) { - if (const auto& breadcrumbLayout = itemsRepeater.Layout().try_as()) + if (m_itemsRepeaterLayout) { - if (breadcrumbLayout->EllipsisIsRendered()) + if (m_itemsRepeaterLayout->EllipsisIsRendered()) { - return GetHiddenElementsList(breadcrumbLayout->FirstRenderedItemIndexAfterEllipsis()); + return GetHiddenElementsList(m_itemsRepeaterLayout->FirstRenderedItemIndexAfterEllipsis()); } } } @@ -313,6 +342,35 @@ winrt::IVector Breadcrumb::HiddenElements() const return winrt::make>(); } +void Breadcrumb::ReIndexVisibleElementsForAccessibility() const +{ + // Once the arrangement of Breadcrumb Items has happened then index all visible items + if (auto const& itemsRepeater = m_itemsRepeater.get()) + { + const uint32_t visibleItemsCount{ m_itemsRepeaterLayout->GetVisibleItemsCount() }; + uint32_t firstItemToIndex{ 1 }; + + if (m_itemsRepeaterLayout->EllipsisIsRendered()) + { + firstItemToIndex = m_itemsRepeaterLayout->FirstRenderedItemIndexAfterEllipsis(); + } + + const auto& itemsSourceView = itemsRepeater.ItemsSourceView(); + + // For every Breadcrumb item we set the index (starting from 1 for the root/highest-level item) + // accessibilityIndex is the index to be assigned to each item + // itemToIndex is the real index and it may differ from accessibilityIndex as we must only index the visible items + for (uint32_t accessibilityIndex = 1, itemToIndex = firstItemToIndex; accessibilityIndex <= visibleItemsCount; ++accessibilityIndex, ++itemToIndex) + { + if (const auto& element = itemsRepeater.TryGetElement(itemToIndex)) + { + element.SetValue(winrt::AutomationProperties::PositionInSetProperty(), box_value(accessibilityIndex)); + element.SetValue(winrt::AutomationProperties::SizeOfSetProperty(), box_value(visibleItemsCount)); + } + } + } +} + // When focus comes from outside the Breadcrumb control we will put focus on the selected item. void Breadcrumb::OnGettingFocus(const winrt::IInspectable&, const winrt::GettingFocusEventArgs& args) { @@ -325,16 +383,19 @@ void Breadcrumb::OnGettingFocus(const winrt::IInspectable&, const winrt::Getting auto const& oldFocusedElement = args.OldFocusedElement(); if (!oldFocusedElement || itemsRepeater != winrt::VisualTreeHelper::GetParent(oldFocusedElement)) { - // If the last focused element is now hidden, then focus the ellipsis button - if (auto const& repeaterLayout = itemsRepeater.Layout()) + // Reset the focused index + if (m_itemsRepeaterLayout) { - auto const& breadcrumbLayout = repeaterLayout.try_as(); - - if (breadcrumbLayout->EllipsisIsRendered() && - m_focusedIndex < (int)breadcrumbLayout->FirstRenderedItemIndexAfterEllipsis()) + if (m_itemsRepeaterLayout.get()->EllipsisIsRendered()) + { + m_focusedIndex = 0; + } + else { - FocusElementAt(0); + m_focusedIndex = 1; } + + FocusElementAt(m_focusedIndex); } if (auto const& selectedItem = itemsRepeater.TryGetElement(m_focusedIndex)) @@ -346,7 +407,7 @@ void Breadcrumb::OnGettingFocus(const winrt::IInspectable&, const winrt::Getting args.Handled(true); } } - } + } } // Focus was already in the repeater: in RS3+ Selection follows focus unless control is held down. @@ -415,10 +476,14 @@ bool Breadcrumb::MoveFocusPrevious() if (const auto& itemsRepeater = m_itemsRepeater.get()) { const auto& repeaterLayout = itemsRepeater.Layout(); - if (const auto& breadcrumbLayout = repeaterLayout.try_as()) + if (m_itemsRepeaterLayout) { - if (breadcrumbLayout->EllipsisIsRendered() && - m_focusedIndex == static_cast(breadcrumbLayout->FirstRenderedItemIndexAfterEllipsis())) + if (m_focusedIndex == 1) + { + movementPrevious = 0; + } + else if (m_itemsRepeaterLayout->EllipsisIsRendered() && + m_focusedIndex == static_cast(m_itemsRepeaterLayout->FirstRenderedItemIndexAfterEllipsis())) { movementPrevious = -m_focusedIndex; } @@ -438,9 +503,9 @@ bool Breadcrumb::MoveFocusNext() if (const auto& itemsRepeater = m_itemsRepeater.get()) { const auto& repeaterLayout = itemsRepeater.Layout(); - if (const auto& breadcrumbLayout = repeaterLayout.try_as()) + if (m_itemsRepeaterLayout) { - movementNext = breadcrumbLayout->FirstRenderedItemIndexAfterEllipsis(); + movementNext = m_itemsRepeaterLayout->FirstRenderedItemIndexAfterEllipsis(); } } } diff --git a/dev/Breadcrumb/Breadcrumb.h b/dev/Breadcrumb/Breadcrumb.h index 59d8dec947..7e64685313 100644 --- a/dev/Breadcrumb/Breadcrumb.h +++ b/dev/Breadcrumb/Breadcrumb.h @@ -11,9 +11,11 @@ #include "SplitButton.h" #include "BreadcrumbElementFactory.h" +#include "BreadcrumbDropDownElementFactory.h" #include "Vector.h" #include "BreadcrumbIterable.h" +#include "BreadcrumbLayout.h" class Breadcrumb : public ReferenceTracker, @@ -29,11 +31,12 @@ class Breadcrumb : void OnPropertyChanged(const winrt::DependencyPropertyChangedEventArgs& args); void RevokeListeners(); - void RaiseItemClickedEvent(const winrt::IInspectable& content); + void RaiseItemClickedEvent(const winrt::IInspectable& content, const uint32_t index); winrt::IVector HiddenElements() const; + void ReIndexVisibleElementsForAccessibility() const; private: - void OnBreadcrumbItemRepeaterLoaded(const winrt::IInspectable&, const winrt::RoutedEventArgs&); + void OnBreadcrumbItemsRepeaterLoaded(const winrt::IInspectable&, const winrt::RoutedEventArgs&); void OnElementPreparedEvent(const winrt::ItemsRepeater&, const winrt::ItemsRepeaterElementPreparedEventArgs&); void OnElementIndexChangedEvent(const winrt::ItemsRepeater&, const winrt::ItemsRepeaterElementIndexChangedEventArgs&); void OnElementClearingEvent(const winrt::ItemsRepeater&, const winrt::ItemsRepeaterElementClearingEventArgs&); @@ -54,7 +57,7 @@ class Breadcrumb : void UpdateItemsRepeaterItemsSource(); void UpdateItemTemplate(); - void UpdateEllipsisBreadcrumbItemDropdownItemTemplate(); + void UpdateEllipsisBreadcrumbItemDropDownItemTemplate(); void UpdateBreadcrumbItemsFlowDirection(); void ResetLastBreadcrumbItem(); @@ -64,10 +67,11 @@ class Breadcrumb : winrt::IVector GetHiddenElementsList(uint32_t firstShownElement) const; winrt::Control::Loaded_revoker m_itemsRepeaterLoadedRevoker{}; - winrt::ItemsRepeater::ElementPrepared_revoker m_itemRepeaterElementPreparedRevoker{}; - winrt::ItemsRepeater::ElementIndexChanged_revoker m_itemRepeaterElementIndexChangedRevoker{}; - winrt::ItemsRepeater::ElementClearing_revoker m_itemRepeaterElementClearingRevoker{}; + winrt::ItemsRepeater::ElementPrepared_revoker m_itemsRepeaterElementPreparedRevoker{}; + winrt::ItemsRepeater::ElementIndexChanged_revoker m_itemsRepeaterElementIndexChangedRevoker{}; + winrt::ItemsRepeater::ElementClearing_revoker m_itemsRepeaterElementClearingRevoker{}; winrt::ItemsSourceView::CollectionChanged_revoker m_itemsSourceChanged{}; + RoutedEventHandler_revoker m_breadcrumbKeyDownHandlerRevoker{}; tracker_ref m_notifyCollectionChanged{ this }; winrt::event_token m_itemsSourceAsCollectionChanged{}; @@ -85,6 +89,7 @@ class Breadcrumb : tracker_ref m_itemsRepeater { this }; com_ptr m_itemsRepeaterElementFactory{ nullptr }; + com_ptr m_itemsRepeaterLayout{ nullptr }; // Pointers to first and last items to update visual states tracker_ref m_ellipsisBreadcrumbItem { this }; @@ -92,4 +97,10 @@ class Breadcrumb : // Index of the last focused item when breadcrumb lost focus int m_focusedIndex{ 1 }; + + // Template Parts + static constexpr std::wstring_view s_breadcrumbItemsRepeaterPartName{ L"PART_BreadcrumbItemsRepeater"sv }; + + // Automation Names + static constexpr std::wstring_view s_breadcrumbItemAutomationName{ L"BreadcrumbItem"sv }; }; diff --git a/dev/Breadcrumb/Breadcrumb.idl b/dev/Breadcrumb/Breadcrumb.idl index f9cd991b64..847a58d905 100644 --- a/dev/Breadcrumb/Breadcrumb.idl +++ b/dev/Breadcrumb/Breadcrumb.idl @@ -1,28 +1,26 @@ namespace MU_XC_NAMESPACE { - -runtimeclass StackLayout; - [MUX_PREVIEW] -[webhosthidden] [default_interface] +[webhosthidden] runtimeclass BreadcrumbItemClickedEventArgs { + Int32 Index { get; }; Object Item { get; }; } [MUX_PREVIEW] [webhosthidden] -unsealed runtimeclass BreadcrumbItem : Windows.UI.Xaml.Controls.ContentControl +unsealed runtimeclass BreadcrumbDropDownItem : Windows.UI.Xaml.Controls.ContentControl { - BreadcrumbItem(); + BreadcrumbDropDownItem(); } [MUX_PREVIEW] [webhosthidden] -unsealed runtimeclass BreadcrumbLayout : NonVirtualizingLayout +unsealed runtimeclass BreadcrumbItem : Windows.UI.Xaml.Controls.ContentControl { - BreadcrumbLayout(); + BreadcrumbItem(); } [MUX_PREVIEW] @@ -33,13 +31,13 @@ unsealed runtimeclass Breadcrumb : Windows.UI.Xaml.Controls.Control { Breadcrumb(); - Object DropdownItemTemplate{ get; set; }; + Object DropDownItemTemplate{ get; set; }; Object ItemsSource{ get; set; }; Object ItemTemplate{ get; set; }; event Windows.Foundation.TypedEventHandler ItemClicked; - static Windows.UI.Xaml.DependencyProperty DropdownItemTemplateProperty{ get; }; + static Windows.UI.Xaml.DependencyProperty DropDownItemTemplateProperty{ get; }; static Windows.UI.Xaml.DependencyProperty ItemsSourceProperty{ get; }; static Windows.UI.Xaml.DependencyProperty ItemTemplateProperty{ get; }; } diff --git a/dev/Breadcrumb/Breadcrumb.vcxitems b/dev/Breadcrumb/Breadcrumb.vcxitems index 88c33d55e5..188f7fa976 100644 --- a/dev/Breadcrumb/Breadcrumb.vcxitems +++ b/dev/Breadcrumb/Breadcrumb.vcxitems @@ -16,8 +16,12 @@ + + + + @@ -26,12 +30,16 @@ + + + + - + @@ -45,5 +53,9 @@ + + + + \ No newline at end of file diff --git a/dev/Breadcrumb/Breadcrumb.xaml b/dev/Breadcrumb/Breadcrumb.xaml index 16e6670c87..bdc7bcc1d1 100644 --- a/dev/Breadcrumb/Breadcrumb.xaml +++ b/dev/Breadcrumb/Breadcrumb.xaml @@ -4,117 +4,315 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:Microsoft.UI.Xaml.Controls"> - - - + + + + - + + + + + + + + - + + - + - - - - - - - - + - - - - + - - + + + - + + FontFamily="{TemplateBinding FontFamily}" + FontSize="{TemplateBinding FontSize}" + FontWeight="{TemplateBinding FontWeight}" + HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" + VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" + LineHeight="20" + AutomationProperties.AccessibilityView="Raw"/> + FontSize="12" + AutomationProperties.AccessibilityView="Raw" + Padding="2,2,2,2" + Grid.Column="2"/> - - - - + + - - - - - - + @@ -231,71 +95,194 @@ - - + + - - + + - - - - - - - + + + @@ -306,13 +293,11 @@ - + - - - - - - + + @@ -526,11 +152,11 @@ - + - + - + - + - + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + - + - - + + - - + + - + - - + + - + - + @@ -646,11 +386,11 @@ - + - + @@ -661,11 +401,11 @@ - + - + @@ -679,11 +419,11 @@ - + - + - + - + - + - + - + - + @@ -748,11 +488,11 @@ - + - + @@ -763,11 +503,11 @@ - + - + @@ -784,7 +524,7 @@ - + diff --git a/dev/AnimatedIcon/TestUI/AnimatedIconPage.xaml.cs b/dev/AnimatedIcon/TestUI/AnimatedIconPage.xaml.cs index 9ae5fa2493..d9b373df6c 100644 --- a/dev/AnimatedIcon/TestUI/AnimatedIconPage.xaml.cs +++ b/dev/AnimatedIcon/TestUI/AnimatedIconPage.xaml.cs @@ -42,6 +42,12 @@ private void AnimatedIconPage_Loaded(object sender, RoutedEventArgs e) AnimatedIconTestHooks.SetAnimationQueueBehavior(this.DropDownIcon_Cut.GetAnimatedIcon(), AnimatedIconAnimationQueueBehavior.Cut); AnimatedIconTestHooks.SetAnimationQueueBehavior(this.DropDownIcon_Queue.GetAnimatedIcon(), AnimatedIconAnimationQueueBehavior.QueueOne); AnimatedIconTestHooks.SetAnimationQueueBehavior(this.DropDownIcon_SpeedUpQueue.GetAnimatedIcon(), AnimatedIconAnimationQueueBehavior.SpeedUpQueueOne); + AnimatedIconTestHooks.SetAnimationQueueBehavior(this.DropDownIconNavView_Cut.GetAnimatedIcon(), AnimatedIconAnimationQueueBehavior.Cut); + AnimatedIconTestHooks.SetAnimationQueueBehavior(this.DropDownIconNavView_Queue.GetAnimatedIcon(), AnimatedIconAnimationQueueBehavior.QueueOne); + AnimatedIconTestHooks.SetAnimationQueueBehavior(this.DropDownIconNavView_SpeedUpQueue.GetAnimatedIcon(), AnimatedIconAnimationQueueBehavior.SpeedUpQueueOne); + AnimatedIconTestHooks.SetAnimationQueueBehavior(this.SideChevron_Cut.GetAnimatedIcon(), AnimatedIconAnimationQueueBehavior.Cut); + AnimatedIconTestHooks.SetAnimationQueueBehavior(this.SideChevron_Queue.GetAnimatedIcon(), AnimatedIconAnimationQueueBehavior.QueueOne); + AnimatedIconTestHooks.SetAnimationQueueBehavior(this.SideChevron_SpeedUpQueue.GetAnimatedIcon(), AnimatedIconAnimationQueueBehavior.SpeedUpQueueOne); AnimatedIconTestHooks.SetAnimationQueueBehavior(this.HamburgerIcon_Cut.GetAnimatedIcon(), AnimatedIconAnimationQueueBehavior.Cut); AnimatedIconTestHooks.SetAnimationQueueBehavior(this.HamburgerIcon_Queue.GetAnimatedIcon(), AnimatedIconAnimationQueueBehavior.QueueOne); AnimatedIconTestHooks.SetAnimationQueueBehavior(this.HamburgerIcon_SpeedUpQueue.GetAnimatedIcon(), AnimatedIconAnimationQueueBehavior.SpeedUpQueueOne); @@ -70,6 +76,30 @@ private void Slider_ValueChanged(object sender, RangeBaseValueChangedEventArgs e { AnimatedIconTestHooks.SetDurationMultiplier(this.DropDownIcon_SpeedUpQueue.GetAnimatedIcon(), (float)e.NewValue); } + if (this.DropDownIconNavView_Cut != null) + { + AnimatedIconTestHooks.SetDurationMultiplier(this.DropDownIconNavView_Cut.GetAnimatedIcon(), (float)e.NewValue); + } + if (this.DropDownIconNavView_Queue != null) + { + AnimatedIconTestHooks.SetDurationMultiplier(this.DropDownIconNavView_Queue.GetAnimatedIcon(), (float)e.NewValue); + } + if (this.DropDownIconNavView_SpeedUpQueue != null) + { + AnimatedIconTestHooks.SetDurationMultiplier(this.DropDownIconNavView_SpeedUpQueue.GetAnimatedIcon(), (float)e.NewValue); + } + if (this.SideChevron_Cut != null) + { + AnimatedIconTestHooks.SetDurationMultiplier(this.SideChevron_Cut.GetAnimatedIcon(), (float)e.NewValue); + } + if (this.SideChevron_Queue != null) + { + AnimatedIconTestHooks.SetDurationMultiplier(this.SideChevron_Queue.GetAnimatedIcon(), (float)e.NewValue); + } + if (this.SideChevron_SpeedUpQueue != null) + { + AnimatedIconTestHooks.SetDurationMultiplier(this.SideChevron_SpeedUpQueue.GetAnimatedIcon(), (float)e.NewValue); + } if (this.HamburgerIcon_Cut != null) { AnimatedIconTestHooks.SetDurationMultiplier(this.HamburgerIcon_Cut.GetAnimatedIcon(), (float)e.NewValue); @@ -150,6 +180,30 @@ private void SpeedUpSlider_ValueChanged(object sender, RangeBaseValueChangedEven { AnimatedIconTestHooks.SetSpeedUpMultiplier(this.DropDownIcon_SpeedUpQueue.GetAnimatedIcon(), (float)e.NewValue); } + if (this.DropDownIconNavView_Cut != null) + { + AnimatedIconTestHooks.SetSpeedUpMultiplier(this.DropDownIconNavView_Cut.GetAnimatedIcon(), (float)e.NewValue); + } + if (this.DropDownIconNavView_Queue != null) + { + AnimatedIconTestHooks.SetSpeedUpMultiplier(this.DropDownIconNavView_Queue.GetAnimatedIcon(), (float)e.NewValue); + } + if (this.DropDownIconNavView_SpeedUpQueue != null) + { + AnimatedIconTestHooks.SetSpeedUpMultiplier(this.DropDownIconNavView_SpeedUpQueue.GetAnimatedIcon(), (float)e.NewValue); + } + if (this.SideChevron_Cut != null) + { + AnimatedIconTestHooks.SetSpeedUpMultiplier(this.SideChevron_Cut.GetAnimatedIcon(), (float)e.NewValue); + } + if (this.SideChevron_Queue != null) + { + AnimatedIconTestHooks.SetSpeedUpMultiplier(this.SideChevron_Queue.GetAnimatedIcon(), (float)e.NewValue); + } + if (this.SideChevron_SpeedUpQueue != null) + { + AnimatedIconTestHooks.SetSpeedUpMultiplier(this.SideChevron_SpeedUpQueue.GetAnimatedIcon(), (float)e.NewValue); + } if (this.HamburgerIcon_Cut != null) { AnimatedIconTestHooks.SetSpeedUpMultiplier(this.HamburgerIcon_Cut.GetAnimatedIcon(), (float)e.NewValue); diff --git a/dev/AnimatedIcon/TestUI/AnimatedIcon_TestUI.projitems b/dev/AnimatedIcon/TestUI/AnimatedIcon_TestUI.projitems index 12b09e1984..afa3fd2547 100644 --- a/dev/AnimatedIcon/TestUI/AnimatedIcon_TestUI.projitems +++ b/dev/AnimatedIcon/TestUI/AnimatedIcon_TestUI.projitems @@ -22,5 +22,6 @@ + \ No newline at end of file diff --git a/dev/AnimatedIcon/TestUI/MockIRichAnimatedIconSource.cs b/dev/AnimatedIcon/TestUI/MockIRichAnimatedIconSource.cs index 8d42e8b945..5008261cc7 100644 --- a/dev/AnimatedIcon/TestUI/MockIRichAnimatedIconSource.cs +++ b/dev/AnimatedIcon/TestUI/MockIRichAnimatedIconSource.cs @@ -4,16 +4,16 @@ using Windows.UI; using Windows.UI.Composition; using Windows.UI.Xaml; -using Controls_09_Hamburger = Microsoft.UI.Xaml.Controls.AnimatedVisuals.Controls_09_Hamburger; +using Controls_02_Hamburger = Microsoft.UI.Xaml.Controls.AnimatedVisuals.AnimatedGlobalNavigationButtonVisualSource; namespace MUXControlsTestApp { - class MockIRichAnimatedIconSource : IRichAnimatedVisualSource + class MockIAnimatedIconSource2 : IAnimatedVisualSource2 { Dictionary markers = new Dictionary(); - IRichAnimatedVisualSource visual = new Controls_09_Hamburger(); - public MockIRichAnimatedIconSource() + IAnimatedVisualSource2 visual = new Controls_02_Hamburger(); + public MockIAnimatedIconSource2() { markers.Add("aTob_Start", 0.12345); markers.Add("aTob_End", 0.12345); @@ -22,9 +22,9 @@ public MockIRichAnimatedIconSource() markers.Add("dToe", 0.12345); markers.Add("f", 0.12345); } - public IAnimatedVisual TryCreateAnimatedIconVisual(Compositor compositor) + public IAnimatedVisual TryCreateAnimatedVisual(Compositor compositor, out object diagnostics) { - return visual.TryCreateAnimatedIconVisual(Window.Current.Compositor); + return visual.TryCreateAnimatedVisual(Window.Current.Compositor, out diagnostics); } public void SetColorProperty(string propertyName, Color value) diff --git a/dev/AnimatedIcon/TestUI/ToggleAnimatedIconHost.cs b/dev/AnimatedIcon/TestUI/ToggleAnimatedIconHost.cs new file mode 100644 index 0000000000..c9b0829ddc --- /dev/null +++ b/dev/AnimatedIcon/TestUI/ToggleAnimatedIconHost.cs @@ -0,0 +1,104 @@ +using Microsoft.UI.Private.Controls; +using Microsoft.UI.Xaml.Controls; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices.WindowsRuntime; +using Windows.UI.Xaml; +using Windows.UI.Xaml.Controls; +using Windows.UI.Xaml.Data; +using Windows.UI.Xaml.Documents; +using Windows.UI.Xaml.Input; +using Windows.UI.Xaml.Media; +using IconSource = Microsoft.UI.Xaml.Controls.IconSource; + +// The Templated Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234235 + +namespace MUXControlsTestApp +{ + public sealed class ToggleAnimatedIconHost : CheckBox + { + Border m_iconPresenter; + TextBlock m_transitionTextBlock; + + public static readonly DependencyProperty IconSourceProperty = DependencyProperty.Register( + "IconSource", + typeof(IconSource), + typeof(AnimatedIconHost), + new PropertyMetadata(null, new PropertyChangedCallback(OnIconSourceChanged)) + ); + + public IconSource IconSource + { + get { return (IconSource)GetValue(IconSourceProperty); } + set { SetValue(IconSourceProperty, value); } + } + + private static void OnIconSourceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + ((ToggleAnimatedIconHost)d).IconSourceChanged(); + } + + public String Title + { + get { return (String)GetValue(TitleProperty); } + set { SetValue(TitleProperty, value); } + } + + public static readonly DependencyProperty TitleProperty = DependencyProperty.Register( + "Title", + typeof(String), + typeof(ToggleAnimatedIconHost), + null + ); + + public ToggleAnimatedIconHost() + { + this.DefaultStyleKey = typeof(AnimatedIconHost); + AnimatedIconTestHooks.LastAnimationSegmentChanged += AnimatedIconTestHooks_LastAnimationSegmentChanged; + } + + private void AnimatedIconTestHooks_LastAnimationSegmentChanged(AnimatedIcon sender, object args) + { + if (sender == GetAnimatedIcon()) + { + m_transitionTextBlock.Text = AnimatedIconTestHooks.GetLastAnimationSegment(sender); + } + } + + public AnimatedIcon GetAnimatedIcon() + { + return m_iconPresenter.Child as AnimatedIcon; + } + + override protected void OnApplyTemplate() + { + m_iconPresenter = (Border)GetTemplateChild("Icon"); + m_transitionTextBlock = (TextBlock)GetTemplateChild("TransitionTextBlock"); + + IconSourceChanged(); + } + + private void IconSourceChanged() + { + if (m_iconPresenter != null) + { + AnimatedIcon animatedIcon = new AnimatedIcon(); + AnimatedIconSource source = (AnimatedIconSource)IconSource; + if (source.Source != null) + { + animatedIcon.Source = source.Source; + } + if (source.FallbackIconSource != null) + { + animatedIcon.FallbackIconSource = source.FallbackIconSource; + } + if (source.Foreground != null) + { + animatedIcon.Foreground = source.Foreground; + } + m_iconPresenter.Child = animatedIcon; + } + } + } +} diff --git a/dev/AutoSuggestBox/AutoSuggestBox_themeresources.xaml b/dev/AutoSuggestBox/AutoSuggestBox_themeresources.xaml index fb8710b53f..23ba237de0 100644 --- a/dev/AutoSuggestBox/AutoSuggestBox_themeresources.xaml +++ b/dev/AutoSuggestBox/AutoSuggestBox_themeresources.xaml @@ -1,6 +1,7 @@  0,0,0,8 - 0,4,0,4 + 0,3 + 3,2 4 - - - diff --git a/dev/Expander/Expander_themeresources.xaml b/dev/Expander/Expander_themeresources.xaml index 8639226110..76d228a550 100644 --- a/dev/Expander/Expander_themeresources.xaml +++ b/dev/Expander/Expander_themeresources.xaml @@ -3,7 +3,9 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:Microsoft.UI.Xaml.Controls" - xmlns:contract7Present="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract,7)"> + xmlns:contract7Present="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract,7)" + xmlns:contract7NotPresent="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractNotPresent(Windows.Foundation.UniversalApiContract,7)" + xmlns:animatedvisuals="using:Microsoft.UI.Xaml.Controls.AnimatedVisuals"> @@ -96,7 +98,6 @@ + + - - diff --git a/dev/Generated/AnimatedAcceptVisualSource.properties.cpp b/dev/Generated/AnimatedAcceptVisualSource.properties.cpp new file mode 100644 index 0000000000..cb061fefa6 --- /dev/null +++ b/dev/Generated/AnimatedAcceptVisualSource.properties.cpp @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See LICENSE in the project root for license information. + +// DO NOT EDIT! This file was generated by CustomTasks.DependencyPropertyCodeGen +#include "pch.h" +#include "common.h" +#include "AnimatedAcceptVisualSource.h" + +namespace winrt::Microsoft::UI::Xaml::Controls::AnimatedVisuals +{ + CppWinRTActivatableClassWithBasicFactory(AnimatedAcceptVisualSource) +} + +#include "AnimatedAcceptVisualSource.g.cpp" + + diff --git a/dev/Generated/AnimatedBackVisualSource.properties.cpp b/dev/Generated/AnimatedBackVisualSource.properties.cpp new file mode 100644 index 0000000000..7e08e74571 --- /dev/null +++ b/dev/Generated/AnimatedBackVisualSource.properties.cpp @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See LICENSE in the project root for license information. + +// DO NOT EDIT! This file was generated by CustomTasks.DependencyPropertyCodeGen +#include "pch.h" +#include "common.h" +#include "AnimatedBackVisualSource.h" + +namespace winrt::Microsoft::UI::Xaml::Controls::AnimatedVisuals +{ + CppWinRTActivatableClassWithBasicFactory(AnimatedBackVisualSource) +} + +#include "AnimatedBackVisualSource.g.cpp" + + diff --git a/dev/Generated/AnimatedChevronDownSmallVisualSource.properties.cpp b/dev/Generated/AnimatedChevronDownSmallVisualSource.properties.cpp new file mode 100644 index 0000000000..43face0071 --- /dev/null +++ b/dev/Generated/AnimatedChevronDownSmallVisualSource.properties.cpp @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See LICENSE in the project root for license information. + +// DO NOT EDIT! This file was generated by CustomTasks.DependencyPropertyCodeGen +#include "pch.h" +#include "common.h" +#include "AnimatedChevronDownSmallVisualSource.h" + +namespace winrt::Microsoft::UI::Xaml::Controls::AnimatedVisuals +{ + CppWinRTActivatableClassWithBasicFactory(AnimatedChevronDownSmallVisualSource) +} + +#include "AnimatedChevronDownSmallVisualSource.g.cpp" + + diff --git a/dev/Generated/AnimatedChevronRightDownSmallVisualSource.properties.cpp b/dev/Generated/AnimatedChevronRightDownSmallVisualSource.properties.cpp new file mode 100644 index 0000000000..0e8ef8b291 --- /dev/null +++ b/dev/Generated/AnimatedChevronRightDownSmallVisualSource.properties.cpp @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See LICENSE in the project root for license information. + +// DO NOT EDIT! This file was generated by CustomTasks.DependencyPropertyCodeGen +#include "pch.h" +#include "common.h" +#include "AnimatedChevronRightDownSmallVisualSource.h" + +namespace winrt::Microsoft::UI::Xaml::Controls::AnimatedVisuals +{ + CppWinRTActivatableClassWithBasicFactory(AnimatedChevronRightDownSmallVisualSource) +} + +#include "AnimatedChevronRightDownSmallVisualSource.g.cpp" + + diff --git a/dev/Generated/AnimatedChevronUpDownSmallVisualSource.properties.cpp b/dev/Generated/AnimatedChevronUpDownSmallVisualSource.properties.cpp new file mode 100644 index 0000000000..5b294ef484 --- /dev/null +++ b/dev/Generated/AnimatedChevronUpDownSmallVisualSource.properties.cpp @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See LICENSE in the project root for license information. + +// DO NOT EDIT! This file was generated by CustomTasks.DependencyPropertyCodeGen +#include "pch.h" +#include "common.h" +#include "AnimatedChevronUpDownSmallVisualSource.h" + +namespace winrt::Microsoft::UI::Xaml::Controls::AnimatedVisuals +{ + CppWinRTActivatableClassWithBasicFactory(AnimatedChevronUpDownSmallVisualSource) +} + +#include "AnimatedChevronUpDownSmallVisualSource.g.cpp" + + diff --git a/dev/Generated/AnimatedFindVisualSource.properties.cpp b/dev/Generated/AnimatedFindVisualSource.properties.cpp new file mode 100644 index 0000000000..054b2b9e13 --- /dev/null +++ b/dev/Generated/AnimatedFindVisualSource.properties.cpp @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See LICENSE in the project root for license information. + +// DO NOT EDIT! This file was generated by CustomTasks.DependencyPropertyCodeGen +#include "pch.h" +#include "common.h" +#include "AnimatedFindVisualSource.h" + +namespace winrt::Microsoft::UI::Xaml::Controls::AnimatedVisuals +{ + CppWinRTActivatableClassWithBasicFactory(AnimatedFindVisualSource) +} + +#include "AnimatedFindVisualSource.g.cpp" + + diff --git a/dev/Generated/AnimatedGlobalNavigationButtonVisualSource.properties.cpp b/dev/Generated/AnimatedGlobalNavigationButtonVisualSource.properties.cpp new file mode 100644 index 0000000000..73253cce7c --- /dev/null +++ b/dev/Generated/AnimatedGlobalNavigationButtonVisualSource.properties.cpp @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See LICENSE in the project root for license information. + +// DO NOT EDIT! This file was generated by CustomTasks.DependencyPropertyCodeGen +#include "pch.h" +#include "common.h" +#include "AnimatedGlobalNavigationButtonVisualSource.h" + +namespace winrt::Microsoft::UI::Xaml::Controls::AnimatedVisuals +{ + CppWinRTActivatableClassWithBasicFactory(AnimatedGlobalNavigationButtonVisualSource) +} + +#include "AnimatedGlobalNavigationButtonVisualSource.g.cpp" + + diff --git a/dev/Generated/AnimatedIcon.properties.cpp b/dev/Generated/AnimatedIcon.properties.cpp index e91f8feb22..b93ea1762b 100644 --- a/dev/Generated/AnimatedIcon.properties.cpp +++ b/dev/Generated/AnimatedIcon.properties.cpp @@ -40,10 +40,10 @@ void AnimatedIconProperties::EnsureProperties() s_SourceProperty = InitializeDependencyProperty( L"Source", - winrt::name_of(), + winrt::name_of(), winrt::name_of(), false /* isAttached */, - ValueHelper::BoxedDefaultValue(), + ValueHelper::BoxedDefaultValue(), winrt::PropertyChangedCallback(&OnSourcePropertyChanged)); } if (!s_StateProperty) @@ -54,7 +54,7 @@ void AnimatedIconProperties::EnsureProperties() winrt::name_of(), winrt::name_of(), true /* isAttached */, - ValueHelper::BoxValueIfNecessary(L"Normal"), + ValueHelper::BoxedDefaultValue(), &AnimatedIcon::OnAnimatedIconStatePropertyChanged); } } @@ -95,17 +95,17 @@ winrt::IconSource AnimatedIconProperties::FallbackIconSource() return ValueHelper::CastOrUnbox(static_cast(this)->GetValue(s_FallbackIconSourceProperty)); } -void AnimatedIconProperties::Source(winrt::IRichAnimatedVisualSource const& value) +void AnimatedIconProperties::Source(winrt::IAnimatedVisualSource2 const& value) { [[gsl::suppress(con)]] { - static_cast(this)->SetValue(s_SourceProperty, ValueHelper::BoxValueIfNecessary(value)); + static_cast(this)->SetValue(s_SourceProperty, ValueHelper::BoxValueIfNecessary(value)); } } -winrt::IRichAnimatedVisualSource AnimatedIconProperties::Source() +winrt::IAnimatedVisualSource2 AnimatedIconProperties::Source() { - return ValueHelper::CastOrUnbox(static_cast(this)->GetValue(s_SourceProperty)); + return ValueHelper::CastOrUnbox(static_cast(this)->GetValue(s_SourceProperty)); } diff --git a/dev/Generated/AnimatedIcon.properties.h b/dev/Generated/AnimatedIcon.properties.h index 37d7618635..e911183b34 100644 --- a/dev/Generated/AnimatedIcon.properties.h +++ b/dev/Generated/AnimatedIcon.properties.h @@ -12,8 +12,8 @@ class AnimatedIconProperties void FallbackIconSource(winrt::IconSource const& value); winrt::IconSource FallbackIconSource(); - void Source(winrt::IRichAnimatedVisualSource const& value); - winrt::IRichAnimatedVisualSource Source(); + void Source(winrt::IAnimatedVisualSource2 const& value); + winrt::IAnimatedVisualSource2 Source(); static void SetState(winrt::DependencyObject const& target, winrt::hstring const& value); static winrt::hstring GetState(winrt::DependencyObject const& target); diff --git a/dev/Generated/AnimatedIconSource.properties.cpp b/dev/Generated/AnimatedIconSource.properties.cpp index 038b4d5b66..766810eb83 100644 --- a/dev/Generated/AnimatedIconSource.properties.cpp +++ b/dev/Generated/AnimatedIconSource.properties.cpp @@ -40,10 +40,10 @@ void AnimatedIconSourceProperties::EnsureProperties() s_SourceProperty = InitializeDependencyProperty( L"Source", - winrt::name_of(), + winrt::name_of(), winrt::name_of(), false /* isAttached */, - ValueHelper::BoxedDefaultValue(), + ValueHelper::BoxedDefaultValue(), nullptr); } } @@ -68,15 +68,15 @@ winrt::IconSource AnimatedIconSourceProperties::FallbackIconSource() return ValueHelper::CastOrUnbox(static_cast(this)->GetValue(s_FallbackIconSourceProperty)); } -void AnimatedIconSourceProperties::Source(winrt::IRichAnimatedVisualSource const& value) +void AnimatedIconSourceProperties::Source(winrt::IAnimatedVisualSource2 const& value) { [[gsl::suppress(con)]] { - static_cast(this)->SetValue(s_SourceProperty, ValueHelper::BoxValueIfNecessary(value)); + static_cast(this)->SetValue(s_SourceProperty, ValueHelper::BoxValueIfNecessary(value)); } } -winrt::IRichAnimatedVisualSource AnimatedIconSourceProperties::Source() +winrt::IAnimatedVisualSource2 AnimatedIconSourceProperties::Source() { - return ValueHelper::CastOrUnbox(static_cast(this)->GetValue(s_SourceProperty)); + return ValueHelper::CastOrUnbox(static_cast(this)->GetValue(s_SourceProperty)); } diff --git a/dev/Generated/AnimatedIconSource.properties.h b/dev/Generated/AnimatedIconSource.properties.h index a6ac3015c5..d0d7f3ce6b 100644 --- a/dev/Generated/AnimatedIconSource.properties.h +++ b/dev/Generated/AnimatedIconSource.properties.h @@ -12,8 +12,8 @@ class AnimatedIconSourceProperties void FallbackIconSource(winrt::IconSource const& value); winrt::IconSource FallbackIconSource(); - void Source(winrt::IRichAnimatedVisualSource const& value); - winrt::IRichAnimatedVisualSource Source(); + void Source(winrt::IAnimatedVisualSource2 const& value); + winrt::IAnimatedVisualSource2 Source(); static winrt::DependencyProperty FallbackIconSourceProperty() { return s_FallbackIconSourceProperty; } static winrt::DependencyProperty SourceProperty() { return s_SourceProperty; } diff --git a/dev/Generated/AnimatedSettingsVisualSource.properties.cpp b/dev/Generated/AnimatedSettingsVisualSource.properties.cpp new file mode 100644 index 0000000000..9176c3869a --- /dev/null +++ b/dev/Generated/AnimatedSettingsVisualSource.properties.cpp @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See LICENSE in the project root for license information. + +// DO NOT EDIT! This file was generated by CustomTasks.DependencyPropertyCodeGen +#include "pch.h" +#include "common.h" +#include "AnimatedSettingsVisualSource.h" + +namespace winrt::Microsoft::UI::Xaml::Controls::AnimatedVisuals +{ + CppWinRTActivatableClassWithBasicFactory(AnimatedSettingsVisualSource) +} + +#include "AnimatedSettingsVisualSource.g.cpp" + + diff --git a/dev/Generated/Controls_02_Hamburger.properties.cpp b/dev/Generated/Controls_02_Hamburger.properties.cpp new file mode 100644 index 0000000000..49d6e6e080 --- /dev/null +++ b/dev/Generated/Controls_02_Hamburger.properties.cpp @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See LICENSE in the project root for license information. + +// DO NOT EDIT! This file was generated by CustomTasks.DependencyPropertyCodeGen +#include "pch.h" +#include "common.h" +#include "Controls_02_Hamburger.h" + +namespace winrt::Microsoft::UI::Xaml::Controls::AnimatedVisuals +{ + CppWinRTActivatableClassWithBasicFactory(Controls_02_Hamburger) +} + +#include "Controls_02_Hamburger.g.cpp" + + diff --git a/dev/Generated/Controls_03_Back.properties.cpp b/dev/Generated/Controls_03_Back.properties.cpp new file mode 100644 index 0000000000..b630310825 --- /dev/null +++ b/dev/Generated/Controls_03_Back.properties.cpp @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See LICENSE in the project root for license information. + +// DO NOT EDIT! This file was generated by CustomTasks.DependencyPropertyCodeGen +#include "pch.h" +#include "common.h" +#include "Controls_03_Back.h" + +namespace winrt::Microsoft::UI::Xaml::Controls::AnimatedVisuals +{ + CppWinRTActivatableClassWithBasicFactory(Controls_03_Back) +} + +#include "Controls_03_Back.g.cpp" + + diff --git a/dev/Generated/Controls_04_Settings.properties.cpp b/dev/Generated/Controls_04_Settings.properties.cpp new file mode 100644 index 0000000000..181215a6c4 --- /dev/null +++ b/dev/Generated/Controls_04_Settings.properties.cpp @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See LICENSE in the project root for license information. + +// DO NOT EDIT! This file was generated by CustomTasks.DependencyPropertyCodeGen +#include "pch.h" +#include "common.h" +#include "Controls_04_Settings.h" + +namespace winrt::Microsoft::UI::Xaml::Controls::AnimatedVisuals +{ + CppWinRTActivatableClassWithBasicFactory(Controls_04_Settings) +} + +#include "Controls_04_Settings.g.cpp" + + diff --git a/dev/Generated/Controls_05_Search.properties.cpp b/dev/Generated/Controls_05_Search.properties.cpp new file mode 100644 index 0000000000..e523480366 --- /dev/null +++ b/dev/Generated/Controls_05_Search.properties.cpp @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See LICENSE in the project root for license information. + +// DO NOT EDIT! This file was generated by CustomTasks.DependencyPropertyCodeGen +#include "pch.h" +#include "common.h" +#include "Controls_05_Search.h" + +namespace winrt::Microsoft::UI::Xaml::Controls::AnimatedVisuals +{ + CppWinRTActivatableClassWithBasicFactory(Controls_05_Search) +} + +#include "Controls_05_Search.g.cpp" + + diff --git a/dev/Generated/Controls_06_DownChevron_DropDown.properties.cpp b/dev/Generated/Controls_06_DownChevron_DropDown.properties.cpp new file mode 100644 index 0000000000..4accc095a3 --- /dev/null +++ b/dev/Generated/Controls_06_DownChevron_DropDown.properties.cpp @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See LICENSE in the project root for license information. + +// DO NOT EDIT! This file was generated by CustomTasks.DependencyPropertyCodeGen +#include "pch.h" +#include "common.h" +#include "Controls_06_DownChevron_DropDown.h" + +namespace winrt::Microsoft::UI::Xaml::Controls::AnimatedVisuals +{ + CppWinRTActivatableClassWithBasicFactory(Controls_06_DownChevron_DropDown) +} + +#include "Controls_06_DownChevron_DropDown.g.cpp" + + diff --git a/dev/Generated/Controls_07_DownChevron_NavView.properties.cpp b/dev/Generated/Controls_07_DownChevron_NavView.properties.cpp new file mode 100644 index 0000000000..e87df97856 --- /dev/null +++ b/dev/Generated/Controls_07_DownChevron_NavView.properties.cpp @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See LICENSE in the project root for license information. + +// DO NOT EDIT! This file was generated by CustomTasks.DependencyPropertyCodeGen +#include "pch.h" +#include "common.h" +#include "Controls_07_DownChevron_NavView.h" + +namespace winrt::Microsoft::UI::Xaml::Controls::AnimatedVisuals +{ + CppWinRTActivatableClassWithBasicFactory(Controls_07_DownChevron_NavView) +} + +#include "Controls_07_DownChevron_NavView.g.cpp" + + diff --git a/dev/Generated/Controls_08_SideChevron_TreeView.properties.cpp b/dev/Generated/Controls_08_SideChevron_TreeView.properties.cpp new file mode 100644 index 0000000000..58775161be --- /dev/null +++ b/dev/Generated/Controls_08_SideChevron_TreeView.properties.cpp @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See LICENSE in the project root for license information. + +// DO NOT EDIT! This file was generated by CustomTasks.DependencyPropertyCodeGen +#include "pch.h" +#include "common.h" +#include "Controls_08_SideChevron_TreeView.h" + +namespace winrt::Microsoft::UI::Xaml::Controls::AnimatedVisuals +{ + CppWinRTActivatableClassWithBasicFactory(Controls_08_SideChevron_TreeView) +} + +#include "Controls_08_SideChevron_TreeView.g.cpp" + + diff --git a/dev/IconSource/APITests/IconSourceApiTests.cs b/dev/IconSource/APITests/IconSourceApiTests.cs index 4732984e55..a9c1f92e92 100644 --- a/dev/IconSource/APITests/IconSourceApiTests.cs +++ b/dev/IconSource/APITests/IconSourceApiTests.cs @@ -198,12 +198,12 @@ public void ImageIconSourceTest() public void AnimatedIconSourceTest() { AnimatedIconSource iconSource = null; - IRichAnimatedVisualSource source = null; + IAnimatedVisualSource2 source = null; RunOnUIThread.Execute(() => { iconSource = new AnimatedIconSource(); - source = new Controls_02_UpDown_Dropdown(); + source = new AnimatedChevronDownSmallVisualSource(); // IconSource.Foreground should be null to allow foreground inheritance from // the parent to work. diff --git a/dev/IconSource/IconSource.idl b/dev/IconSource/IconSource.idl index 84aa463411..8809e7c5c4 100644 --- a/dev/IconSource/IconSource.idl +++ b/dev/IconSource/IconSource.idl @@ -92,7 +92,7 @@ unsealed runtimeclass AnimatedIconSource : IconSource { AnimatedIconSource(); - IRichAnimatedVisualSource Source{ get; set; }; + IAnimatedVisualSource2 Source{ get; set; }; IconSource FallbackIconSource{ get; set; }; static Windows.UI.Xaml.DependencyProperty SourceProperty { get; }; diff --git a/dev/NavigationView/NavigationBackButton.xaml b/dev/NavigationView/NavigationBackButton.xaml index aafd6b6766..a4aa1d423d 100644 --- a/dev/NavigationView/NavigationBackButton.xaml +++ b/dev/NavigationView/NavigationBackButton.xaml @@ -2,6 +2,8 @@ @@ -40,6 +42,9 @@ + + + @@ -52,6 +57,9 @@ + + + @@ -65,17 +73,22 @@ - - + AutomationProperties.AccessibilityView="Raw"> + + + + + diff --git a/dev/NavigationView/NavigationView.cpp b/dev/NavigationView/NavigationView.cpp index e1cdcede91..f1ec775746 100644 --- a/dev/NavigationView/NavigationView.cpp +++ b/dev/NavigationView/NavigationView.cpp @@ -1291,8 +1291,12 @@ void NavigationView::CreateAndHookEventsToSettings() return; } - auto settingsItem = m_settingsItem.get(); - auto settingsIcon = winrt::SymbolIcon(winrt::Symbol::Setting); + auto const settingsItem = m_settingsItem.get(); + auto const settingsIcon = winrt::AnimatedIcon(); + settingsIcon.Source(winrt::AnimatedSettingsVisualSource()); + auto const settingsFallbackIcon = winrt::SymbolIconSource(); + settingsFallbackIcon.Symbol(winrt::Symbol::Setting); + settingsIcon.FallbackIconSource(settingsFallbackIcon); settingsItem.Icon(settingsIcon); // Do localization for settings item label and Automation Name diff --git a/dev/NavigationView/NavigationViewItem.cpp b/dev/NavigationView/NavigationViewItem.cpp index a2d2ba7b67..407e200c77 100644 --- a/dev/NavigationView/NavigationViewItem.cpp +++ b/dev/NavigationView/NavigationViewItem.cpp @@ -27,6 +27,16 @@ static constexpr auto c_chevronHidden = L"ChevronHidden"sv; static constexpr auto c_chevronVisibleOpen = L"ChevronVisibleOpen"sv; static constexpr auto c_chevronVisibleClosed = L"ChevronVisibleClosed"sv; +static constexpr auto c_normalChevronHidden = L"NormalChevronHidden"sv; +static constexpr auto c_normalChevronVisibleOpen = L"NormalChevronVisibleOpen"sv; +static constexpr auto c_normalChevronVisibleClosed = L"NormalChevronVisibleClosed"sv; +static constexpr auto c_pointerOverChevronHidden = L"PointerOverChevronHidden"sv; +static constexpr auto c_pointerOverChevronVisibleOpen = L"PointerOverChevronVisibleOpen"sv; +static constexpr auto c_pointerOverChevronVisibleClosed = L"PointerOverChevronVisibleClosed"sv; +static constexpr auto c_pressedChevronHidden = L"PressedChevronHidden"sv; +static constexpr auto c_pressedChevronVisibleOpen = L"PressedChevronVisibleOpen"sv; +static constexpr auto c_pressedChevronVisibleClosed = L"PressedChevronVisibleClosed"sv; + NavigationViewItem::NavigationViewItem() { SetDefaultStyleKey(this); @@ -267,6 +277,7 @@ void NavigationViewItem::OnIsExpandedPropertyChanged(const winrt::DependencyProp winrt::ExpandCollapseState::Collapsed ); } + UpdateVisualState(true); } void NavigationViewItem::OnIconPropertyChanged(const winrt::DependencyPropertyChangedEventArgs& args) @@ -487,8 +498,96 @@ void NavigationViewItem::UpdateVisualStateForChevron() { if (auto const presenter = m_navigationViewItemPresenter.get()) { - auto const chevronState = HasChildren() && !(m_isClosedCompact && ShouldRepeaterShowInFlyout()) ? ( IsExpanded() ? c_chevronVisibleOpen : c_chevronVisibleClosed) : c_chevronHidden; - winrt::VisualStateManager::GoToState(presenter, chevronState, true); + enum class PointerStateValue{ Normal, PointerOver, Pressed }; + enum class ChevronStateValue { ChevronHidden, ChevronVisibleOpen, ChevronVisibleClosed }; + const auto pointerStateValue = [this, isEnabled = IsEnabled(), isSelected = IsSelected()]() + { + if (isEnabled) + { + if (m_isPointerOver) + { + if (m_isPressed) + { + return PointerStateValue::Pressed; //Pressed + } + else + { + return PointerStateValue::PointerOver; //PointerOver + } + } + else if (m_isPressed) + { + return PointerStateValue::Pressed; //Pressed + } + } + return PointerStateValue::Normal; //Normal + }(); + auto const chevronState = HasChildren() && !(m_isClosedCompact && ShouldRepeaterShowInFlyout()) ? (IsExpanded() ? ChevronStateValue::ChevronVisibleOpen : ChevronStateValue::ChevronVisibleClosed) : ChevronStateValue::ChevronHidden; + + auto const pointerChevronState = [this, pointerStateValue, chevronState]() { + if (chevronState == ChevronStateValue::ChevronHidden) + { + if (pointerStateValue == PointerStateValue::Normal) + { + return c_normalChevronHidden; + } + else if (pointerStateValue == PointerStateValue::PointerOver) + { + return c_pointerOverChevronHidden; + } + else if (pointerStateValue == PointerStateValue::Pressed) + { + return c_pressedChevronHidden; + } + } + else if (chevronState == ChevronStateValue::ChevronVisibleOpen) + { + if (pointerStateValue == PointerStateValue::Normal) + { + return c_normalChevronVisibleOpen; + } + else if (pointerStateValue == PointerStateValue::PointerOver) + { + return c_pointerOverChevronVisibleOpen; + } + else if (pointerStateValue == PointerStateValue::Pressed) + { + return c_pressedChevronVisibleOpen; + } + } + else if (chevronState == ChevronStateValue::ChevronVisibleClosed) + { + if (pointerStateValue == PointerStateValue::Normal) + { + return c_normalChevronVisibleClosed; + } + else if (pointerStateValue == PointerStateValue::PointerOver) + { + return c_pointerOverChevronVisibleClosed; + } + else if (pointerStateValue == PointerStateValue::Pressed) + { + return c_pressedChevronVisibleClosed; + } + } + return c_normalChevronHidden; + }(); + // Go to the appropriate pointerChevronState + winrt::VisualStateManager::GoToState(presenter, pointerChevronState, true); + + // Go to the appropriate chevronState + if (chevronState == ChevronStateValue::ChevronHidden) + { + winrt::VisualStateManager::GoToState(presenter, c_chevronHidden, true); + } + else if (chevronState == ChevronStateValue::ChevronVisibleOpen) + { + winrt::VisualStateManager::GoToState(presenter, c_chevronVisibleOpen, true); + } + else if (chevronState == ChevronStateValue::ChevronVisibleClosed) + { + winrt::VisualStateManager::GoToState(presenter, c_chevronVisibleClosed, true); + } } } @@ -867,12 +966,32 @@ void NavigationViewItem::ProcessPointerCanceled(const winrt::PointerRoutedEventA } m_isPressed = false; - m_isPointerOver = false; + // m_isPointerOver should be true before this event so this doesn't need to be set to true in the else block... + // What this flag tracks is complicated because of the NavigationView sub items and the m_capturedPointers that are being tracked.. + // We do this check because PointerCaptureLost can sometimes take the place of PointerReleased events. + // In these cases we need to test if the pointer is over the item to maintain the proper state. + if (IsOutOfControlBounds(args.GetCurrentPoint(*this).Position())) + { + m_isPointerOver = false; + } + m_capturedPointer = nullptr; ResetTrackedPointerId(); UpdateVisualState(true); } +bool NavigationViewItem::IsOutOfControlBounds(const winrt::Point& point) { + // This is a conservative check. It is okay to say we are + // out of the bounds when close to the edge to account for rounding. + const auto tolerance = 1.0; + const auto actualWidth = ActualWidth(); + const auto actualHeight = ActualHeight(); + return point.X < tolerance || + point.X > actualWidth - tolerance || + point.Y < tolerance || + point.Y > actualHeight - tolerance; +} + void NavigationViewItem::ProcessPointerOver(const winrt::PointerRoutedEventArgs& args) { if (IgnorePointerId(args)) diff --git a/dev/NavigationView/NavigationViewItem.h b/dev/NavigationView/NavigationViewItem.h index b4cc415dc0..edaf1867d0 100644 --- a/dev/NavigationView/NavigationViewItem.h +++ b/dev/NavigationView/NavigationViewItem.h @@ -99,6 +99,7 @@ class NavigationViewItem : bool ShouldEnableToolTip() const; bool IsOnLeftNav() const; bool IsOnTopPrimary() const; + bool IsOutOfControlBounds(const winrt::Point& point); void UpdateRepeaterItemsSource(); void OnItemsSourceViewChanged(const winrt::IInspectable& sender, const winrt::NotifyCollectionChangedEventArgs& args); diff --git a/dev/NavigationView/NavigationView_rs1_themeresources.xaml b/dev/NavigationView/NavigationView_rs1_themeresources.xaml index ce0ee73212..f6ddc17b86 100644 --- a/dev/NavigationView/NavigationView_rs1_themeresources.xaml +++ b/dev/NavigationView/NavigationView_rs1_themeresources.xaml @@ -4,6 +4,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:Microsoft.UI.Xaml.Controls" xmlns:primitives="using:Microsoft.UI.Xaml.Controls.Primitives" + xmlns:animatedvisuals="using:Microsoft.UI.Xaml.Controls.AnimatedVisuals" xmlns:media="using:Microsoft.UI.Xaml.Media" xmlns:contract4Present="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract,4)" xmlns:contract4NotPresent="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractNotPresent(Windows.Foundation.UniversalApiContract,4)" @@ -274,7 +275,7 @@ - 12.0 + 8 + diff --git a/dev/CommonStyles/TestUI/CommonStylesPage.xaml b/dev/CommonStyles/TestUI/CommonStylesPage.xaml index 5059ebb7b3..abd0984b07 100644 --- a/dev/CommonStyles/TestUI/CommonStylesPage.xaml +++ b/dev/CommonStyles/TestUI/CommonStylesPage.xaml @@ -354,17 +354,17 @@ - - - + + + - - - + + + From 577893e2c021306d69b197fd591d1d419affcbea Mon Sep 17 00:00:00 2001 From: Vsevolod Date: Thu, 25 Feb 2021 18:48:05 -0800 Subject: [PATCH 34/50] RadioMenuFlyoutItem update (#4317) * Update radiomenuflyoutitem * update radiomenuflyoutitem * Combine RadioMenuFlyoutItem version files * revert changes to v1 * remove animation root * Update RadioMenuFlyoutItem_themeresources.xaml --- .../RadioMenuFlyoutItem.vcxitems | 32 +--- ...adioMenuFlyoutItem_rs2_themeresources.xaml | 138 -------------- ...adioMenuFlyoutItem_rs4_themeresources.xaml | 177 ------------------ ...adioMenuFlyoutItem_rs5_themeresources.xaml | 170 ----------------- ...> RadioMenuFlyoutItem_themeresources.xaml} | 88 ++++----- 5 files changed, 52 insertions(+), 553 deletions(-) delete mode 100644 dev/RadioMenuFlyoutItem/RadioMenuFlyoutItem_rs2_themeresources.xaml delete mode 100644 dev/RadioMenuFlyoutItem/RadioMenuFlyoutItem_rs4_themeresources.xaml delete mode 100644 dev/RadioMenuFlyoutItem/RadioMenuFlyoutItem_rs5_themeresources.xaml rename dev/RadioMenuFlyoutItem/{RadioMenuFlyoutItem_rs1_themeresources.xaml => RadioMenuFlyoutItem_themeresources.xaml} (64%) mode change 100644 => 100755 diff --git a/dev/RadioMenuFlyoutItem/RadioMenuFlyoutItem.vcxitems b/dev/RadioMenuFlyoutItem/RadioMenuFlyoutItem.vcxitems index 4d2190f790..08af9e5085 100644 --- a/dev/RadioMenuFlyoutItem/RadioMenuFlyoutItem.vcxitems +++ b/dev/RadioMenuFlyoutItem/RadioMenuFlyoutItem.vcxitems @@ -20,52 +20,34 @@ - - - Version2 - RS1 - ThemeResources - false - - + + Version1 RS1 ThemeResources false - - Version2 - RS2 - ThemeResources - false - Version1 RS2 ThemeResources false - - Version2 - RS4 - ThemeResources - false - Version1 RS4 ThemeResources false - - Version2 + + Version1 RS5 ThemeResources false - - Version1 - RS5 + + Version2 + RS1 ThemeResources false diff --git a/dev/RadioMenuFlyoutItem/RadioMenuFlyoutItem_rs2_themeresources.xaml b/dev/RadioMenuFlyoutItem/RadioMenuFlyoutItem_rs2_themeresources.xaml deleted file mode 100644 index 6611ff073b..0000000000 --- a/dev/RadioMenuFlyoutItem/RadioMenuFlyoutItem_rs2_themeresources.xaml +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - diff --git a/dev/RadioMenuFlyoutItem/RadioMenuFlyoutItem_rs4_themeresources.xaml b/dev/RadioMenuFlyoutItem/RadioMenuFlyoutItem_rs4_themeresources.xaml deleted file mode 100644 index b4302d33a5..0000000000 --- a/dev/RadioMenuFlyoutItem/RadioMenuFlyoutItem_rs4_themeresources.xaml +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - diff --git a/dev/RadioMenuFlyoutItem/RadioMenuFlyoutItem_rs5_themeresources.xaml b/dev/RadioMenuFlyoutItem/RadioMenuFlyoutItem_rs5_themeresources.xaml deleted file mode 100644 index 153b2986d8..0000000000 --- a/dev/RadioMenuFlyoutItem/RadioMenuFlyoutItem_rs5_themeresources.xaml +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - diff --git a/dev/RadioMenuFlyoutItem/RadioMenuFlyoutItem_rs1_themeresources.xaml b/dev/RadioMenuFlyoutItem/RadioMenuFlyoutItem_themeresources.xaml old mode 100644 new mode 100755 similarity index 64% rename from dev/RadioMenuFlyoutItem/RadioMenuFlyoutItem_rs1_themeresources.xaml rename to dev/RadioMenuFlyoutItem/RadioMenuFlyoutItem_themeresources.xaml index 01b8cdc8d0..327995c42c --- a/dev/RadioMenuFlyoutItem/RadioMenuFlyoutItem_rs1_themeresources.xaml +++ b/dev/RadioMenuFlyoutItem/RadioMenuFlyoutItem_themeresources.xaml @@ -2,66 +2,68 @@ - From f1f08b0939a0e0d3aacf5b6f607e9986ab8c4418 Mon Sep 17 00:00:00 2001 From: Stephen L Peters Date: Thu, 25 Feb 2021 18:48:54 -0800 Subject: [PATCH 35/50] Remove MUXIgnoredByCodeGenAttribute from Microsoft.UI.Xaml (#4354) --- idl/Microsoft.UI.Xaml.idl | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/idl/Microsoft.UI.Xaml.idl b/idl/Microsoft.UI.Xaml.idl index 02222f5cc5..59853867cb 100644 --- a/idl/Microsoft.UI.Xaml.idl +++ b/idl/Microsoft.UI.Xaml.idl @@ -80,14 +80,6 @@ namespace Microsoft.UI.Xaml.CustomAttributes { String value; } - - [attributeusage(target_runtimeclass, target_enum, target_struct, target_interface, target_delegate, target_property, target_method)] - [attributename("muxignoredbycodegen")] - [version(0x00000001)] - [webhosthidden] - attribute MUXIgnoredByCodeGenAttribute - { - } } namespace Microsoft.UI.Xaml @@ -172,9 +164,6 @@ namespace Microsoft.UI.Xaml // Instance method on the owning type that can be used to validate or coerce the value. #define MUX_PROPERTY_VALIDATION_CALLBACK(value) muxpropertyvalidationcallback(value) -// If CodeGen should ignore the specified element. -#define MUX_IGNORED_BY_CODE_GEN muxignoredbycodegen - namespace MU_X_XTI_NAMESPACE { [MUX_PUBLIC] From 178bd6b14e9f0c8ec86b1a07ceaa81175c40ee49 Mon Sep 17 00:00:00 2001 From: Stephen L Peters Date: Thu, 25 Feb 2021 21:00:11 -0800 Subject: [PATCH 36/50] update the animated icon slider scenario to use a more appropriate AnimatedVisual (#4357) --- dev/AnimatedIcon/TestUI/AnimatedIconPage.xaml | 3 +- .../TestUI/AnimatedIcon_TestUI.projitems | 1 + dev/AnimatedIcon/TestUI/BrightnessSun.cs | 795 ++++++++++++++++++ 3 files changed, 798 insertions(+), 1 deletion(-) create mode 100644 dev/AnimatedIcon/TestUI/BrightnessSun.cs diff --git a/dev/AnimatedIcon/TestUI/AnimatedIconPage.xaml b/dev/AnimatedIcon/TestUI/AnimatedIconPage.xaml index a5eeeb86bf..4e76ceaf03 100644 --- a/dev/AnimatedIcon/TestUI/AnimatedIconPage.xaml +++ b/dev/AnimatedIcon/TestUI/AnimatedIconPage.xaml @@ -12,6 +12,7 @@ xmlns:contract7Present="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract,7)" xmlns:contract7NotPresent="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractNotPresent(Windows.Foundation.UniversalApiContract,7)" xmlns:animatedvisuals="using:Microsoft.UI.Xaml.Controls.AnimatedVisuals" + xmlns:myAnimatedvisuals="using:AnimatedVisuals" mc:Ignorable="d"> @@ -524,7 +525,7 @@ - + diff --git a/dev/AnimatedIcon/TestUI/AnimatedIcon_TestUI.projitems b/dev/AnimatedIcon/TestUI/AnimatedIcon_TestUI.projitems index afa3fd2547..8011a3996b 100644 --- a/dev/AnimatedIcon/TestUI/AnimatedIcon_TestUI.projitems +++ b/dev/AnimatedIcon/TestUI/AnimatedIcon_TestUI.projitems @@ -20,6 +20,7 @@ AnimatedIconPage.xaml + diff --git a/dev/AnimatedIcon/TestUI/BrightnessSun.cs b/dev/AnimatedIcon/TestUI/BrightnessSun.cs new file mode 100644 index 0000000000..5b1e0f9ca0 --- /dev/null +++ b/dev/AnimatedIcon/TestUI/BrightnessSun.cs @@ -0,0 +1,795 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// LottieGen version: +// 7.0.0-build.101+g12769c43d3 +// +// Command: +// LottieGen -Language CSharp -Public -WinUIVersion 2.4 -InputFile BrightnessSun.json +// +// Input file: +// BrightnessSun.json (3791 bytes created 15:52-08:00 Feb 25 2021) +// +// LottieGen source: +// http://aka.ms/Lottie +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ +// ____________________________________ +// | Object stats | Count | +// |__________________________|_______| +// | All CompositionObjects | 200 | +// |--------------------------+-------| +// | Expression animators | 56 | +// | KeyFrame animators | 28 | +// | Reference parameters | 56 | +// | Expression operations | 0 | +// |--------------------------+-------| +// | Animated brushes | - | +// | Animated gradient stops | - | +// | ExpressionAnimations | 29 | +// | PathKeyFrameAnimations | - | +// |--------------------------+-------| +// | ContainerVisuals | 1 | +// | ShapeVisuals | 1 | +// |--------------------------+-------| +// | ContainerShapes | - | +// | CompositionSpriteShapes | 16 | +// |--------------------------+-------| +// | Brushes | 3 | +// | Gradient stops | - | +// | CompositionVisualSurface | - | +// ------------------------------------ +using Microsoft.Graphics.Canvas.Geometry; +using System; +using System.Collections.Generic; +using System.Numerics; +using Windows.Graphics; +using Windows.UI; +using Windows.UI.Composition; + +namespace AnimatedVisuals +{ + // Name: Sun Animation + // Frame rate: 25 fps + // Frame count: 40 + // Duration: 1600.0 mS + sealed class BrightnessSun + : Microsoft.UI.Xaml.Controls.IAnimatedVisualSource, Microsoft.UI.Xaml.Controls.IAnimatedVisualSource2 + { + // Animation duration: 1.600 seconds. + internal const long c_durationTicks = 16000000; + + public Microsoft.UI.Xaml.Controls.IAnimatedVisual TryCreateAnimatedVisual(Compositor compositor) + { + object ignored = null; + return TryCreateAnimatedVisual(compositor, out ignored); + } + + public Microsoft.UI.Xaml.Controls.IAnimatedVisual TryCreateAnimatedVisual(Compositor compositor, out object diagnostics) + { + diagnostics = null; + + if (BrightnessSun_AnimatedVisual.IsRuntimeCompatible()) + { + return + new BrightnessSun_AnimatedVisual( + compositor + ); + } + + return null; + } + + /// + /// Gets the number of frames in the animation. + /// + public double FrameCount => 40d; + + /// + /// Gets the frame rate of the animation. + /// + public double Framerate => 25d; + + /// + /// Gets the duration of the animation. + /// + public TimeSpan Duration => TimeSpan.FromTicks(c_durationTicks); + + /// + /// Converts a zero-based frame number to the corresponding progress value denoting the + /// start of the frame. + /// + public double FrameToProgress(double frameNumber) + { + return frameNumber / 40d; + } + + /// + /// Returns a map from marker names to corresponding progress values. + /// + public IReadOnlyDictionary Markers => + new Dictionary + { + }; + + /// + /// Sets the color property with the given name, or does nothing if no such property + /// exists. + /// + public void SetColorProperty(string propertyName, Color value) + { + } + + /// + /// Sets the scalar property with the given name, or does nothing if no such property + /// exists. + /// + public void SetScalarProperty(string propertyName, double value) + { + } + + sealed class BrightnessSun_AnimatedVisual : Microsoft.UI.Xaml.Controls.IAnimatedVisual + { + const long c_durationTicks = 16000000; + readonly Compositor _c; + readonly ExpressionAnimation _reusableExpressionAnimation; + CompositionColorBrush _colorBrush_AlmostGoldenrod_FFE4950C; + CompositionPath _path; + ContainerVisual _root; + ExpressionAnimation _rootProgress; + ScalarKeyFrameAnimation _tEndScalarAnimation_1_to_0; + ScalarKeyFrameAnimation _tStartScalarAnimation_1_to_0; + StepEasingFunction _holdThenStepEasingFunction; + + static void StartProgressBoundAnimation( + CompositionObject target, + string animatedPropertyName, + CompositionAnimation animation, + ExpressionAnimation controllerProgressExpression) + { + target.StartAnimation(animatedPropertyName, animation); + var controller = target.TryGetAnimationController(animatedPropertyName); + controller.Pause(); + controller.StartAnimation("Progress", controllerProgressExpression); + } + + void BindProperty( + CompositionObject target, + string animatedPropertyName, + string expression, + string referenceParameterName, + CompositionObject referencedObject) + { + _reusableExpressionAnimation.ClearAllParameters(); + _reusableExpressionAnimation.Expression = expression; + _reusableExpressionAnimation.SetReferenceParameter(referenceParameterName, referencedObject); + target.StartAnimation(animatedPropertyName, _reusableExpressionAnimation); + } + + ScalarKeyFrameAnimation CreateScalarKeyFrameAnimation(float initialProgress, float initialValue, CompositionEasingFunction initialEasingFunction) + { + var result = _c.CreateScalarKeyFrameAnimation(); + result.Duration = TimeSpan.FromTicks(c_durationTicks); + result.InsertKeyFrame(initialProgress, initialValue, initialEasingFunction); + return result; + } + + CompositionSpriteShape CreateSpriteShape(CompositionGeometry geometry, Matrix3x2 transformMatrix) + { + var result = _c.CreateSpriteShape(geometry); + result.TransformMatrix = transformMatrix; + return result; + } + + CompositionSpriteShape CreateSpriteShape(CompositionGeometry geometry, Matrix3x2 transformMatrix, CompositionBrush fillBrush) + { + var result = _c.CreateSpriteShape(geometry); + result.TransformMatrix = transformMatrix; + result.FillBrush = fillBrush; + return result; + } + + CanvasGeometry Geometry_0() + { + CanvasGeometry result; + using (var builder = new CanvasPathBuilder(null)) + { + builder.BeginFigure(new Vector2(-9F, -134F)); + builder.AddLine(new Vector2(-9F, -68F)); + builder.EndFigure(CanvasFigureLoop.Open); + result = CanvasGeometry.CreatePath(builder); + } + return result; + } + + // - - - Layer aggregator + // - - Scale:0.70016,1.05751, Offset:<202, 162> + CanvasGeometry Geometry_1() + { + CanvasGeometry result; + using (var builder = new CanvasPathBuilder(null)) + { + builder.SetFilledRegionDetermination(CanvasFilledRegionDetermination.Winding); + builder.BeginFigure(new Vector2(3F, -54F)); + builder.AddCubicBezier(new Vector2(22.2800007F, -39.7159996F), new Vector2(51F, 26F), new Vector2(0F, 53F)); + builder.AddCubicBezier(new Vector2(17.1389999F, 58.6279984F), new Vector2(43.5250015F, 26.9519997F), new Vector2(40.9780006F, -6.6079998F)); + builder.AddCubicBezier(new Vector2(39.7750015F, -22.4619999F), new Vector2(30.8500004F, -43.4980011F), new Vector2(3F, -54F)); + builder.EndFigure(CanvasFigureLoop.Closed); + result = CanvasGeometry.CreatePath(builder); + } + return result; + } + + // - Layer aggregator + // Scale:0.8,0.8, Offset:<178.4, 151.2> + CompositionColorBrush ColorBrush_AlmostDarkOrange_FFF18F13() + { + return _c.CreateColorBrush(Color.FromArgb(0xFF, 0xF1, 0x8F, 0x13)); + } + + CompositionColorBrush ColorBrush_AlmostGoldenrod_FFE4950C() + { + return _colorBrush_AlmostGoldenrod_FFE4950C = _c.CreateColorBrush(Color.FromArgb(0xFF, 0xE4, 0x95, 0x0C)); + } + + // - Layer aggregator + // Scale:0.70016,1.05751, Offset:<202, 162> + CompositionColorBrush ColorBrush_SemiTransparentWhite() + { + return _c.CreateColorBrush(Color.FromArgb(0x38, 0xFF, 0xFF, 0xFF)); + } + + // - Layer aggregator + // Scale:0.8,0.8, Offset:<178.4, 151.2> + // Ellipse Path 1.EllipseGeometry + CompositionEllipseGeometry Ellipse_74p5() + { + var result = _c.CreateEllipseGeometry(); + result.Radius = new Vector2(74.5F, 74.5F); + return result; + } + + CompositionPath Path() + { + var result = _path = new CompositionPath(Geometry_0()); + return result; + } + + CompositionPathGeometry PathGeometry_00() + { + var result = _c.CreatePathGeometry(Path()); + var propertySet = result.Properties; + propertySet.InsertScalar("TEnd", 1F); + propertySet.InsertScalar("TStart", 1F); + StartProgressBoundAnimation(result, "TStart", TStartScalarAnimation_1_to_0(), RootProgress()); + BindProperty(result, "TrimStart", "Min(my.TStart,my.TEnd)", "my", result); + StartProgressBoundAnimation(result, "TEnd", TEndScalarAnimation_1_to_0(), _rootProgress); + BindProperty(result, "TrimEnd", "Max(my.TStart,my.TEnd)", "my", result); + return result; + } + + CompositionPathGeometry PathGeometry_01() + { + var result = _c.CreatePathGeometry(_path); + var propertySet = result.Properties; + propertySet.InsertScalar("TEnd", 1F); + propertySet.InsertScalar("TStart", 1F); + StartProgressBoundAnimation(result, "TStart", _tStartScalarAnimation_1_to_0, _rootProgress); + BindProperty(result, "TrimStart", "Min(my.TStart,my.TEnd)", "my", result); + StartProgressBoundAnimation(result, "TEnd", _tEndScalarAnimation_1_to_0, _rootProgress); + BindProperty(result, "TrimEnd", "Max(my.TStart,my.TEnd)", "my", result); + return result; + } + + CompositionPathGeometry PathGeometry_02() + { + var result = _c.CreatePathGeometry(_path); + var propertySet = result.Properties; + propertySet.InsertScalar("TEnd", 1F); + propertySet.InsertScalar("TStart", 1F); + StartProgressBoundAnimation(result, "TStart", _tStartScalarAnimation_1_to_0, _rootProgress); + BindProperty(result, "TrimStart", "Min(my.TStart,my.TEnd)", "my", result); + StartProgressBoundAnimation(result, "TEnd", _tEndScalarAnimation_1_to_0, _rootProgress); + BindProperty(result, "TrimEnd", "Max(my.TStart,my.TEnd)", "my", result); + return result; + } + + CompositionPathGeometry PathGeometry_03() + { + var result = _c.CreatePathGeometry(_path); + var propertySet = result.Properties; + propertySet.InsertScalar("TEnd", 1F); + propertySet.InsertScalar("TStart", 1F); + StartProgressBoundAnimation(result, "TStart", _tStartScalarAnimation_1_to_0, _rootProgress); + BindProperty(result, "TrimStart", "Min(my.TStart,my.TEnd)", "my", result); + StartProgressBoundAnimation(result, "TEnd", _tEndScalarAnimation_1_to_0, _rootProgress); + BindProperty(result, "TrimEnd", "Max(my.TStart,my.TEnd)", "my", result); + return result; + } + + CompositionPathGeometry PathGeometry_04() + { + var result = _c.CreatePathGeometry(_path); + var propertySet = result.Properties; + propertySet.InsertScalar("TEnd", 1F); + propertySet.InsertScalar("TStart", 1F); + StartProgressBoundAnimation(result, "TStart", _tStartScalarAnimation_1_to_0, _rootProgress); + BindProperty(result, "TrimStart", "Min(my.TStart,my.TEnd)", "my", result); + StartProgressBoundAnimation(result, "TEnd", _tEndScalarAnimation_1_to_0, _rootProgress); + BindProperty(result, "TrimEnd", "Max(my.TStart,my.TEnd)", "my", result); + return result; + } + + CompositionPathGeometry PathGeometry_05() + { + var result = _c.CreatePathGeometry(_path); + var propertySet = result.Properties; + propertySet.InsertScalar("TEnd", 1F); + propertySet.InsertScalar("TStart", 1F); + StartProgressBoundAnimation(result, "TStart", _tStartScalarAnimation_1_to_0, _rootProgress); + BindProperty(result, "TrimStart", "Min(my.TStart,my.TEnd)", "my", result); + StartProgressBoundAnimation(result, "TEnd", _tEndScalarAnimation_1_to_0, _rootProgress); + BindProperty(result, "TrimEnd", "Max(my.TStart,my.TEnd)", "my", result); + return result; + } + + CompositionPathGeometry PathGeometry_06() + { + var result = _c.CreatePathGeometry(_path); + var propertySet = result.Properties; + propertySet.InsertScalar("TEnd", 1F); + propertySet.InsertScalar("TStart", 1F); + StartProgressBoundAnimation(result, "TStart", _tStartScalarAnimation_1_to_0, _rootProgress); + BindProperty(result, "TrimStart", "Min(my.TStart,my.TEnd)", "my", result); + StartProgressBoundAnimation(result, "TEnd", _tEndScalarAnimation_1_to_0, _rootProgress); + BindProperty(result, "TrimEnd", "Max(my.TStart,my.TEnd)", "my", result); + return result; + } + + CompositionPathGeometry PathGeometry_07() + { + var result = _c.CreatePathGeometry(_path); + var propertySet = result.Properties; + propertySet.InsertScalar("TEnd", 1F); + propertySet.InsertScalar("TStart", 1F); + StartProgressBoundAnimation(result, "TStart", _tStartScalarAnimation_1_to_0, _rootProgress); + BindProperty(result, "TrimStart", "Min(my.TStart,my.TEnd)", "my", result); + StartProgressBoundAnimation(result, "TEnd", _tEndScalarAnimation_1_to_0, _rootProgress); + BindProperty(result, "TrimEnd", "Max(my.TStart,my.TEnd)", "my", result); + return result; + } + + CompositionPathGeometry PathGeometry_08() + { + var result = _c.CreatePathGeometry(_path); + var propertySet = result.Properties; + propertySet.InsertScalar("TEnd", 1F); + propertySet.InsertScalar("TStart", 1F); + StartProgressBoundAnimation(result, "TStart", _tStartScalarAnimation_1_to_0, _rootProgress); + BindProperty(result, "TrimStart", "Min(my.TStart,my.TEnd)", "my", result); + StartProgressBoundAnimation(result, "TEnd", _tEndScalarAnimation_1_to_0, _rootProgress); + BindProperty(result, "TrimEnd", "Max(my.TStart,my.TEnd)", "my", result); + return result; + } + + CompositionPathGeometry PathGeometry_09() + { + var result = _c.CreatePathGeometry(_path); + var propertySet = result.Properties; + propertySet.InsertScalar("TEnd", 1F); + propertySet.InsertScalar("TStart", 1F); + StartProgressBoundAnimation(result, "TStart", _tStartScalarAnimation_1_to_0, _rootProgress); + BindProperty(result, "TrimStart", "Min(my.TStart,my.TEnd)", "my", result); + StartProgressBoundAnimation(result, "TEnd", _tEndScalarAnimation_1_to_0, _rootProgress); + BindProperty(result, "TrimEnd", "Max(my.TStart,my.TEnd)", "my", result); + return result; + } + + CompositionPathGeometry PathGeometry_10() + { + var result = _c.CreatePathGeometry(_path); + var propertySet = result.Properties; + propertySet.InsertScalar("TEnd", 1F); + propertySet.InsertScalar("TStart", 1F); + StartProgressBoundAnimation(result, "TStart", _tStartScalarAnimation_1_to_0, _rootProgress); + BindProperty(result, "TrimStart", "Min(my.TStart,my.TEnd)", "my", result); + StartProgressBoundAnimation(result, "TEnd", _tEndScalarAnimation_1_to_0, _rootProgress); + BindProperty(result, "TrimEnd", "Max(my.TStart,my.TEnd)", "my", result); + return result; + } + + CompositionPathGeometry PathGeometry_11() + { + var result = _c.CreatePathGeometry(_path); + var propertySet = result.Properties; + propertySet.InsertScalar("TEnd", 1F); + propertySet.InsertScalar("TStart", 1F); + StartProgressBoundAnimation(result, "TStart", _tStartScalarAnimation_1_to_0, _rootProgress); + BindProperty(result, "TrimStart", "Min(my.TStart,my.TEnd)", "my", result); + StartProgressBoundAnimation(result, "TEnd", _tEndScalarAnimation_1_to_0, _rootProgress); + BindProperty(result, "TrimEnd", "Max(my.TStart,my.TEnd)", "my", result); + return result; + } + + CompositionPathGeometry PathGeometry_12() + { + var result = _c.CreatePathGeometry(_path); + var propertySet = result.Properties; + propertySet.InsertScalar("TEnd", 1F); + propertySet.InsertScalar("TStart", 1F); + StartProgressBoundAnimation(result, "TStart", _tStartScalarAnimation_1_to_0, _rootProgress); + BindProperty(result, "TrimStart", "Min(my.TStart,my.TEnd)", "my", result); + StartProgressBoundAnimation(result, "TEnd", _tEndScalarAnimation_1_to_0, _rootProgress); + BindProperty(result, "TrimEnd", "Max(my.TStart,my.TEnd)", "my", result); + return result; + } + + CompositionPathGeometry PathGeometry_13() + { + var result = _c.CreatePathGeometry(_path); + var propertySet = result.Properties; + propertySet.InsertScalar("TEnd", 1F); + propertySet.InsertScalar("TStart", 1F); + StartProgressBoundAnimation(result, "TStart", _tStartScalarAnimation_1_to_0, _rootProgress); + BindProperty(result, "TrimStart", "Min(my.TStart,my.TEnd)", "my", result); + StartProgressBoundAnimation(result, "TEnd", _tEndScalarAnimation_1_to_0, _rootProgress); + BindProperty(result, "TrimEnd", "Max(my.TStart,my.TEnd)", "my", result); + return result; + } + + // - Layer aggregator + // Scale:0.70016,1.05751, Offset:<202, 162> + CompositionPathGeometry PathGeometry_14() + { + return _c.CreatePathGeometry(new CompositionPath(Geometry_1())); + } + + // Layer aggregator + // Ellipse Path 1 + CompositionSpriteShape SpriteShape_00() + { + // Offset:<190, 162>, Rotation:-0.011598425070025746 degrees, Scale:<0.8, 0.8> + var result = CreateSpriteShape(Ellipse_74p5(), new Matrix3x2(0.800000012F, 0F, 0F, 0.800000012F, 190F, 162F), ColorBrush_AlmostDarkOrange_FFF18F13()); + return result; + } + + // Layer aggregator + // Path 1 + CompositionSpriteShape SpriteShape_01() + { + // Offset:<193.31511, 158.30362>, Rotation:25.999998864742253 degrees + var result = CreateSpriteShape(PathGeometry_00(), new Matrix3x2(0.898794055F, 0.438371152F, -0.438371152F, 0.898794055F, 193.315109F, 158.303619F)); + result.StrokeBrush = ColorBrush_AlmostGoldenrod_FFE4950C(); + result.StrokeDashCap = CompositionStrokeCap.Round; + result.StrokeStartCap = CompositionStrokeCap.Round; + result.StrokeEndCap = CompositionStrokeCap.Round; + result.StrokeMiterLimit = 2F; + result.StrokeThickness = 10F; + return result; + } + + // Layer aggregator + // Path 1 + CompositionSpriteShape SpriteShape_02() + { + // Offset:<195.67914, 156.45663>, Rotation:52.00000073708994 degrees, Scale:<1, 1> + var result = CreateSpriteShape(PathGeometry_01(), new Matrix3x2(0.615661502F, 0.788010776F, -0.788010776F, 0.615661502F, 195.679138F, 156.456635F)); + result.StrokeBrush = _colorBrush_AlmostGoldenrod_FFE4950C; + result.StrokeDashCap = CompositionStrokeCap.Round; + result.StrokeStartCap = CompositionStrokeCap.Round; + result.StrokeEndCap = CompositionStrokeCap.Round; + result.StrokeMiterLimit = 2F; + result.StrokeThickness = 10F; + return result; + } + + // Layer aggregator + // Path 1 + CompositionSpriteShape SpriteShape_03() + { + // Offset:<198.61359, 155.8329>, Rotation:78.00000018744032 degrees, Scale:<1, 1> + var result = CreateSpriteShape(PathGeometry_02(), new Matrix3x2(0.2079117F, 0.978147626F, -0.978147626F, 0.2079117F, 198.613586F, 155.832901F)); + result.StrokeBrush = _colorBrush_AlmostGoldenrod_FFE4950C; + result.StrokeDashCap = CompositionStrokeCap.Round; + result.StrokeStartCap = CompositionStrokeCap.Round; + result.StrokeEndCap = CompositionStrokeCap.Round; + result.StrokeMiterLimit = 2F; + result.StrokeThickness = 10F; + return result; + } + + // Layer aggregator + // Path 1 + CompositionSpriteShape SpriteShape_04() + { + // Offset:<201.52448, 156.55867>, Rotation:104.00000036039357 degrees + var result = CreateSpriteShape(PathGeometry_03(), new Matrix3x2(-0.241921902F, 0.970295727F, -0.970295727F, -0.241921902F, 201.524475F, 156.55867F)); + result.StrokeBrush = _colorBrush_AlmostGoldenrod_FFE4950C; + result.StrokeDashCap = CompositionStrokeCap.Round; + result.StrokeStartCap = CompositionStrokeCap.Round; + result.StrokeEndCap = CompositionStrokeCap.Round; + result.StrokeMiterLimit = 2F; + result.StrokeThickness = 10F; + return result; + } + + // Layer aggregator + // Path 1 + CompositionSpriteShape SpriteShape_05() + { + // Offset:<203.8226, 158.48703>, Rotation:130.0000019177151 degrees + var result = CreateSpriteShape(PathGeometry_04(), new Matrix3x2(-0.642787635F, 0.766044438F, -0.766044438F, -0.642787635F, 203.822601F, 158.48703F)); + result.StrokeBrush = _colorBrush_AlmostGoldenrod_FFE4950C; + result.StrokeDashCap = CompositionStrokeCap.Round; + result.StrokeStartCap = CompositionStrokeCap.Round; + result.StrokeEndCap = CompositionStrokeCap.Round; + result.StrokeMiterLimit = 2F; + result.StrokeThickness = 10F; + return result; + } + + // Layer aggregator + // Path 1 + CompositionSpriteShape SpriteShape_06() + { + // Offset:<205.04282, 161.22766>, Rotation:156.0000044610642 degrees + var result = CreateSpriteShape(PathGeometry_05(), new Matrix3x2(-0.913545489F, 0.406736642F, -0.406736642F, -0.913545489F, 205.042816F, 161.227661F)); + result.StrokeBrush = _colorBrush_AlmostGoldenrod_FFE4950C; + result.StrokeDashCap = CompositionStrokeCap.Round; + result.StrokeStartCap = CompositionStrokeCap.Round; + result.StrokeEndCap = CompositionStrokeCap.Round; + result.StrokeMiterLimit = 2F; + result.StrokeThickness = 10F; + return result; + } + + // Layer aggregator + // Path 1 + CompositionSpriteShape SpriteShape_07() + { + // Offset:<204.93811, 164.22583>, Rotation:-178.0000222417307 degrees, Scale:<1, 1> + var result = CreateSpriteShape(PathGeometry_06(), new Matrix3x2(-0.9993909F, -0.034899503F, 0.034899503F, -0.9993909F, 204.93811F, 164.22583F)); + result.StrokeBrush = _colorBrush_AlmostGoldenrod_FFE4950C; + result.StrokeDashCap = CompositionStrokeCap.Round; + result.StrokeStartCap = CompositionStrokeCap.Round; + result.StrokeEndCap = CompositionStrokeCap.Round; + result.StrokeMiterLimit = 2F; + result.StrokeThickness = 10F; + return result; + } + + // Layer aggregator + // Path 1 + CompositionSpriteShape SpriteShape_08() + { + // Offset:<203.5297, 166.87468>, Rotation:-151.99999734470822 degrees, Scale:<1, 1> + var result = CreateSpriteShape(PathGeometry_07(), new Matrix3x2(-0.882947624F, -0.469471633F, 0.469471633F, -0.882947624F, 203.529694F, 166.87468F)); + result.StrokeBrush = _colorBrush_AlmostGoldenrod_FFE4950C; + result.StrokeDashCap = CompositionStrokeCap.Round; + result.StrokeStartCap = CompositionStrokeCap.Round; + result.StrokeEndCap = CompositionStrokeCap.Round; + result.StrokeMiterLimit = 2F; + result.StrokeThickness = 10F; + return result; + } + + // Layer aggregator + // Path 1 + CompositionSpriteShape SpriteShape_09() + { + // Offset:<201.10265, 168.63803>, Rotation:-125.99999693065644 degrees, Scale:<1, 1> + var result = CreateSpriteShape(PathGeometry_08(), new Matrix3x2(-0.587785244F, -0.809017062F, 0.809017062F, -0.587785244F, 201.102646F, 168.638031F)); + result.StrokeBrush = _colorBrush_AlmostGoldenrod_FFE4950C; + result.StrokeDashCap = CompositionStrokeCap.Round; + result.StrokeStartCap = CompositionStrokeCap.Round; + result.StrokeEndCap = CompositionStrokeCap.Round; + result.StrokeMiterLimit = 2F; + result.StrokeThickness = 10F; + return result; + } + + // Layer aggregator + // Path 1 + CompositionSpriteShape SpriteShape_10() + { + // Offset:<198.14822, 169.15898>, Rotation:-99.99999771691004 degrees, Scale:<1, 1> + var result = CreateSpriteShape(PathGeometry_09(), new Matrix3x2(-0.173648149F, -0.984807849F, 0.984807849F, -0.173648149F, 198.148224F, 169.158981F)); + result.StrokeBrush = _colorBrush_AlmostGoldenrod_FFE4950C; + result.StrokeDashCap = CompositionStrokeCap.Round; + result.StrokeStartCap = CompositionStrokeCap.Round; + result.StrokeEndCap = CompositionStrokeCap.Round; + result.StrokeMiterLimit = 2F; + result.StrokeThickness = 10F; + return result; + } + + // Layer aggregator + // Path 1 + CompositionSpriteShape SpriteShape_11() + { + // Offset:<195.26443, 168.33206>, Rotation:-73.999998250233 degrees, + // Scale:<1.0000001, 1.0000001> + var result = CreateSpriteShape(PathGeometry_10(), new Matrix3x2(0.275637418F, -0.961261809F, 0.961261809F, 0.275637418F, 195.264435F, 168.332062F)); + result.StrokeBrush = _colorBrush_AlmostGoldenrod_FFE4950C; + result.StrokeDashCap = CompositionStrokeCap.Round; + result.StrokeStartCap = CompositionStrokeCap.Round; + result.StrokeEndCap = CompositionStrokeCap.Round; + result.StrokeMiterLimit = 2F; + result.StrokeThickness = 10F; + return result; + } + + // Layer aggregator + // Path 1 + CompositionSpriteShape SpriteShape_12() + { + // Offset:<193.035, 166.32468>, Rotation:-47.9999987246911 degrees, + // Scale:<1.0000001, 1.0000001> + var result = CreateSpriteShape(PathGeometry_11(), new Matrix3x2(0.669130743F, -0.743144929F, 0.743144929F, 0.669130743F, 193.035004F, 166.324677F)); + result.StrokeBrush = _colorBrush_AlmostGoldenrod_FFE4950C; + result.StrokeDashCap = CompositionStrokeCap.Round; + result.StrokeStartCap = CompositionStrokeCap.Round; + result.StrokeEndCap = CompositionStrokeCap.Round; + result.StrokeMiterLimit = 2F; + result.StrokeThickness = 10F; + return result; + } + + // Layer aggregator + // Path 1 + CompositionSpriteShape SpriteShape_13() + { + // Offset:<191.91118, 163.54312>, Rotation:-22.000004635862652 degrees, + // Scale:<1.0000002, 1.0000002> + var result = CreateSpriteShape(PathGeometry_12(), new Matrix3x2(0.927184045F, -0.374606639F, 0.374606639F, 0.927184045F, 191.911179F, 163.543121F)); + result.StrokeBrush = _colorBrush_AlmostGoldenrod_FFE4950C; + result.StrokeDashCap = CompositionStrokeCap.Round; + result.StrokeStartCap = CompositionStrokeCap.Round; + result.StrokeEndCap = CompositionStrokeCap.Round; + result.StrokeMiterLimit = 2F; + result.StrokeThickness = 10F; + return result; + } + + // Layer aggregator + // Path 1 + CompositionSpriteShape SpriteShape_14() + { + // Offset:<192.12045, 160.55043>, Rotation:4.000026206779586 degrees, + // Scale:<1.0000002, 1.0000002> + var result = CreateSpriteShape(PathGeometry_13(), new Matrix3x2(0.997564256F, 0.0697565377F, -0.0697565377F, 0.997564256F, 192.120453F, 160.55043F)); + result.StrokeBrush = _colorBrush_AlmostGoldenrod_FFE4950C; + result.StrokeDashCap = CompositionStrokeCap.Round; + result.StrokeStartCap = CompositionStrokeCap.Round; + result.StrokeEndCap = CompositionStrokeCap.Round; + result.StrokeMiterLimit = 2F; + result.StrokeThickness = 10F; + return result; + } + + // Layer aggregator + // Path 1 + CompositionSpriteShape SpriteShape_15() + { + // Offset:<202, 162>, Rotation:-0.008999309291422224 degrees, + // Scale:<1.1669357, 1.05751> + var result = CreateSpriteShape(PathGeometry_14(), new Matrix3x2(1.16693568F, 0F, 0F, 1.05751002F, 202F, 162F), ColorBrush_SemiTransparentWhite()); + return result; + } + + // The root of the composition. + ContainerVisual Root() + { + var result = _root = _c.CreateContainerVisual(); + var propertySet = result.Properties; + propertySet.InsertScalar("Progress", 0F); + // Layer aggregator + result.Children.InsertAtTop(ShapeVisual_0()); + return result; + } + + ExpressionAnimation RootProgress() + { + var result = _rootProgress = _c.CreateExpressionAnimation("_.Progress"); + result.SetReferenceParameter("_", _root); + return result; + } + + // TEnd + ScalarKeyFrameAnimation TEndScalarAnimation_1_to_0() + { + var result = _tEndScalarAnimation_1_to_0 = CreateScalarKeyFrameAnimation(0F, 1F, StepThenHoldEasingFunction()); + result.InsertKeyFrame(0.125F, 1F, _holdThenStepEasingFunction); + result.InsertKeyFrame(0.75F, 0F, _c.CreateCubicBezierEasingFunction(new Vector2(0F, 0F), new Vector2(0F, 0.899999976F))); + return result; + } + + // TStart + ScalarKeyFrameAnimation TStartScalarAnimation_1_to_0() + { + var result = _tStartScalarAnimation_1_to_0 = CreateScalarKeyFrameAnimation(0F, 1F, HoldThenStepEasingFunction()); + result.InsertKeyFrame(0.649999976F, 0F, _c.CreateCubicBezierEasingFunction(new Vector2(0.333000004F, 0F), new Vector2(0F, 0.896000028F))); + return result; + } + + // Layer aggregator + ShapeVisual ShapeVisual_0() + { + var result = _c.CreateShapeVisual(); + result.Size = new Vector2(380F, 324F); + var shapes = result.Shapes; + // Scale:0.8,0.8, Offset:<178.4, 151.2> + shapes.Add(SpriteShape_00()); + // Offset:<192, 161> + shapes.Add(SpriteShape_01()); + // Offset:<192, 161> + shapes.Add(SpriteShape_02()); + // Offset:<192, 161> + shapes.Add(SpriteShape_03()); + // Offset:<192, 161> + shapes.Add(SpriteShape_04()); + // Offset:<192, 161> + shapes.Add(SpriteShape_05()); + // Offset:<192, 161> + shapes.Add(SpriteShape_06()); + // Offset:<192, 161> + shapes.Add(SpriteShape_07()); + // Offset:<192, 161> + shapes.Add(SpriteShape_08()); + // Offset:<192, 161> + shapes.Add(SpriteShape_09()); + // Offset:<192, 161> + shapes.Add(SpriteShape_10()); + // Offset:<192, 161> + shapes.Add(SpriteShape_11()); + // Offset:<192, 161> + shapes.Add(SpriteShape_12()); + // Offset:<192, 161> + shapes.Add(SpriteShape_13()); + // Offset:<192, 161> + shapes.Add(SpriteShape_14()); + // Scale:0.70016,1.05751, Offset:<202, 162> + shapes.Add(SpriteShape_15()); + return result; + } + + StepEasingFunction HoldThenStepEasingFunction() + { + var result = _holdThenStepEasingFunction = _c.CreateStepEasingFunction(); + result.IsFinalStepSingleFrame = true; + return result; + } + + // TEnd + StepEasingFunction StepThenHoldEasingFunction() + { + var result = _c.CreateStepEasingFunction(); + result.IsInitialStepSingleFrame = true; + return result; + } + + internal BrightnessSun_AnimatedVisual( + Compositor compositor + ) + { + _c = compositor; + _reusableExpressionAnimation = compositor.CreateExpressionAnimation(); + Root(); + } + + public Visual RootVisual => _root; + public TimeSpan Duration => TimeSpan.FromTicks(c_durationTicks); + public Vector2 Size => new Vector2(380F, 324F); + void IDisposable.Dispose() => _root?.Dispose(); + + internal static bool IsRuntimeCompatible() + { + return Windows.Foundation.Metadata.ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 7); + } + } + } +} From 2b4a379770629f815267e4183e798e4fc1865e7a Mon Sep 17 00:00:00 2001 From: Stephen L Peters Date: Fri, 26 Feb 2021 07:03:23 -0800 Subject: [PATCH 37/50] Add AnimatedIcon to SplitButton (#4361) --- dev/SplitButton/SplitButton.xaml | 35 +++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/dev/SplitButton/SplitButton.xaml b/dev/SplitButton/SplitButton.xaml index 779b19adb4..a88e24ec07 100644 --- a/dev/SplitButton/SplitButton.xaml +++ b/dev/SplitButton/SplitButton.xaml @@ -4,7 +4,8 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:Microsoft.UI.Xaml.Controls" xmlns:contract7Present="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract,7)" - xmlns:contract7NotPresent="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractNotPresent(Windows.Foundation.UniversalApiContract,7)"> + xmlns:contract7NotPresent="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractNotPresent(Windows.Foundation.UniversalApiContract,7)" + xmlns:animatedvisuals="using:Microsoft.UI.Xaml.Controls.AnimatedVisuals"> - - - - - - - + + + + + + + - - - - - + + + + + + + + + + diff --git a/dev/Breadcrumb/BreadcrumbBarItem.cpp b/dev/Breadcrumb/BreadcrumbBarItem.cpp index a62bf25cfb..1732c12222 100644 --- a/dev/Breadcrumb/BreadcrumbBarItem.cpp +++ b/dev/Breadcrumb/BreadcrumbBarItem.cpp @@ -552,15 +552,14 @@ void BreadcrumbBarItem::InstantiateFlyout() m_ellipsisItemsRepeater.set(ellipsisItemsRepeater); // Create the Flyout and add the ItemsRepeater as content - const auto& ellipsisFlyout = winrt::Flyout(); - winrt::AutomationProperties::SetName(ellipsisFlyout, s_ellipsisFlyoutAutomationName); - ellipsisFlyout.Content(ellipsisItemsRepeater); - ellipsisFlyout.Placement(winrt::FlyoutPlacementMode::Bottom); - - m_ellipsisFlyout.set(ellipsisFlyout); + if (const auto& ellipsisFlyout = button.Flyout().try_as()) + { + winrt::AutomationProperties::SetName(ellipsisFlyout, s_ellipsisFlyoutAutomationName); + ellipsisFlyout.Content(ellipsisItemsRepeater); + ellipsisFlyout.Placement(winrt::FlyoutPlacementMode::Bottom); - // Set the Flyout to the ellipsis button - button.Flyout(ellipsisFlyout); + m_ellipsisFlyout.set(ellipsisFlyout); + } } } diff --git a/dev/Breadcrumb/BreadcrumbBar_themeresources.xaml b/dev/Breadcrumb/BreadcrumbBar_themeresources.xaml index 19776084de..7d0f03132f 100644 --- a/dev/Breadcrumb/BreadcrumbBar_themeresources.xaml +++ b/dev/Breadcrumb/BreadcrumbBar_themeresources.xaml @@ -6,8 +6,11 @@ - 11,11,11,12 - + 40 + 5,3,5,3 + 11,7,11,9 + 0,2,0,2 + @@ -35,6 +38,10 @@ + + + 1 + @@ -64,6 +71,10 @@ + + + 1 + @@ -92,6 +103,10 @@ + + + 2 + From 957581f119099bf85b8deb48ec5a0f26d7862993 Mon Sep 17 00:00:00 2001 From: Felix-Dev Date: Sat, 27 Feb 2021 00:23:01 +0100 Subject: [PATCH 41/50] Innerloop: Add missing TabView API test project (#3770) * inner loop VS automatic updates * inner loop VS automatic update * Add API test project to innerloop solution. --- MUXControlsInnerLoop.sln | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/MUXControlsInnerLoop.sln b/MUXControlsInnerLoop.sln index 5b782a7cdb..746d900511 100755 --- a/MUXControlsInnerLoop.sln +++ b/MUXControlsInnerLoop.sln @@ -346,6 +346,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "TabView", "TabView", "{B3E6 EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TabView", "dev\TabView\TabView.vcxitems", "{B9F81FEF-1E8D-4FE1-A46B-7002D4C109D2}" EndProject +Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "TabView_APITests", "dev\TabView\APITests\TabView_APITests.shproj", "{2F4E95E9-F729-481C-B9AA-C9BEC91AE395}" +EndProject Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "TabView_InteractionTests", "dev\TabView\InteractionTests\TabView_InteractionTests.shproj", "{D1E297B4-5E5B-4807-8624-4141C817A98A}" EndProject Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "TabView_TestUI", "dev\TabView\TestUI\TabView_TestUI.shproj", "{1D87AAC7-1E11-40FC-90A7-B6CE1C4567AE}" @@ -574,6 +576,7 @@ Global dev\SplitButton\TestUI\SplitButton_TestUI.projitems*{280c91f4-96b5-4bde-9e02-e573e1def583}*SharedItemsImports = 13 dev\Repeater\TestUI\Repeater_TestUI.projitems*{2ed883f5-20db-4445-8c96-517a21e5e657}*SharedItemsImports = 13 dev\MenuFlyout\TestUI\MenuFlyout_TestUI.projitems*{2ef860e2-8766-41fc-bde2-e6b18bb8c206}*SharedItemsImports = 13 + dev\TabView\APITests\TabView_APITests.projitems*{2f4e95e9-f729-481c-b9aa-c9bec91ae395}*SharedItemsImports = 13 dev\ParallaxView\ParallaxView.vcxitems*{3095445a-afcd-5154-ac36-9770e6ec1aa5}*SharedItemsImports = 9 dev\InfoBar\TestUI\InfoBar_TestUI.projitems*{32dfaf1e-c2ec-4c52-a4d8-b3a3946242b4}*SharedItemsImports = 13 dev\RadioMenuFlyoutItem\RadioMenuFlyoutItem.vcxitems*{3353a4a7-87b3-4e43-8f8d-43c7380d1d56}*SharedItemsImports = 9 @@ -1129,6 +1132,7 @@ Global {BA914F48-E924-4FD2-AEE1-264F67DB6C9F} = {807E57C8-F3E8-4049-AB88-BE3D3285B441} {B3E64837-A5E4-49CB-97FF-A365307B9191} = {67599AD5-51EC-44CB-85CE-B60CD8CBA270} {B9F81FEF-1E8D-4FE1-A46B-7002D4C109D2} = {B3E64837-A5E4-49CB-97FF-A365307B9191} + {2F4E95E9-F729-481C-B9AA-C9BEC91AE395} = {B3E64837-A5E4-49CB-97FF-A365307B9191} {D1E297B4-5E5B-4807-8624-4141C817A98A} = {B3E64837-A5E4-49CB-97FF-A365307B9191} {1D87AAC7-1E11-40FC-90A7-B6CE1C4567AE} = {B3E64837-A5E4-49CB-97FF-A365307B9191} {CFAFD6A7-FC7B-4C96-B292-A440C7C65D89} = {67599AD5-51EC-44CB-85CE-B60CD8CBA270} From 059fefb0c6caaf8d3b2977e831cbf9898d1fc33d Mon Sep 17 00:00:00 2001 From: marksfoster <76921770+marksfoster@users.noreply.github.com> Date: Sat, 27 Feb 2021 05:57:58 -0800 Subject: [PATCH 42/50] i1 (#4372) --- dev/CommonStyles/Common_themeresources_any.xaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/CommonStyles/Common_themeresources_any.xaml b/dev/CommonStyles/Common_themeresources_any.xaml index e98dfb84af..c3cb69f138 100755 --- a/dev/CommonStyles/Common_themeresources_any.xaml +++ b/dev/CommonStyles/Common_themeresources_any.xaml @@ -44,7 +44,7 @@ #00FFFFFF #19000000 #0BFFFFFF - #12000000 + #12FFFFFF #00FFFFFF #B31C1C1C From 4292f2bb87fe0f870ede72aef2007b45f520f200 Mon Sep 17 00:00:00 2001 From: Stephen L Peters Date: Sat, 27 Feb 2021 05:59:33 -0800 Subject: [PATCH 43/50] Update the nuget readme with instructions of how to do app level overrides of Winui2 resources. (#4279) * Update the nuget readme with instuctions of how to do app level overrides of Winui2 resources. * Fix some mistakes * Fix the root of the overrides example * Update build/NuSpecs/readme.txt Co-authored-by: Marcel Wagner Co-authored-by: Marcel Wagner --- build/NuSpecs/readme.txt | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/build/NuSpecs/readme.txt b/build/NuSpecs/readme.txt index 539fcabf7c..3f2644e6ed 100644 --- a/build/NuSpecs/readme.txt +++ b/build/NuSpecs/readme.txt @@ -8,16 +8,20 @@ Don't forget to set XamlControlsResources as your Application resources in App.x -or if you have other resources then add XamlControlsResources at the top as a merged dictionary: +If you have other resources, then we recommend you add those to the XamlControlsResources' MergedDictionaries. +This works with the platform's resource system to allow overrides of the XamlControlsResources resources. + - - - - - - - + + + + + + See http://aka.ms/winui for more information. From 4208a01f744690329f6cd326e722d9c78e2358e8 Mon Sep 17 00:00:00 2001 From: Ana Wishnoff Date: Mon, 1 Mar 2021 14:19:35 -0500 Subject: [PATCH 44/50] Updating README with a link to new contribution guidelines (#4381) * Adding a link to new contribution guidelines for requests, ideas, feedback * adding punctuation Co-authored-by: Marcel Wagner Co-authored-by: Marcel Wagner --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index fb20d093cd..d3e723cb9d 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,8 @@ The WinUI team welcomes feedback and contributions! For information on how to contribute please see [Contributing to the Windows UI Library](CONTRIBUTING.md). +For guidelines on making an impact on WinUI through non-code contributions, please see [Contributing ideas, feedback, and requests](CONTRIBUTING_feedback_and_requests.md). + ## WinUI features ### Benefits From ef4084a1052b6e8d0fc083b5f98720fe35541023 Mon Sep 17 00:00:00 2001 From: Canhua Li Date: Tue, 2 Mar 2021 10:44:19 -0800 Subject: [PATCH 45/50] Don't package compact themeresources to framework package (#4387) * Don't package compact themeresources to framework package * rollback change on PageToBeCompiled and $(MUXFinalRelease) != 'true' --- dev/dll/Microsoft.UI.Xaml.vcxproj | 96 +++++++++++++++++++++++++++---- 1 file changed, 84 insertions(+), 12 deletions(-) diff --git a/dev/dll/Microsoft.UI.Xaml.vcxproj b/dev/dll/Microsoft.UI.Xaml.vcxproj index f315d6d231..6af4ea6fae 100644 --- a/dev/dll/Microsoft.UI.Xaml.vcxproj +++ b/dev/dll/Microsoft.UI.Xaml.vcxproj @@ -382,37 +382,73 @@ Themes\%(Filename)%(Extension) $(MinSDKVersionRequiredFor21H1ThemeResource) - + Designer true Themes\%(Filename)%(Extension) $(MinSDKVersionRequiredForRS2ThemeResource) - + Designer true Themes\%(Filename)%(Extension) $(MinSDKVersionRequiredForRS3ThemeResource) - + Designer true Themes\%(Filename)%(Extension) $(MinSDKVersionRequiredForRS4ThemeResource) - + Designer true Themes\%(Filename)%(Extension) $(MinSDKVersionRequiredForRS5ThemeResource) - + Designer true Themes\%(Filename)%(Extension) $(MinSDKVersionRequiredFor19H1ThemeResource) - + + Designer + true + Themes\%(Filename)%(Extension) + $(MinSDKVersionRequiredFor21H1ThemeResource) + + + Designer + true + Themes\%(Filename)%(Extension) + $(MinSDKVersionRequiredForRS2ThemeResource) + + + Designer + true + Themes\%(Filename)%(Extension) + $(MinSDKVersionRequiredForRS3ThemeResource) + + + Designer + true + Themes\%(Filename)%(Extension) + $(MinSDKVersionRequiredForRS4ThemeResource) + + + Designer + true + Themes\%(Filename)%(Extension) + $(MinSDKVersionRequiredForRS5ThemeResource) + + + Designer + true + Themes\%(Filename)%(Extension) + $(MinSDKVersionRequiredFor19H1ThemeResource) + + Designer true Themes\%(Filename)%(Extension) @@ -454,37 +490,73 @@ Themes\%(Filename)%(Extension) $(MinSDKVersionRequiredFor21H1ThemeResource) - + + Designer + true + Themes\%(Filename)%(Extension) + $(MinSDKVersionRequiredForRS2ThemeResource) + + + Designer + true + Themes\%(Filename)%(Extension) + $(MinSDKVersionRequiredForRS3ThemeResource) + + + Designer + true + Themes\%(Filename)%(Extension) + $(MinSDKVersionRequiredForRS4ThemeResource) + + + Designer + true + Themes\%(Filename)%(Extension) + $(MinSDKVersionRequiredForRS5ThemeResource) + + + Designer + true + Themes\%(Filename)%(Extension) + $(MinSDKVersionRequiredFor19H1ThemeResource) + + + Designer + true + Themes\%(Filename)%(Extension) + $(MinSDKVersionRequiredFor21H1ThemeResource) + + Designer true Themes\%(Filename)%(Extension) $(MinSDKVersionRequiredForRS2ThemeResource) - + Designer true Themes\%(Filename)%(Extension) $(MinSDKVersionRequiredForRS3ThemeResource) - + Designer true Themes\%(Filename)%(Extension) $(MinSDKVersionRequiredForRS4ThemeResource) - + Designer true Themes\%(Filename)%(Extension) $(MinSDKVersionRequiredForRS5ThemeResource) - + Designer true Themes\%(Filename)%(Extension) $(MinSDKVersionRequiredFor19H1ThemeResource) - + Designer true Themes\%(Filename)%(Extension) From d3b85e62fef9a0c14f4ce989a4f3966ae914dd18 Mon Sep 17 00:00:00 2001 From: Leon Liang Date: Tue, 2 Mar 2021 12:32:48 -0800 Subject: [PATCH 46/50] Updating TabView to consume DropShadows (#4343) Since DropShadows don't require a caster or receiver, this PR checks for OS version 21H1 in codebehind before disabling the usage of the caster/receiver. The selected TabViewItem itself will have the DropShadow. --- dev/TabView/TabView.cpp | 24 +++++++++++++++--------- dev/TabView/TabViewItem.cpp | 5 ++++- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/dev/TabView/TabView.cpp b/dev/TabView/TabView.cpp index 57c380a8c5..1d4c0b06d0 100644 --- a/dev/TabView/TabView.cpp +++ b/dev/TabView/TabView.cpp @@ -88,7 +88,10 @@ void TabView::OnApplyTemplate() m_tabStripPointerExitedRevoker = containerGrid.PointerExited(winrt::auto_revoke, { this,&TabView::OnTabStripPointerExited }); } - m_shadowReceiver.set(GetTemplateChildT(L"ShadowReceiver", controlProtected)); + if (!SharedHelpers::Is21H1OrHigher()) + { + m_shadowReceiver.set(GetTemplateChildT(L"ShadowReceiver", controlProtected)); + } m_listView.set([this, controlProtected]() { auto listView = GetTemplateChildT(L"TabListView", controlProtected); @@ -136,18 +139,21 @@ void TabView::OnApplyTemplate() if (SharedHelpers::IsThemeShadowAvailable()) { - if (auto shadowCaster = GetTemplateChildT(L"ShadowCaster", controlProtected)) + if (!SharedHelpers::Is21H1OrHigher()) { - winrt::ThemeShadow shadow; - shadow.Receivers().Append(GetShadowReceiver()); + if (auto shadowCaster = GetTemplateChildT(L"ShadowCaster", controlProtected)) + { + winrt::ThemeShadow shadow; + shadow.Receivers().Append(GetShadowReceiver()); - double shadowDepth = unbox_value(SharedHelpers::FindInApplicationResources(c_tabViewShadowDepthName, box_value(c_tabShadowDepth))); + double shadowDepth = unbox_value(SharedHelpers::FindInApplicationResources(c_tabViewShadowDepthName, box_value(c_tabShadowDepth))); - const auto currentTranslation = shadowCaster.Translation(); - const auto translation = winrt::float3{ currentTranslation.x, currentTranslation.y, (float)shadowDepth }; - shadowCaster.Translation(translation); + const auto currentTranslation = shadowCaster.Translation(); + const auto translation = winrt::float3{ currentTranslation.x, currentTranslation.y, (float)shadowDepth }; + shadowCaster.Translation(translation); - shadowCaster.Shadow(shadow); + shadowCaster.Shadow(shadow); + } } } diff --git a/dev/TabView/TabViewItem.cpp b/dev/TabView/TabViewItem.cpp index f84ce49dd0..bbb87b1fca 100644 --- a/dev/TabView/TabViewItem.cpp +++ b/dev/TabView/TabViewItem.cpp @@ -66,7 +66,10 @@ void TabViewItem::OnApplyTemplate() if (internalTabView) { winrt::ThemeShadow shadow; - shadow.Receivers().Append(internalTabView->GetShadowReceiver()); + if (!SharedHelpers::Is21H1OrHigher()) + { + shadow.Receivers().Append(internalTabView->GetShadowReceiver()); + } m_shadow = shadow; double shadowDepth = unbox_value(SharedHelpers::FindInApplicationResources(c_tabViewShadowDepthName, box_value(c_tabShadowDepth))); From 659084e77ad7226201ebaa2bd9eed48254e1c20b Mon Sep 17 00:00:00 2001 From: Stephen L Peters Date: Tue, 2 Mar 2021 15:53:13 -0800 Subject: [PATCH 47/50] Remove the rd.xml work around (#4392) * Move the rd.xml into the nuget package. * remove the embedded resource, to test if the compiler issue still repros * remove the rd.xml edits entirely. --- .../AppThatUsesMUXIndirectly/Properties/Default.rd.xml | 2 -- .../NugetPackageTestApp/Properties/Default.rd.xml | 2 -- 2 files changed, 4 deletions(-) diff --git a/test/MUXControlsReleaseTest/AppThatUsesMUXIndirectly/Properties/Default.rd.xml b/test/MUXControlsReleaseTest/AppThatUsesMUXIndirectly/Properties/Default.rd.xml index 1f1d3f5c5a..f3ed5a5241 100644 --- a/test/MUXControlsReleaseTest/AppThatUsesMUXIndirectly/Properties/Default.rd.xml +++ b/test/MUXControlsReleaseTest/AppThatUsesMUXIndirectly/Properties/Default.rd.xml @@ -23,8 +23,6 @@ --> - - diff --git a/test/MUXControlsReleaseTest/NugetPackageTestApp/Properties/Default.rd.xml b/test/MUXControlsReleaseTest/NugetPackageTestApp/Properties/Default.rd.xml index 1f1d3f5c5a..f3ed5a5241 100644 --- a/test/MUXControlsReleaseTest/NugetPackageTestApp/Properties/Default.rd.xml +++ b/test/MUXControlsReleaseTest/NugetPackageTestApp/Properties/Default.rd.xml @@ -23,8 +23,6 @@ --> - - From 2b146ce2ee4d78f11cd819ec961c3a82f48bce84 Mon Sep 17 00:00:00 2001 From: Dilip Ojha Date: Wed, 3 Mar 2021 11:41:25 -0800 Subject: [PATCH 48/50] updated loc key handling (#4406) --- build/Localization/LocalizationAutomation.proj | 2 +- build/MUX-LocalizationHandoff.yml | 5 +++++ tools/VSTSRunLocWorkflow.cmd | 5 +++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/build/Localization/LocalizationAutomation.proj b/build/Localization/LocalizationAutomation.proj index 52c1da0207..7d904a29e9 100644 --- a/build/Localization/LocalizationAutomation.proj +++ b/build/Localization/LocalizationAutomation.proj @@ -46,7 +46,7 @@ - + diff --git a/build/MUX-LocalizationHandoff.yml b/build/MUX-LocalizationHandoff.yml index e2cde0169c..58d0c82cee 100644 --- a/build/MUX-LocalizationHandoff.yml +++ b/build/MUX-LocalizationHandoff.yml @@ -1,3 +1,6 @@ +variables: +- group: WinUITeamKeyVault-Secrets + name: $(BuildDefinitionName)_$(date:yyMM).$(date:dd)$(rev:rrr) jobs: - job: LocalizationHandoff @@ -19,6 +22,8 @@ jobs: displayName: 'Run Loc Workflow' inputs: filename: '$(Build.SourcesDirectory)\tools\VSTSRunLocWorkflow.cmd' + env: + MAPPED_LOC_KEY: $(WinUILab-TouchdownLoc-Key) - powershell: | $changes = & git ls-files -m diff --git a/tools/VSTSRunLocWorkflow.cmd b/tools/VSTSRunLocWorkflow.cmd index 677c15691a..7ac7dc9ad6 100644 --- a/tools/VSTSRunLocWorkflow.cmd +++ b/tools/VSTSRunLocWorkflow.cmd @@ -10,4 +10,9 @@ setlocal exit /B 1 ) +@if not defined MAPPED_LOC_KEY ( + echo ERROR: Expecting MAPPED_LOC_KEY to be set + exit /B 1 +) + call %~dp0\..\build\localization\RunLocWorkflow.cmd Daily-%BUILDDATE%.%BUILDREVISION% From 92a3b65febb201ab2d90e2b822c61c049a7150e4 Mon Sep 17 00:00:00 2001 From: Canhua Li Date: Wed, 3 Mar 2021 14:23:18 -0800 Subject: [PATCH 49/50] Remove rs2-19h1 theme resources from CBS package (#4400) * init * update the script error --- .../FrameworkPackage/MakeFrameworkPackage.ps1 | 102 ++++++++++++++++-- build/FrameworkPackage/cbspriconfig.xml | 23 ++++ 2 files changed, 117 insertions(+), 8 deletions(-) create mode 100644 build/FrameworkPackage/cbspriconfig.xml diff --git a/build/FrameworkPackage/MakeFrameworkPackage.ps1 b/build/FrameworkPackage/MakeFrameworkPackage.ps1 index b2fd32f7c2..e74960b9b0 100644 --- a/build/FrameworkPackage/MakeFrameworkPackage.ps1 +++ b/build/FrameworkPackage/MakeFrameworkPackage.ps1 @@ -29,6 +29,90 @@ function Copy-IntoNewDirectory { } } +function ExecuteMakePri +{ + Param($WindowsSdkBinDir, $makePriArgs) + $makepriNew = "`"" + (Join-Path $WindowsSdkBinDir "makepri.exe") + "`" $makePriArgs" + Write-Host $makepriNew + cmd /c $makepriNew + if ($LastExitCode -ne 0) { Exit 1 } +} + +# only keep 21h1 themeresources, and set othe themeresources to " " +# I didn't set it to "" because "" will change the `makepri dump` layout, but " " will not. +function RepackCBSResourcesPri +{ + Param($WindowsSdkBinDir, $sourceFile, $targetFile, $intermediateFolder) + New-Item -Path "$intermediateFolder" -ItemType Directory -Force | Out-Null + + $priconfigFrom = Join-Path "$PSScriptRoot" "cbspriconfig.xml" + $priconfig = Join-Path "$intermediateFolder" "priconfig.xml" + Copy-Item "$priconfigFrom" "$priconfig" -Force | Out-Null + + $cbsResourcesPriXml = "$intermediateFolder\CBSresources.pri.xml" + $resourcesPriXml = "$intermediateFolder\resources.pri.xml" + + # step 1: makepri dump CBSresources.pri to CBSresources.pri.xml + ExecuteMakePri "$WindowsSdkBinDir" "dump /dt detailed /if $sourceFile /of `"$cbsResourcesPriXml`" /o" + + # step 2: set rs2-19h1 resources to " " and save as resources.pri.xml + # In base64, IA== is " ". + [XML] $xml = Get-Content -Encoding UTF8 "$cbsResourcesPriXml" + $nodes = $xml.PriInfo.ResourceMap.SelectNodes("ResourceMapSubtree/ResourceMapSubtree/ResourceMapSubtree/NamedResource") + + $namesToBeChanged = @("19h1_themeresources.xbf", "rs5_themeresources.xbf", "rs4_themeresources.xbf", "rs3_themeresources.xbf", "rs2_themeresources.xbf", + "19h1_generic.xbf", "rs5_generic.xbf", "rs4_generic.xbf", "rs4_generic.xbf", "rs3_generic.xbf", "rs2_generic.xbf", + "19h1_themeresources_v1.xbf", "rs5_themeresources_v1.xbf", "rs4_themeresources_v1.xbf", "rs3_themeresources_V1.xbf", "rs2_themeresources_v1.xbf", + "19h1_generic_v1.xbf", "rs5_generic_v1.xbf", "rs4_generic_v1.xbf", "rs4_generic_v1.xbf", "rs3_generic_v1.xbf", "rs2_generic_v1.xbf", + "19h1_compact_themeresources.xbf", "rs5_compact_themeresources.xbf", "rs4_compact_themeresources.xbf", "rs3_compact_themeresources.xbf", "rs2_compact_themeresources.xbf", + "19h1_compact_themeresources_v1.xbf", "rs5_compact_themeresources_v1.xbf", "rs4_compact_themeresources_v1.xbf", "rs3_compact_themeresources_V1.xbf", "rs2_compact_themeresources_v1.xbf", + "21h1_compact_themeresources_v1.xbf", "21h1_compact_themeresources.xbf" + ) + + foreach($name in $namesToBeChanged) { + $nodes | + ? { $_.name -eq $name } | + % { $_.Candidate.Base64Value = "IA==" } + } + + [System.Xml.XmlWriterSettings] $xmlSettings = New-Object System.Xml.XmlWriterSettings + + #Preserve Windows formating + $xmlSettings.Indent = $true + $xmlSettings.IndentChars = "`t" + + #Keeping UTF-8 without BOM + $xmlSettings.Encoding = New-Object System.Text.UTF8Encoding($false) + + [System.Xml.xmlWriter] $xmlWriter = [System.Xml.xmlWriter]::Create("$resourcesPriXml", $xmlSettings) + $xml.Save($xmlWriter) + $xmlWriter.Close() + + # step 3: re-create PRI with resources.pri.xml + ExecuteMakePri "$WindowsSdkBinDir" "new /pr `"$intermediateFolder`" /cf `"$priconfig`" /in Microsoft.UI.Xaml.CBS /of `"$targetFile`" /o" + + # step 4: verify the re-created PRI is not the same with the original .pri + if((Get-FileHash "$sourceFile").hash -eq (Get-FileHash "$targetFile").hash) + { + Write-Error("$sourceFile should not equal to $targetFile"); + Exit 1 + } + + # step 5: dump the two pris and compare the content, they should be the same. + $file1 = "$intermediateFolder\source.pri.xml" + $file2 = "$intermediateFolder\target.pri.xml" + + ExecuteMakePri "$WindowsSdkBinDir" "dump /if $sourceFile /of `"$file1`" /o" + ExecuteMakePri "$WindowsSdkBinDir" "dump /if $targetFile /of `"$file2`" /o" + + # step 6: verify the dumped file, they should be the same + if((Get-FileHash "$file1").hash -ne (Get-FileHash "$file2").hash) + { + Write-Error("$file1 should equal to $file2"); + Exit 1 + } +} + pushd $PSScriptRoot $fullOutputPath = [IO.Path]::GetFullPath($outputDirectory) @@ -37,6 +121,7 @@ Write-Host "MakeFrameworkPackage: $fullOutputPath" -ForegroundColor Magenta mkdir -Force $fullOutputPath\PackageContents | Out-Null mkdir -Force $fullOutputPath\Resources | Out-Null +mkdir -Force $fullOutputPath\CBS | Out-Null Copy-IntoNewDirectory FrameworkPackageContents\* $fullOutputPath\PackageContents @@ -258,15 +343,16 @@ if (($Configuration -ilike "debug") -and (Test-Path $xbfFilesPath)) "$noiseAssetPath" "Microsoft.UI.Xaml\Assets\NoiseAsset_256x256_PNG.png" "@ | Out-File -Append -Encoding "UTF8" $fullOutputPath\PackageContents\FrameworkPackageFiles.txt -$makepriNew = "`"" + (Join-Path $WindowsSdkBinDir "makepri.exe") + "`" new /pr $fullOutputPath /cf $priConfigPath /of $priOutputPath /in $PackageName /o" -Write-Host $makepriNew -cmd /c $makepriNew -if ($LastExitCode -ne 0) { Exit 1 } +ExecuteMakePri "$WindowsSdkBinDir" "new /pr $fullOutputPath /cf $priConfigPath /of $priOutputPath /in $PackageName /o" -$makepriNew = "`"" + (Join-Path $WindowsSdkBinDir "makepri.exe") + "`" new /pr $fullOutputPath /cf $priConfigPath /of $priCBSOutputPath /in Microsoft.UI.Xaml.CBS /o" -Write-Host $makepriNew -cmd /c $makepriNew -if ($LastExitCode -ne 0) { Exit 1 } +$cbsIntermediateFolder = [IO.Path]::GetFullPath("$fullOutputPath\CBS") +$cbsIntermediatePri = Join-Path $cbsIntermediateFolder "CBSresources.pri" + +# create CBS\CBSresources.pri +ExecuteMakePri "$WindowsSdkBinDir" " new /pr $fullOutputPath /cf $priConfigPath /of $cbsIntermediatePri /in Microsoft.UI.Xaml.CBS /o" + +# unpack CBS\CBSresources.pri and repack it as CBSresources.pri +RepackCBSResourcesPri "$WindowsSdkBinDir" "$cbsIntermediatePri" "$priCBSOutputPath" "$cbsIntermediateFolder" $outputAppxFileFullPath = Join-Path $fullOutputPath "$PackageName.appx" $outputAppxFileFullPath = [IO.Path]::GetFullPath($outputAppxFileFullPath) diff --git a/build/FrameworkPackage/cbspriconfig.xml b/build/FrameworkPackage/cbspriconfig.xml new file mode 100644 index 0000000000..fe8f31eca3 --- /dev/null +++ b/build/FrameworkPackage/cbspriconfig.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From c1f617abee9be400456301ee0389813996030fe9 Mon Sep 17 00:00:00 2001 From: Karen Lai <7976322+karenbtlai@users.noreply.github.com> Date: Fri, 5 Mar 2021 06:06:54 -0800 Subject: [PATCH 50/50] update CommandBarBackgroundOpen brush (#4404) --- dev/CommonStyles/CommandBar_themeresources.xaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dev/CommonStyles/CommandBar_themeresources.xaml b/dev/CommonStyles/CommandBar_themeresources.xaml index b57e6699f5..138ae41fe3 100644 --- a/dev/CommonStyles/CommandBar_themeresources.xaml +++ b/dev/CommonStyles/CommandBar_themeresources.xaml @@ -13,7 +13,7 @@ 198 - + 1 @@ -62,7 +62,7 @@ 198 - + 1