-
Notifications
You must be signed in to change notification settings - Fork 742
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8533 from unoplatform/dev/mazi/flyout-showat
Clamp `Popup` and `Flyout` positioning to visible bounds
- Loading branch information
Showing
8 changed files
with
138 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
...mplesApp/UITests.Shared/Windows_UI_Xaml_Controls/Flyout/Flyout_ShowAt_Window_Content.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<Page | ||
x:Class="UITests.Windows_UI_Xaml_Controls.FlyoutTests.Flyout_ShowAt_Window_Content" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="using:UITests.Windows_UI_Xaml_Controls.Flyout" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d" | ||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> | ||
|
||
<StackPanel> | ||
<Button Click="ButtonButton_Click">Show at button</Button> | ||
<Button Click="WindowButton_Click" x:Name="WindowButton">Show at window</Button> | ||
</StackPanel> | ||
</Page> |
49 changes: 49 additions & 0 deletions
49
...esApp/UITests.Shared/Windows_UI_Xaml_Controls/Flyout/Flyout_ShowAt_Window_Content.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
using Uno.UI.Samples.Controls; | ||
using Windows.UI.Xaml; | ||
using Windows.UI.Xaml.Controls; | ||
using Windows.UI.Xaml.Media; | ||
|
||
// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238 | ||
|
||
namespace UITests.Windows_UI_Xaml_Controls.FlyoutTests | ||
{ | ||
/// <summary> | ||
/// An empty page that can be used on its own or navigated to within a Frame. | ||
/// </summary> | ||
[Sample] | ||
public sealed partial class Flyout_ShowAt_Window_Content : Page | ||
{ | ||
public Flyout_ShowAt_Window_Content() | ||
{ | ||
this.InitializeComponent(); | ||
} | ||
|
||
private void ButtonButton_Click(object sender, RoutedEventArgs e) | ||
{ | ||
Windows.UI.Xaml.Controls.Flyout flyout = new Windows.UI.Xaml.Controls.Flyout(); | ||
flyout.Content = | ||
new Border() | ||
{ | ||
Width = 300, | ||
Height = 300, | ||
Background = new SolidColorBrush(Windows.UI.Colors.Red), | ||
}; | ||
|
||
flyout.ShowAt((Button)sender); | ||
} | ||
|
||
private void WindowButton_Click(object sender, RoutedEventArgs e) | ||
{ | ||
Windows.UI.Xaml.Controls.Flyout flyout = new Windows.UI.Xaml.Controls.Flyout(); | ||
flyout.Content = | ||
new Border() | ||
{ | ||
Width = 300, | ||
Height = 300, | ||
Background = new SolidColorBrush(Windows.UI.Colors.Red), | ||
}; | ||
|
||
flyout.ShowAt(global::Windows.UI.Xaml.Window.Current.Content as FrameworkElement); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters