diff --git a/src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/CommandBarFlyoutTests/CommandBarFlyoutMainPage.xaml b/src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/CommandBarFlyoutTests/CommandBarFlyoutMainPage.xaml
index 7a903683dd74..6ca2271bfbf2 100644
--- a/src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/CommandBarFlyoutTests/CommandBarFlyoutMainPage.xaml
+++ b/src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/CommandBarFlyoutTests/CommandBarFlyoutMainPage.xaml
@@ -1,4 +1,6 @@
+
+
-
-
-
-
-
+
+
+
+
+
-
-
+
- None
- Info
- Verbose
-
-
-
+ None
+ Info
+ Verbose
+
+
+
diff --git a/src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/CommandBarFlyoutTests/CommandBarFlyoutMainPage.xaml.cs b/src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/CommandBarFlyoutTests/CommandBarFlyoutMainPage.xaml.cs
index e3d1fc60e2ea..5e4fe140335f 100644
--- a/src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/CommandBarFlyoutTests/CommandBarFlyoutMainPage.xaml.cs
+++ b/src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/CommandBarFlyoutTests/CommandBarFlyoutMainPage.xaml.cs
@@ -1,5 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
+// MUX Reference controls\dev\CommandBarFlyout\TestUI\CommandBarFlyoutMainPage.xaml.cs, tag winui3/release/1.5.2, commit b91b3ce6f25c587a9e18c4e122f348f51331f18b
using Uno.UI.Samples.Controls;
using Microsoft.UI.Xaml;
@@ -21,24 +22,24 @@ public CommandBarFlyoutMainPage()
public void OnCommandBarFlyoutTestsClicked(object sender, object args)
{
- var rootFrame = Window.Current.Content as Frame;
+ var rootFrame = XamlRoot.Content as Frame;
rootFrame.NavigateWithoutAnimation(typeof(CommandBarFlyoutPage), "CommandBarFlyout Tests");
}
public void OnTextCommandBarFlyoutTestsClicked(object sender, object args)
{
- var rootFrame = Window.Current.Content as Frame;
+ var rootFrame = XamlRoot.Content as Frame;
rootFrame.NavigateWithoutAnimation(typeof(TextCommandBarFlyoutPage), "TextCommandBarFlyout Tests");
}
public void OnExtraCommandBarFlyoutTestsClicked(object sender, object args)
{
- var rootFrame = Window.Current.Content as Frame;
+ var rootFrame = XamlRoot.Content as Frame;
rootFrame.NavigateWithoutAnimation(typeof(ExtraCommandBarFlyoutPage), "Extra CommandBarFlyout Tests");
}
private void CmbCommandBarFlyoutOutputDebugStringLevel_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
-#if false
+#if false // Uno specific: Not needed.
MUXControlsTestHooks.SetOutputDebugStringLevelForType(
"CommandBarFlyout",
cmbCommandBarFlyoutOutputDebugStringLevel.SelectedIndex == 1 || cmbCommandBarFlyoutOutputDebugStringLevel.SelectedIndex == 2,
diff --git a/src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/CommandBarFlyoutTests/CommandBarFlyoutPage.xaml b/src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/CommandBarFlyoutTests/CommandBarFlyoutPage.xaml
index 4e3549a77d8a..093c02f781dc 100644
--- a/src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/CommandBarFlyoutTests/CommandBarFlyoutPage.xaml
+++ b/src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/CommandBarFlyoutTests/CommandBarFlyoutPage.xaml
@@ -1,4 +1,5 @@
+
-
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/CommandBarFlyoutTests/CommandBarFlyoutPage.xaml.cs b/src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/CommandBarFlyoutTests/CommandBarFlyoutPage.xaml.cs
index 78162f33dd30..2634535333b2 100644
--- a/src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/CommandBarFlyoutTests/CommandBarFlyoutPage.xaml.cs
+++ b/src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/CommandBarFlyoutTests/CommandBarFlyoutPage.xaml.cs
@@ -1,5 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
+// MUX Reference controls\dev\CommandBarFlyout\TestUI\CommandBarFlyoutPage.xaml.cs, tag winui3/release/1.5.2, commit b91b3ce6f25c587a9e18c4e122f348f51331f18b
using Common;
using System;
@@ -62,54 +63,70 @@ public CommandBarFlyoutPage()
clearSecondaryCommandsTimer.Interval = new TimeSpan(0, 0, 3 /*sec*/);
clearPrimaryCommandsTimer.Tick += ClearPrimaryCommandsTimer_Tick;
- if (ApiInformation.IsTypePresent("Windows.UI.Xaml.Input.KeyboardAccelerator"))
- {
- UndoButton1.KeyboardAccelerators.Add(new KeyboardAccelerator() { Key = VirtualKey.Z, Modifiers = VirtualKeyModifiers.Control });
- UndoButton2.KeyboardAccelerators.Add(new KeyboardAccelerator() { Key = VirtualKey.Z, Modifiers = VirtualKeyModifiers.Control });
- UndoButton3.KeyboardAccelerators.Add(new KeyboardAccelerator() { Key = VirtualKey.Z, Modifiers = VirtualKeyModifiers.Control });
- UndoButton4.KeyboardAccelerators.Add(new KeyboardAccelerator() { Key = VirtualKey.Z, Modifiers = VirtualKeyModifiers.Control });
- UndoButton5.KeyboardAccelerators.Add(new KeyboardAccelerator() { Key = VirtualKey.Z, Modifiers = VirtualKeyModifiers.Control });
- UndoButton6.KeyboardAccelerators.Add(new KeyboardAccelerator() { Key = VirtualKey.Z, Modifiers = VirtualKeyModifiers.Control });
- UndoButton7.KeyboardAccelerators.Add(new KeyboardAccelerator() { Key = VirtualKey.Z, Modifiers = VirtualKeyModifiers.Control });
-
- RedoButton1.KeyboardAccelerators.Add(new KeyboardAccelerator() { Key = VirtualKey.Y, Modifiers = VirtualKeyModifiers.Control });
- RedoButton2.KeyboardAccelerators.Add(new KeyboardAccelerator() { Key = VirtualKey.Y, Modifiers = VirtualKeyModifiers.Control });
- RedoButton3.KeyboardAccelerators.Add(new KeyboardAccelerator() { Key = VirtualKey.Y, Modifiers = VirtualKeyModifiers.Control });
- RedoButton4.KeyboardAccelerators.Add(new KeyboardAccelerator() { Key = VirtualKey.Y, Modifiers = VirtualKeyModifiers.Control });
- RedoButton5.KeyboardAccelerators.Add(new KeyboardAccelerator() { Key = VirtualKey.Y, Modifiers = VirtualKeyModifiers.Control });
- RedoButton6.KeyboardAccelerators.Add(new KeyboardAccelerator() { Key = VirtualKey.Y, Modifiers = VirtualKeyModifiers.Control });
- RedoButton7.KeyboardAccelerators.Add(new KeyboardAccelerator() { Key = VirtualKey.Y, Modifiers = VirtualKeyModifiers.Control });
-
- SelectAllButton1.KeyboardAccelerators.Add(new KeyboardAccelerator() { Key = VirtualKey.A, Modifiers = VirtualKeyModifiers.Control });
- SelectAllButton2.KeyboardAccelerators.Add(new KeyboardAccelerator() { Key = VirtualKey.A, Modifiers = VirtualKeyModifiers.Control });
- SelectAllButton3.KeyboardAccelerators.Add(new KeyboardAccelerator() { Key = VirtualKey.A, Modifiers = VirtualKeyModifiers.Control });
- SelectAllButton4.KeyboardAccelerators.Add(new KeyboardAccelerator() { Key = VirtualKey.A, Modifiers = VirtualKeyModifiers.Control });
- SelectAllButton5.KeyboardAccelerators.Add(new KeyboardAccelerator() { Key = VirtualKey.A, Modifiers = VirtualKeyModifiers.Control });
- SelectAllButton6.KeyboardAccelerators.Add(new KeyboardAccelerator() { Key = VirtualKey.A, Modifiers = VirtualKeyModifiers.Control });
- SelectAllButton7.KeyboardAccelerators.Add(new KeyboardAccelerator() { Key = VirtualKey.A, Modifiers = VirtualKeyModifiers.Control });
- }
-
- if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.UIElement", "ContextFlyout"))
- {
- FlyoutTarget1.ContextFlyout = Flyout1;
- FlyoutTarget2.ContextFlyout = Flyout2;
- FlyoutTarget3.ContextFlyout = Flyout3;
- FlyoutTarget4.ContextFlyout = Flyout4;
- FlyoutTarget5.ContextFlyout = Flyout5;
- FlyoutTarget6.ContextFlyout = Flyout6;
- FlyoutTarget7.ContextFlyout = Flyout7;
- }
-
- if (ApiInformation.IsEnumNamedValuePresent("Windows.UI.Xaml.Controls.Primitives.FlyoutPlacementMode", "TopEdgeAlignedLeft"))
- {
- Flyout1.Placement = FlyoutPlacementMode.TopEdgeAlignedLeft;
- Flyout2.Placement = FlyoutPlacementMode.TopEdgeAlignedLeft;
- Flyout3.Placement = FlyoutPlacementMode.TopEdgeAlignedLeft;
- Flyout4.Placement = FlyoutPlacementMode.TopEdgeAlignedLeft;
- Flyout5.Placement = FlyoutPlacementMode.TopEdgeAlignedLeft;
- Flyout6.Placement = FlyoutPlacementMode.TopEdgeAlignedLeft;
- Flyout7.Placement = FlyoutPlacementMode.TopEdgeAlignedLeft;
- }
+ UndoButton1.KeyboardAccelerators.Add(new KeyboardAccelerator() { Key = VirtualKey.Z, Modifiers = VirtualKeyModifiers.Control });
+ UndoButton2.KeyboardAccelerators.Add(new KeyboardAccelerator() { Key = VirtualKey.Z, Modifiers = VirtualKeyModifiers.Control });
+ UndoButton3.KeyboardAccelerators.Add(new KeyboardAccelerator() { Key = VirtualKey.Z, Modifiers = VirtualKeyModifiers.Control });
+ UndoButton4.KeyboardAccelerators.Add(new KeyboardAccelerator() { Key = VirtualKey.Z, Modifiers = VirtualKeyModifiers.Control });
+ UndoButton5.KeyboardAccelerators.Add(new KeyboardAccelerator() { Key = VirtualKey.Z, Modifiers = VirtualKeyModifiers.Control });
+ UndoButton6.KeyboardAccelerators.Add(new KeyboardAccelerator() { Key = VirtualKey.Z, Modifiers = VirtualKeyModifiers.Control });
+ UndoButton7.KeyboardAccelerators.Add(new KeyboardAccelerator() { Key = VirtualKey.Z, Modifiers = VirtualKeyModifiers.Control });
+ UndoButton11.KeyboardAccelerators.Add(new KeyboardAccelerator() { Key = VirtualKey.Z, Modifiers = VirtualKeyModifiers.Control });
+ UndoButton12.KeyboardAccelerators.Add(new KeyboardAccelerator() { Key = VirtualKey.Z, Modifiers = VirtualKeyModifiers.Control });
+ UndoButton13.KeyboardAccelerators.Add(new KeyboardAccelerator() { Key = VirtualKey.Z, Modifiers = VirtualKeyModifiers.Control });
+ UndoButton14.KeyboardAccelerators.Add(new KeyboardAccelerator() { Key = VirtualKey.Z, Modifiers = VirtualKeyModifiers.Control });
+ UndoButton15.KeyboardAccelerators.Add(new KeyboardAccelerator() { Key = VirtualKey.Z, Modifiers = VirtualKeyModifiers.Control });
+
+ RedoButton1.KeyboardAccelerators.Add(new KeyboardAccelerator() { Key = VirtualKey.Y, Modifiers = VirtualKeyModifiers.Control });
+ RedoButton2.KeyboardAccelerators.Add(new KeyboardAccelerator() { Key = VirtualKey.Y, Modifiers = VirtualKeyModifiers.Control });
+ RedoButton3.KeyboardAccelerators.Add(new KeyboardAccelerator() { Key = VirtualKey.Y, Modifiers = VirtualKeyModifiers.Control });
+ RedoButton4.KeyboardAccelerators.Add(new KeyboardAccelerator() { Key = VirtualKey.Y, Modifiers = VirtualKeyModifiers.Control });
+ RedoButton5.KeyboardAccelerators.Add(new KeyboardAccelerator() { Key = VirtualKey.Y, Modifiers = VirtualKeyModifiers.Control });
+ RedoButton6.KeyboardAccelerators.Add(new KeyboardAccelerator() { Key = VirtualKey.Y, Modifiers = VirtualKeyModifiers.Control });
+ RedoButton7.KeyboardAccelerators.Add(new KeyboardAccelerator() { Key = VirtualKey.Y, Modifiers = VirtualKeyModifiers.Control });
+ RedoButton11.KeyboardAccelerators.Add(new KeyboardAccelerator() { Key = VirtualKey.Y, Modifiers = VirtualKeyModifiers.Control });
+ RedoButton12.KeyboardAccelerators.Add(new KeyboardAccelerator() { Key = VirtualKey.Y, Modifiers = VirtualKeyModifiers.Control });
+ RedoButton13.KeyboardAccelerators.Add(new KeyboardAccelerator() { Key = VirtualKey.Y, Modifiers = VirtualKeyModifiers.Control });
+ RedoButton14.KeyboardAccelerators.Add(new KeyboardAccelerator() { Key = VirtualKey.Y, Modifiers = VirtualKeyModifiers.Control });
+ RedoButton15.KeyboardAccelerators.Add(new KeyboardAccelerator() { Key = VirtualKey.Y, Modifiers = VirtualKeyModifiers.Control });
+
+ SelectAllButton1.KeyboardAccelerators.Add(new KeyboardAccelerator() { Key = VirtualKey.A, Modifiers = VirtualKeyModifiers.Control });
+ SelectAllButton2.KeyboardAccelerators.Add(new KeyboardAccelerator() { Key = VirtualKey.A, Modifiers = VirtualKeyModifiers.Control });
+ SelectAllButton3.KeyboardAccelerators.Add(new KeyboardAccelerator() { Key = VirtualKey.A, Modifiers = VirtualKeyModifiers.Control });
+ SelectAllButton4.KeyboardAccelerators.Add(new KeyboardAccelerator() { Key = VirtualKey.A, Modifiers = VirtualKeyModifiers.Control });
+ SelectAllButton5.KeyboardAccelerators.Add(new KeyboardAccelerator() { Key = VirtualKey.A, Modifiers = VirtualKeyModifiers.Control });
+ SelectAllButton6.KeyboardAccelerators.Add(new KeyboardAccelerator() { Key = VirtualKey.A, Modifiers = VirtualKeyModifiers.Control });
+ SelectAllButton7.KeyboardAccelerators.Add(new KeyboardAccelerator() { Key = VirtualKey.A, Modifiers = VirtualKeyModifiers.Control });
+ SelectAllButton11.KeyboardAccelerators.Add(new KeyboardAccelerator() { Key = VirtualKey.A, Modifiers = VirtualKeyModifiers.Control });
+ SelectAllButton12.KeyboardAccelerators.Add(new KeyboardAccelerator() { Key = VirtualKey.A, Modifiers = VirtualKeyModifiers.Control });
+ SelectAllButton13.KeyboardAccelerators.Add(new KeyboardAccelerator() { Key = VirtualKey.A, Modifiers = VirtualKeyModifiers.Control });
+ SelectAllButton14.KeyboardAccelerators.Add(new KeyboardAccelerator() { Key = VirtualKey.A, Modifiers = VirtualKeyModifiers.Control });
+ SelectAllButton15.KeyboardAccelerators.Add(new KeyboardAccelerator() { Key = VirtualKey.A, Modifiers = VirtualKeyModifiers.Control });
+
+ FlyoutTarget1.ContextFlyout = Flyout1;
+ FlyoutTarget2.ContextFlyout = Flyout2;
+ FlyoutTarget3.ContextFlyout = Flyout3;
+ FlyoutTarget4.ContextFlyout = Flyout4;
+ FlyoutTarget5.ContextFlyout = Flyout5;
+ FlyoutTarget6.ContextFlyout = Flyout6;
+ FlyoutTarget7.ContextFlyout = Flyout7;
+ FlyoutTarget11.ContextFlyout = Flyout11;
+ FlyoutTarget12.ContextFlyout = Flyout12;
+ FlyoutTarget13.ContextFlyout = Flyout13;
+ FlyoutTarget14.ContextFlyout = Flyout14;
+ FlyoutTarget15.ContextFlyout = Flyout15;
+
+ Flyout1.Placement = FlyoutPlacementMode.TopEdgeAlignedLeft;
+ Flyout2.Placement = FlyoutPlacementMode.TopEdgeAlignedLeft;
+ Flyout3.Placement = FlyoutPlacementMode.TopEdgeAlignedLeft;
+ Flyout4.Placement = FlyoutPlacementMode.TopEdgeAlignedLeft;
+ Flyout5.Placement = FlyoutPlacementMode.TopEdgeAlignedLeft;
+ Flyout6.Placement = FlyoutPlacementMode.TopEdgeAlignedLeft;
+ Flyout7.Placement = FlyoutPlacementMode.TopEdgeAlignedLeft;
+ Flyout11.Placement = FlyoutPlacementMode.TopEdgeAlignedLeft;
+ Flyout12.Placement = FlyoutPlacementMode.TopEdgeAlignedLeft;
+ Flyout13.Placement = FlyoutPlacementMode.TopEdgeAlignedLeft;
+ Flyout14.Placement = FlyoutPlacementMode.TopEdgeAlignedLeft;
+ Flyout15.Placement = FlyoutPlacementMode.TopEdgeAlignedLeft;
}
public void OnElementClicked(object sender, object args)
@@ -259,9 +276,39 @@ private void OnFlyoutTarget9Click(object sender, RoutedEventArgs e)
private void OnFlyoutTarget10Click(object sender, RoutedEventArgs e)
{
-#if false // This uses WUX CommandBarFlyout - ignored
ShowFlyoutAt(Flyout10, FlyoutTarget10);
-#endif
+ }
+
+ private void OnFlyoutTarget11Click(object sender, RoutedEventArgs e)
+ {
+ ShowFlyoutAt(Flyout11, FlyoutTarget11, FlyoutShowMode.Standard);
+ }
+
+ private void OnFlyoutTarget12Click(object sender, RoutedEventArgs e)
+ {
+ DispatcherTimer showFlyoutTimer = new();
+ showFlyoutTimer.Interval = TimeSpan.FromSeconds(5);
+ showFlyoutTimer.Tick += (object sender, object args) =>
+ {
+ ShowFlyoutAt(Flyout12, FlyoutTarget12, FlyoutShowMode.Standard);
+ showFlyoutTimer.Stop();
+ };
+ showFlyoutTimer.Start();
+ }
+
+ private void OnFlyoutTarget13Click(object sender, RoutedEventArgs e)
+ {
+ ShowFlyoutAt(Flyout13, FlyoutTarget13);
+ }
+
+ private void OnFlyoutTarget14Click(object sender, RoutedEventArgs e)
+ {
+ ShowFlyoutAt(Flyout14, FlyoutTarget14);
+ }
+
+ private void OnFlyoutTarget15Click(object sender, RoutedEventArgs e)
+ {
+ ShowFlyoutAt(Flyout15, FlyoutTarget15);
}
private void ShowFlyoutAt(FlyoutBase flyout, FrameworkElement targetElement, FlyoutShowMode showMode = FlyoutShowMode.Transient)
@@ -309,15 +356,7 @@ private void ShowFlyoutAt(FlyoutBase flyout, FrameworkElement targetElement, Fly
}
}
- if (PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone5))
- {
- flyout.ShowAt(targetElement, new FlyoutShowOptions { Placement = FlyoutPlacementMode.TopEdgeAlignedLeft, ShowMode = showMode });
- }
- else
- {
- flyout.Placement = FlyoutPlacementMode.Top;
- flyout.ShowAt(targetElement);
- }
+ flyout.ShowAt(targetElement, new FlyoutShowOptions { Placement = FlyoutPlacementMode.TopEdgeAlignedLeft, ShowMode = showMode });
}
private void SetClearSecondaryCommandsFlyout(CommandBarFlyout commandBarFlyout)
diff --git a/src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/CommandBarFlyoutTests/ExtraCommandBarFlyoutPage.xaml b/src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/CommandBarFlyoutTests/ExtraCommandBarFlyoutPage.xaml
index a92879a0ea67..cbfd794983d0 100644
--- a/src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/CommandBarFlyoutTests/ExtraCommandBarFlyoutPage.xaml
+++ b/src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/CommandBarFlyoutTests/ExtraCommandBarFlyoutPage.xaml
@@ -1,4 +1,5 @@
+
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
-
-
-
- This is a very, very long string that cannot possibly fit within the RichTextBlock's bounds, so it overflows.
-
-
-
-
-
-
-
-
-
+
+
+
+ This is a very, very long string that cannot possibly fit within the RichTextBlock's bounds, so it overflows.
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/CommandBarFlyoutTests/ExtraCommandBarFlyoutPage.xaml.cs b/src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/CommandBarFlyoutTests/ExtraCommandBarFlyoutPage.xaml.cs
index ac66c5f0c49c..2fe978af91c9 100644
--- a/src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/CommandBarFlyoutTests/ExtraCommandBarFlyoutPage.xaml.cs
+++ b/src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/CommandBarFlyoutTests/ExtraCommandBarFlyoutPage.xaml.cs
@@ -1,5 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
+// MUX Reference controls\dev\CommandBarFlyout\TestUI\ExtraCommandBarFlyoutPage.xaml.cs, tag winui3/release/1.5.2, commit b91b3ce6f25c587a9e18c4e122f348f51331f18b
using System;
using System.Collections.Generic;
@@ -30,46 +31,12 @@ public ExtraCommandBarFlyoutPage()
{
this.InitializeComponent();
- if (ApiInformation.IsEnumNamedValuePresent("Windows.UI.Xaml.Controls.Primitives.FlyoutPlacementMode", "BottomEdgeAlignedLeft"))
- {
- TextCommandBarContextFlyout.Placement = FlyoutPlacementMode.BottomEdgeAlignedLeft;
- }
- else
- {
- TextCommandBarContextFlyout.Placement = FlyoutPlacementMode.Top;
- }
-
- if (ApiInformation.IsEnumNamedValuePresent("Windows.UI.Xaml.Controls.Primitives.FlyoutPlacementMode", "TopEdgeAlignedLeft"))
- {
- TextCommandBarSelectionFlyout.Placement = FlyoutPlacementMode.TopEdgeAlignedLeft;
- }
- else
- {
- TextCommandBarSelectionFlyout.Placement = FlyoutPlacementMode.Top;
- }
-
- if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.UIElement", "ContextFlyout"))
- {
- TextBox1.ContextFlyout = TextCommandBarContextFlyout;
- RichTextBlock1.ContextFlyout = TextCommandBarContextFlyout;
- }
-
- try
- {
- if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.Controls.TextBox", "SelectionFlyout"))
- {
- TextBox1.SelectionFlyout = TextCommandBarSelectionFlyout;
- }
- }
- catch (InvalidCastException)
- {
- // RS5 interfaces can change before release, so we need to make sure we don't crash if they do.
- }
-
- if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.Controls.RichTextBlock", "SelectionFlyout"))
- {
- RichTextBlock1.SelectionFlyout = TextCommandBarSelectionFlyout;
- }
+ TextCommandBarContextFlyout.Placement = FlyoutPlacementMode.BottomEdgeAlignedLeft;
+ TextCommandBarSelectionFlyout.Placement = FlyoutPlacementMode.TopEdgeAlignedLeft;
+ TextBox1.ContextFlyout = TextCommandBarContextFlyout;
+ RichTextBlock1.ContextFlyout = TextCommandBarContextFlyout;
+ TextBox1.SelectionFlyout = TextCommandBarSelectionFlyout;
+ RichTextBlock1.SelectionFlyout = TextCommandBarSelectionFlyout;
}
private void OnClearClipboardContentsClicked(object sender, object args)
@@ -79,7 +46,7 @@ private void OnClearClipboardContentsClicked(object sender, object args)
private void OnCountPopupsClicked(object sender, object args)
{
- PopupCountTextBox.Text = VisualTreeHelper.GetOpenPopups(Window.Current).Count.ToString();
+ PopupCountTextBox.Text = VisualTreeHelper.GetOpenPopupsForXamlRoot(XamlRoot).Count.ToString();
CustomButtonsOpenCount.Text = customButtonsFlyoutOpenCount.ToString();
}
diff --git a/src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/CommandBarFlyoutTests/TextCommandBarFlyoutPage.xaml b/src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/CommandBarFlyoutTests/TextCommandBarFlyoutPage.xaml
index 4f66feb50fc3..e0e982e88ecb 100644
--- a/src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/CommandBarFlyoutTests/TextCommandBarFlyoutPage.xaml
+++ b/src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/CommandBarFlyoutTests/TextCommandBarFlyoutPage.xaml
@@ -1,4 +1,5 @@
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Lorem ipsum ergo sum
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Lorem ipsum ergo sum
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/CommandBarFlyoutTests/TextCommandBarFlyoutPage.xaml.cs b/src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/CommandBarFlyoutTests/TextCommandBarFlyoutPage.xaml.cs
index 96540c438cb1..ef2db4a73ea1 100644
--- a/src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/CommandBarFlyoutTests/TextCommandBarFlyoutPage.xaml.cs
+++ b/src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/CommandBarFlyoutTests/TextCommandBarFlyoutPage.xaml.cs
@@ -1,5 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
+// MUX Reference controls\dev\CommandBarFlyout\TestUI\TextCommandBarFlyoutPage.xaml.cs, tag winui3/release/1.5.2, commit b91b3ce6f25c587a9e18c4e122f348f51331f18b
using Common;
using System;
@@ -27,73 +28,21 @@ public TextCommandBarFlyoutPage()
{
this.InitializeComponent();
-#if !HAS_UNO
- RichEditBox1.Document.SetText(Windows.UI.Text.TextSetOptions.None, "Lorem ipsum ergo sum");
-#endif
+ RichEditBox1.Document.SetText(TextSetOptions.None, "Lorem ipsum ergo sum");
Clipboard.ContentChanged += OnClipboardContentChanged;
- if (ApiInformation.IsEnumNamedValuePresent("Windows.UI.Xaml.Controls.Primitives.FlyoutPlacementMode", "BottomEdgeAlignedLeft"))
- {
- TextControlContextFlyout.Placement = FlyoutPlacementMode.BottomEdgeAlignedLeft;
- }
- else
- {
- TextControlContextFlyout.Placement = FlyoutPlacementMode.Top;
- }
-
- if (ApiInformation.IsEnumNamedValuePresent("Windows.UI.Xaml.Controls.Primitives.FlyoutPlacementMode", "TopEdgeAlignedLeft"))
- {
- TextControlSelectionFlyout.Placement = FlyoutPlacementMode.TopEdgeAlignedLeft;
- }
- else
- {
- TextControlSelectionFlyout.Placement = FlyoutPlacementMode.Top;
- }
-
- if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.UIElement", "ContextFlyout"))
- {
- TextBox1.ContextFlyout = TextControlContextFlyout;
- TextBlock1.ContextFlyout = TextControlContextFlyout;
-#if !HAS_UNO
- RichEditBox1.ContextFlyout = TextControlContextFlyout;
-#endif
- RichTextBlock1.ContextFlyout = TextControlContextFlyout;
- PasswordBox1.ContextFlyout = TextControlContextFlyout;
- }
-
- try
- {
- if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.Controls.TextBox", "SelectionFlyout"))
- {
- TextBox1.SelectionFlyout = TextControlSelectionFlyout;
- }
-
- if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.Controls.TextBlock", "SelectionFlyout"))
- {
- TextBlock1.SelectionFlyout = TextControlSelectionFlyout;
- }
-
- if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.Controls.RichEditBox", "SelectionFlyout"))
- {
-#if !HAS_UNO
- RichEditBox1.SelectionFlyout = TextControlSelectionFlyout;
-#endif
- }
-
- if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.Controls.RichTextBlock", "SelectionFlyout"))
- {
- RichTextBlock1.SelectionFlyout = TextControlSelectionFlyout;
- }
-
- if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.Controls.PasswordBox", "SelectionFlyout"))
- {
- PasswordBox1.SelectionFlyout = TextControlSelectionFlyout;
- }
- }
- catch (InvalidCastException)
- {
- // RS5 interfaces can change before release, so we need to make sure we don't crash if they do.
- }
+ TextControlContextFlyout.Placement = FlyoutPlacementMode.BottomEdgeAlignedLeft;
+ TextControlSelectionFlyout.Placement = FlyoutPlacementMode.TopEdgeAlignedLeft;
+ TextBox1.ContextFlyout = TextControlContextFlyout;
+ TextBlock1.ContextFlyout = TextControlContextFlyout;
+ RichEditBox1.ContextFlyout = TextControlContextFlyout;
+ RichTextBlock1.ContextFlyout = TextControlContextFlyout;
+ PasswordBox1.ContextFlyout = TextControlContextFlyout;
+ TextBox1.SelectionFlyout = TextControlSelectionFlyout;
+ TextBlock1.SelectionFlyout = TextControlSelectionFlyout;
+ RichEditBox1.SelectionFlyout = TextControlSelectionFlyout;
+ RichTextBlock1.SelectionFlyout = TextControlSelectionFlyout;
+ PasswordBox1.SelectionFlyout = TextControlSelectionFlyout;
}
private async void OnClipboardContentChanged(object sender, object e)
@@ -141,9 +90,7 @@ private void OnTextBlockSelectAllClicked(object sender, object args)
private void OnRichEditBoxSelectAllClicked(object sender, object args)
{
-#if !HAS_UNO
- RichEditBox1.Document.Selection.Expand(Windows.UI.Text.TextRangeUnit.Story);
-#endif
+ RichEditBox1.Document.Selection.Expand(TextRangeUnit.Story);
}
private void OnRichTextBlockSelectAllClicked(object sender, object args)
@@ -163,9 +110,7 @@ private void OnTextBlockClearSelectionClicked(object sender, object args)
private void OnRichEditBoxClearSelectionClicked(object sender, object args)
{
-#if !HAS_UNO
RichEditBox1.Document.Selection.Collapse(true);
-#endif
}
private void OnTextBoxFillWithTextClicked(object sender, object args)
@@ -175,9 +120,7 @@ private void OnTextBoxFillWithTextClicked(object sender, object args)
private void OnRichEditBoxFillWithTextClicked(object sender, object args)
{
-#if !HAS_UNO
- RichEditBox1.Document.SetText(TextSetOptions.None, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
-#endif
+ RichEditBox1.Document.SetText(TextSetOptions.None, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
}
private void OnRichTextBlockClearSelectionClicked(object sender, object args)
@@ -197,9 +140,7 @@ private void OnShowTextControlFlyoutOnTextBlockClicked(object sender, object arg
private void OnShowTextControlFlyoutOnRichEditBoxClicked(object sender, object args)
{
-#if !HAS_UNO
ShowTextControlContextFlyoutTransient(RichEditBox1);
-#endif
}
private void OnShowTextControlFlyoutOnRichTextBlockClicked(object sender, object args)
@@ -224,9 +165,7 @@ private void OnShowStandardTextControlFlyoutOnTextBlockClicked(object sender, ob
private void OnShowStandardTextControlFlyoutOnRichEditBoxClicked(object sender, object args)
{
-#if !HAS_UNO
ShowTextControlContextFlyoutStandard(RichEditBox1);
-#endif
}
private void OnShowStandardTextControlFlyoutOnRichTextBlockClicked(object sender, object args)
@@ -241,26 +180,12 @@ private void OnShowStandardTextControlFlyoutOnPasswordBoxClicked(object sender,
private void ShowTextControlContextFlyoutTransient(FrameworkElement targetElement)
{
- if (PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone5))
- {
- TextControlContextFlyout.ShowAt(targetElement, new FlyoutShowOptions { ShowMode = FlyoutShowMode.Transient });
- }
- else
- {
- TextControlContextFlyout.ShowAt(targetElement);
- }
+ TextControlContextFlyout.ShowAt(targetElement, new FlyoutShowOptions { ShowMode = FlyoutShowMode.Transient });
}
private void ShowTextControlContextFlyoutStandard(FrameworkElement targetElement)
{
- if (PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone5))
- {
- TextControlSelectionFlyout.ShowAt(targetElement, new FlyoutShowOptions { ShowMode = FlyoutShowMode.Standard });
- }
- else
- {
- TextControlSelectionFlyout.ShowAt(targetElement);
- }
+ TextControlSelectionFlyout.ShowAt(targetElement, new FlyoutShowOptions { ShowMode = FlyoutShowMode.Standard });
}
private void OnClearClipboardContentsClicked(object sender, object args)
@@ -280,10 +205,8 @@ private void OnSetClipboardContentsClicked(object sender, object args)
private void OnGetRichEditBoxRtfContentClicked(object sender, object args)
{
-#if !HAS_UNO
string rtfContent;
- RichEditBox1.Document.GetText(TextGetOptions.FormatRtf, out rtfContent);
+ RichEditBox1.Document.GetText(TextGetOptions.FormatRtf, out rtfContent);
StatusReportingTextBox.Text = rtfContent;
-#endif
}
}
diff --git a/src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/ScrollViewTests/ScrollViewPage.xaml.cs b/src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/ScrollViewTests/ScrollViewPage.xaml.cs
index 23fdf5669ffa..b12c1a860dfc 100644
--- a/src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/ScrollViewTests/ScrollViewPage.xaml.cs
+++ b/src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/ScrollViewTests/ScrollViewPage.xaml.cs
@@ -15,19 +15,6 @@
namespace MUXControlsTestApp;
-public static class FrameExtensions
-{
- public static void NavigateWithoutAnimation(this Frame frame, Type sourcePageType)
- {
- frame.Navigate(sourcePageType, new SuppressNavigationTransitionInfo());
- }
-
- public static void NavigateWithoutAnimation(this Frame frame, Type sourcePageType, object parameter)
- {
- frame.Navigate(sourcePageType, parameter, new SuppressNavigationTransitionInfo());
- }
-}
-
[Sample("Scrolling")]
public sealed partial class ScrollViewPage : TestPage
{