-
Notifications
You must be signed in to change notification settings - Fork 707
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add support for SuppressIsEnabled for commands alignment - Add support for XamlUICommand - FlyoutBase now creates its popup lazily
- Loading branch information
1 parent
d7e5502
commit 4fc3cb1
Showing
49 changed files
with
4,966 additions
and
676 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# MenuFlyout | ||
|
||
MenuFlyout is implemented to provide support for `ContextMenu` and `MenuBar` features. | ||
|
||
## Platform specific behavior | ||
|
||
On iOS and Android, the flyout can either be displayed using native popup, or Uno managed popups. | ||
|
||
The default behavior of the MenuFlyout is to follow the value `FeatureConfiguration.Style.UseUWPDefaultStyles`, but this can be changed per MenuFlyout using the `FlyoutBase.UseNativePopup` property. |
81 changes: 55 additions & 26 deletions
81
src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Controls/MenuBarTests/SimpleMenuBar.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 |
---|---|---|
@@ -1,46 +1,75 @@ | ||
<UserControl | ||
x:Class="UITests.Shared.Windows_UI_Xaml_Controls.MenuBarTests.SimpleMenuBar" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="using:UITests.Shared.Windows_UI_Xaml_Controls.MenuBarTests" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d" | ||
d:DesignHeight="300" | ||
d:DesignWidth="400"> | ||
<UserControl x:Class="UITests.Shared.Windows_UI_Xaml_Controls.MenuBarTests.SimpleMenuBar" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="using:UITests.Shared.Windows_UI_Xaml_Controls.MenuBarTests" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d" | ||
d:DesignHeight="300" | ||
d:DesignWidth="400"> | ||
|
||
<Grid> | ||
<Grid> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="auto"/> | ||
<RowDefinition Height="*"/> | ||
<RowDefinition Height="auto" /> | ||
<RowDefinition Height="*" /> | ||
</Grid.RowDefinitions> | ||
|
||
<MenuBar> | ||
<MenuBarItem Title="File"> | ||
<MenuFlyoutSubItem Text="New"> | ||
<MenuFlyoutItem Text="Plain Text Document"/> | ||
<MenuFlyoutItem Text="Rich Text Document"/> | ||
<MenuFlyoutItem Text="Other Formats..."/> | ||
<MenuFlyoutItem Text="Plain Text Document" | ||
Command="{x:Bind MyCommand}" CommandParameter="Plain Text" /> | ||
<MenuFlyoutItem Text="Plain Text Document (NoParam)" | ||
Command="{x:Bind MyCommand}" /> | ||
<MenuFlyoutItem Text="Rich Text Document" | ||
Click="MenuFlyoutItem_Click" ToolTipService.ToolTip="Rich Text Description" /> | ||
<MenuFlyoutItem Text="Other Formats..." | ||
Click="MenuFlyoutItem_Click" /> | ||
</MenuFlyoutSubItem> | ||
<MenuFlyoutItem Text="Open..."/> | ||
<MenuFlyoutItem Text="Save"/> | ||
<MenuFlyoutItem x:Name="openMenu" | ||
Icon="MailForward" | ||
Text="Open..." | ||
Click="MenuFlyoutItem_Click" /> | ||
<MenuFlyoutItem x:Name="saveMenu" | ||
Icon="Save" | ||
Text="Save" | ||
Click="MenuFlyoutItem_Click" | ||
AccessKey="S"> | ||
<MenuFlyoutItem.KeyboardAccelerators> | ||
<KeyboardAccelerator Modifiers="Control" | ||
Key="S" /> | ||
</MenuFlyoutItem.KeyboardAccelerators> | ||
</MenuFlyoutItem> | ||
<MenuFlyoutSeparator /> | ||
<MenuFlyoutItem Text="Exit"/> | ||
<MenuFlyoutItem x:Name="xamlUIMenu" | ||
Command="{x:Bind MyXamlUICommand}" CommandParameter="xamlUIMenu" /> | ||
<MenuFlyoutItem x:Name="disabledItem" | ||
Text="Disabled" | ||
IsEnabled="False" /> | ||
<MenuFlyoutItem x:Name="exitMenu" | ||
Text="Exit" | ||
Click="MenuFlyoutItem_Click" | ||
AccessKey="X" /> | ||
</MenuBarItem> | ||
|
||
<MenuBarItem Title="Edit"> | ||
<MenuFlyoutItem Text="Undo"/> | ||
<MenuFlyoutItem Text="Cut"/> | ||
<MenuFlyoutItem Text="Copy"/> | ||
<MenuFlyoutItem Text="Paste"/> | ||
<MenuFlyoutItem Text="Undo" | ||
Click="MenuFlyoutItem_Click"/> | ||
<MenuFlyoutItem Text="Cut" | ||
Click="MenuFlyoutItem_Click"/> | ||
<MenuFlyoutItem Text="Copy" | ||
Click="MenuFlyoutItem_Click" /> | ||
<MenuFlyoutItem Text="Paste" | ||
Click="MenuFlyoutItem_Click" /> | ||
</MenuBarItem> | ||
|
||
<MenuBarItem Title="Help"> | ||
<MenuFlyoutItem Text="About"/> | ||
<MenuFlyoutItem Text="About" | ||
Click="MenuFlyoutItem_Click"/> | ||
</MenuBarItem> | ||
</MenuBar> | ||
<StackPanel Grid.Row="1"> | ||
|
||
<TextBlock x:Name="result" /> | ||
</StackPanel> | ||
</Grid> | ||
</UserControl> |
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
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
35 changes: 0 additions & 35 deletions
35
src/Uno.UI/Generated/3.0.0.0/Windows.UI.Xaml.Input/CanExecuteRequestedEventArgs.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 |
---|---|---|
@@ -1,38 +1,3 @@ | ||
#pragma warning disable 108 // new keyword hiding | ||
#pragma warning disable 114 // new keyword hiding | ||
namespace Windows.UI.Xaml.Input | ||
{ | ||
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __MACOS__ | ||
[global::Uno.NotImplemented] | ||
#endif | ||
public partial class CanExecuteRequestedEventArgs | ||
{ | ||
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __MACOS__ | ||
[global::Uno.NotImplemented] | ||
public bool CanExecute | ||
{ | ||
get | ||
{ | ||
throw new global::System.NotImplementedException("The member bool CanExecuteRequestedEventArgs.CanExecute is not implemented in Uno."); | ||
} | ||
set | ||
{ | ||
global::Windows.Foundation.Metadata.ApiInformation.TryRaiseNotImplemented("Windows.UI.Xaml.Input.CanExecuteRequestedEventArgs", "bool CanExecuteRequestedEventArgs.CanExecute"); | ||
} | ||
} | ||
#endif | ||
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __MACOS__ | ||
[global::Uno.NotImplemented] | ||
public object Parameter | ||
{ | ||
get | ||
{ | ||
throw new global::System.NotImplementedException("The member object CanExecuteRequestedEventArgs.Parameter is not implemented in Uno."); | ||
} | ||
} | ||
#endif | ||
// Forced skipping of method Windows.UI.Xaml.Input.CanExecuteRequestedEventArgs.Parameter.get | ||
// Forced skipping of method Windows.UI.Xaml.Input.CanExecuteRequestedEventArgs.CanExecute.get | ||
// Forced skipping of method Windows.UI.Xaml.Input.CanExecuteRequestedEventArgs.CanExecute.set | ||
} | ||
} |
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
Oops, something went wrong.