Skip to content
Merged
Show file tree
Hide file tree
Changes from 60 commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
856ccb9
#981 adding ClassicMenu Control
IbraheemOsama Apr 9, 2017
2388c94
#981 creating parital classes
IbraheemOsama Apr 9, 2017
b1d7520
#981 fixing double navigation issue
IbraheemOsama Apr 9, 2017
b8fd598
#981 adding clarifications to the sample page.
IbraheemOsama Apr 9, 2017
0f0dd32
#981 removing unused references
IbraheemOsama Apr 9, 2017
61acc21
#981 adding data to edit menu
IbraheemOsama Apr 9, 2017
aea3bb5
#981 fixing layout and adding comments
IbraheemOsama Apr 9, 2017
43e96a1
#981 adding headers to all files
IbraheemOsama Apr 9, 2017
1d43869
Merge remote-tracking branch 'refs/remotes/Microsoft/dev' into Classi…
IbraheemOsama Apr 9, 2017
091faaf
#981 adding header to VsCommands file
IbraheemOsama Apr 9, 2017
ecd0544
#981 Apply Xaml styler roles to new Xaml files
IbraheemOsama Apr 9, 2017
201644f
Adding colors to Classic Menu
IbraheemOsama Apr 9, 2017
11e95c0
Applying some PR comments
IbraheemOsama Apr 9, 2017
39a7b2b
Adding styling
IbraheemOsama Apr 10, 2017
0e6637d
Adding items to edit menu
IbraheemOsama Apr 10, 2017
d6be89d
Creating a circular menu items
IbraheemOsama Apr 10, 2017
4cc9d0e
Enhancing circular menu performance
IbraheemOsama Apr 10, 2017
3693abf
changing classic menu to menu
IbraheemOsama Apr 18, 2017
dcfef83
adding border to items presenter
IbraheemOsama Apr 18, 2017
a20c4de
generlization the menu style
IbraheemOsama Apr 18, 2017
8055fa1
Creating men selected item and navigate from menuItem to header
IbraheemOsama Apr 25, 2017
3bef24d
Adding tapped to SelectedheaderItem
IbraheemOsama Apr 25, 2017
e5fad33
adding quick access alt button on menu item
IbraheemOsama Apr 25, 2017
e4ba89e
Merge remote-tracking branch 'refs/remotes/Microsoft/dev' into Classi…
IbraheemOsama Apr 25, 2017
d246391
adding input gesture text to header item
IbraheemOsama Apr 25, 2017
008a4ba
Merge remote-tracking branch 'refs/remotes/Microsoft/dev' into Classi…
IbraheemOsama Apr 25, 2017
b9f1294
Update MenuPage with open file menu
IbraheemOsama Apr 25, 2017
dc12a3f
adding headerButton style for menu
IbraheemOsama Apr 26, 2017
fc4adcd
adding switching orientation
IbraheemOsama Apr 27, 2017
a2b3bc4
adding orientation change
IbraheemOsama Apr 27, 2017
0a0624e
changing move header function
IbraheemOsama Apr 27, 2017
1fe90f1
adding on menu open state
IbraheemOsama Apr 29, 2017
14c432b
remvoing property name, minor change to retirger appveyor
IbraheemOsama Apr 29, 2017
a78f90e
Merge remote-tracking branch 'refs/remotes/Microsoft/dev' into Classi…
IbraheemOsama Apr 29, 2017
caedbe7
adding resource file for menu styles
IbraheemOsama May 15, 2017
99bffdc
merging conflects
IbraheemOsama May 15, 2017
a5f01a6
adding menu folder to project after merging
IbraheemOsama May 15, 2017
4253f83
adding .bind file as content in in build action
IbraheemOsama May 15, 2017
fc93320
Adding menu icon
IbraheemOsama May 17, 2017
203098c
editing menu control styling
IbraheemOsama May 22, 2017
ab129cf
adding orientation to sample page and adding transition flag
IbraheemOsama May 22, 2017
bfe9695
Add item vector change to allow update flyout on new item add/change/…
IbraheemOsama May 22, 2017
91c6c32
validating for flyout menu null
IbraheemOsama May 23, 2017
3587d7c
adding dynamic item to sample page
IbraheemOsama May 23, 2017
c0dc082
Clicking alt return to last focus item
IbraheemOsama May 27, 2017
23283b7
Adding menu item parent alt key requested
IbraheemOsama May 27, 2017
ec9afa4
Unregistering focus event of set focus on menu item
IbraheemOsama May 27, 2017
c854baf
Adding tooltip style and placement mode
IbraheemOsama May 28, 2017
1c39eab
Adding tooltip check for show\hide
IbraheemOsama May 28, 2017
50faf2f
adding support for AccessKeys for CU
IbraheemOsama May 30, 2017
ae51858
removing unused styles
IbraheemOsama Jun 22, 2017
33f8bfb
Update documentations
IbraheemOsama Jun 22, 2017
86d261e
Merge remote-tracking branch 'refs/remotes/Microsoft/dev' into Classi…
IbraheemOsama Jun 22, 2017
015747a
Limit AllowTooltip to Menu control only
IbraheemOsama Jun 25, 2017
184731f
prioritiese menu flyout popup than AccessKey
IbraheemOsama Jun 25, 2017
da18bf4
fixing caching problem
IbraheemOsama Jun 25, 2017
b529aa9
fixing IsInTransitionState
IbraheemOsama Jun 25, 2017
eafdcde
Adding removing input gesture on menunloaded
IbraheemOsama Jun 25, 2017
fa79558
Removing cached data on menu unload event
IbraheemOsama Jun 26, 2017
f2877f0
Merge remote-tracking branch 'refs/remotes/Microsoft/dev' into Classi…
IbraheemOsama Jun 26, 2017
41ea514
Merging for dev
IbraheemOsama Jun 27, 2017
6fde02e
fixing merge conflicts
IbraheemOsama Jun 27, 2017
d931857
Addine menu to readme.md
IbraheemOsama Jun 27, 2017
03c7502
Adding documentations
IbraheemOsama Jun 27, 2017
50ba981
Updating documentations
IbraheemOsama Jun 27, 2017
4a143ae
Removing AccessKey from documentation as it is not working in MenuFly…
IbraheemOsama Jun 27, 2017
57a3d67
Merge remote-tracking branch 'refs/remotes/Microsoft/dev' into Classi…
IbraheemOsama Jun 27, 2017
ab21155
Removing warning
IbraheemOsama Jun 27, 2017
9324573
Renaming SelectedHeaderItem to SelectedMenuItem
IbraheemOsama Jun 27, 2017
5e19294
Removing menu background
IbraheemOsama Jun 27, 2017
9fee708
Merge remote-tracking branch 'refs/remotes/Microsoft/dev' into Classi…
IbraheemOsama Jun 27, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@
<Content Include="SamplePages\MarkdownTextBlock\MarkdownTextBlock.png" />
<Content Include="SamplePages\Loading\Loading.png" />
<Content Include="SamplePages\MasterDetailsView\MasterDetailsView.png" />
<Content Include="SamplePages\Menu\Menu.png" />
<Content Include="SamplePages\Microsoft Graph Service\OfficeLogo.png" />
<Content Include="SamplePages\Microsoft Graph Service\user.png" />
<Content Include="SamplePages\Microsoft Translator Service\TranslatorService.png" />
Expand Down Expand Up @@ -385,6 +386,7 @@
<Content Include="SamplePages\AlignmentGrid\AlignmentGridXaml.bind" />
<Content Include="SamplePages\FocusTracker\FocusTrackerXaml.bind" />
<Content Include="SamplePages\ClipboardHelper\ClipboardHelperCode.bind" />
<Content Include="SamplePages\Menu\Menu.bind" />
</ItemGroup>
<ItemGroup>
<Compile Include="App.xaml.cs">
Expand All @@ -405,6 +407,10 @@
<Compile Include="SamplePages\ClipboardHelper\ClipboardHelperPage.xaml.cs">
<DependentUpon>ClipboardHelperPage.xaml</DependentUpon>
</Compile>
<Compile Include="SamplePages\Menu\Commands\VsCommands.cs" />
<Compile Include="SamplePages\Menu\MenuPage.xaml.cs">
<DependentUpon>MenuPage.xaml</DependentUpon>
</Compile>
<Compile Include="SamplePages\NetworkHelper\NetworkHelperPage.xaml.cs">
<DependentUpon>NetworkHelperPage.xaml</DependentUpon>
</Compile>
Expand Down Expand Up @@ -655,6 +661,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="SamplePages\Menu\MenuPage.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="SamplePages\ViewExtensions\ViewExtensionsPage.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
// ******************************************************************
// Copyright (c) Microsoft. All rights reserved.
// This code is licensed under the MIT License (MIT).
// THE CODE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
// THE CODE OR THE USE OR OTHER DEALINGS IN THE CODE.
// ******************************************************************

using System;
using System.Windows.Input;
using Windows.UI.Popups;

namespace Microsoft.Toolkit.Uwp.SampleApp.Menu.Commands
{
internal class NewProjectCommand : ICommand
{
public bool CanExecute(object parameter)
{
return true;
}

public async void Execute(object parameter)
{
var dialog = new MessageDialog("Create New Project");
await dialog.ShowAsync();
}

public event EventHandler CanExecuteChanged;
}

internal class NewFileCommand : ICommand
{
public bool CanExecute(object parameter)
{
return true;
}

public async void Execute(object parameter)
{
var dialog = new MessageDialog("Create New File");
await dialog.ShowAsync();
}

public event EventHandler CanExecuteChanged;
}

internal class GenericCommand : ICommand
{
public bool CanExecute(object parameter)
{
return true;
}

public async void Execute(object parameter)
{
var dialog = new MessageDialog(parameter.ToString());
await dialog.ShowAsync();
}

public event EventHandler CanExecuteChanged;
}
}
136 changes: 136 additions & 0 deletions Microsoft.Toolkit.Uwp.SampleApp/SamplePages/Menu/Menu.bind
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
<Page x:Class="Microsoft.Toolkit.Uwp.SampleApp.SamplePages.MenuPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:commands="using:Microsoft.Toolkit.Uwp.SampleApp.Menu.Commands"
xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">

<Page.Resources>
<ResourceDictionary>
<commands:NewProjectCommand x:Key="NewProject" />
<commands:NewFileCommand x:Key="NewFile" />
<commands:GenericCommand x:Key="GenericCommand" />
</ResourceDictionary>


</Page.Resources>

<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
</Grid.RowDefinitions>

<controls:Menu AllowTooltip="@[AllowTooltip:Bool:True]"
Orientation="@[Orientation:Enum:Orientation.Horizontal]"
TooltipPlacement="@[TooltipPlacement:Enum:PlacementMode.Bottom]">

<controls:MenuItem controls:Menu.InputGestureText="Alt+F"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of the MenuItems should have keyboard shortcuts.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: Only talking about the main MenuItems, not the subitems

Header="File">
<MenuFlyoutSubItem Text="New">
<MenuFlyoutItem controls:Menu.InputGestureText="Ctrl+Shift+N"
Command="{StaticResource NewProject}"
Text="Project" />
<MenuFlyoutItem controls:Menu.InputGestureText="Ctrl+N"
Command="{StaticResource NewFile}"
Text="File" />
</MenuFlyoutSubItem>
<MenuFlyoutSubItem Text="Open">
<MenuFlyoutItem controls:Menu.InputGestureText="Ctrl+Shift+O"
Command="{StaticResource GenericCommand}"
CommandParameter="Select Project/Solution"
Text="Project/Solution" />
<MenuFlyoutItem controls:Menu.InputGestureText="Ctrl+O"
Command="{StaticResource GenericCommand}"
CommandParameter="Select File"
Text="File" />
</MenuFlyoutSubItem>
<MenuFlyoutSeparator />
<MenuFlyoutItem Text="Page Setup" />
<MenuFlyoutItem controls:Menu.InputGestureText="Ctrl+P"
Command="{StaticResource GenericCommand}"
CommandParameter="Page is Printed!!"
Text="Print" />
<MenuFlyoutSeparator />
<MenuFlyoutSubItem Text="Recent Files">
<MenuFlyoutItem Text="UWP ToolKit GridSplitter" />
<MenuFlyoutItem Text="UWP ToolKit WrapPanel" />
</MenuFlyoutSubItem>
<MenuFlyoutItem controls:Menu.InputGestureText="Ctrl+Shit+E"
Command="{StaticResource GenericCommand}"
CommandParameter="Solution closed"
Text="Exit" />
</controls:MenuItem>


<controls:MenuItem Header="Edit">
<MenuFlyoutSubItem Text="Go To">
<MenuFlyoutItem Text="Go To Line" />
<MenuFlyoutItem Text="Go To All" />
</MenuFlyoutSubItem>

<MenuFlyoutSubItem Text="Find and Replace">
<MenuFlyoutItem Text="Find" />
<MenuFlyoutItem Text="Replace" />
</MenuFlyoutSubItem>
</controls:MenuItem>

<controls:MenuItem Header="View">
<MenuFlyoutSubItem Text="Designer">
<MenuFlyoutItem Text="VS Designer" />
<MenuFlyoutItem Text="Blend" />
</MenuFlyoutSubItem>

<MenuFlyoutSubItem Text="Solution Explorer">
<MenuFlyoutItem Text="Solutions" />
<MenuFlyoutItem Text="Projects" />
</MenuFlyoutSubItem>
</controls:MenuItem>

<controls:MenuItem Header="Project">
<MenuFlyoutSubItem Text="Add Class">
<MenuFlyoutItem Text="Class" />
<MenuFlyoutItem Text="Interface" />
</MenuFlyoutSubItem>

<MenuFlyoutSubItem Text="Add new data source">
<MenuFlyoutItem Text="SQL" />
<MenuFlyoutItem Text="NoSQL" />
</MenuFlyoutSubItem>
</controls:MenuItem>

<controls:MenuItem Header="Build">
<MenuFlyoutItem Text="Build Solution" />
<MenuFlyoutItem Text="Rebuild Solution" />
</controls:MenuItem>

<controls:MenuItem Header="Debug">
<MenuFlyoutSubItem Text="Windows">
<MenuFlyoutItem Text="Windows 8" />
<MenuFlyoutItem Text="Windows 10" />
</MenuFlyoutSubItem>

<MenuFlyoutSubItem Text="Graphics">
<MenuFlyoutItem Text="Canvas" />
<MenuFlyoutItem Text="Grid" />
</MenuFlyoutSubItem>
</controls:MenuItem>

</controls:Menu>

<StackPanel Grid.Row="1">
<TextBlock Text="Click Alt to set focus on Classic Menu" />
<TextBlock Text="To open file menu shortcut: Alt+F" />
<TextBlock Text="Create new project shortcut: Ctrl+Shift+N" />
<TextBlock Text="Create new file shortcut: Ctrl+N" />
<TextBlock Text="Open project shortcut: Ctrl+Shift+O" />
<TextBlock Text="Open file shortcut: Ctrl+O" />
<TextBlock Text="Print shortcut: Ctrl+P" />
<TextBlock Text="Exit solution shortcut: Ctrl+Shit+E" />
</StackPanel>


</Grid>
</Page>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
139 changes: 139 additions & 0 deletions Microsoft.Toolkit.Uwp.SampleApp/SamplePages/Menu/MenuPage.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
<Page x:Class="Microsoft.Toolkit.Uwp.SampleApp.SamplePages.MenuPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:commands="using:Microsoft.Toolkit.Uwp.SampleApp.Menu.Commands"
xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">

<Page.Resources>
<ResourceDictionary>
<commands:NewProjectCommand x:Key="NewProject" />
<commands:NewFileCommand x:Key="NewFile" />
<commands:GenericCommand x:Key="GenericCommand" />
</ResourceDictionary>
</Page.Resources>

<Grid Background="{StaticResource Brush-Grey-05}">
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
</Grid.RowDefinitions>

<controls:Menu AllowTooltip="{Binding AllowTooltip.Value, Mode=TwoWay}"
Orientation="{Binding Orientation.Value, Mode=TwoWay}"
TooltipPlacement="{Binding TooltipPlacement.Value, Mode=TwoWay}">

<controls:MenuItem Name="FileMenu"
controls:Menu.InputGestureText="Alt+F"
Header="File">
<MenuFlyoutSubItem Text="New">
<MenuFlyoutItem controls:Menu.InputGestureText="Ctrl+Shift+N"
Command="{StaticResource NewProject}"
Text="Project" />
<MenuFlyoutItem controls:Menu.InputGestureText="Ctrl+N"
Command="{StaticResource NewFile}"
Text="File" />
</MenuFlyoutSubItem>
<MenuFlyoutSubItem Text="Open">
<MenuFlyoutItem controls:Menu.InputGestureText="Ctrl+Shift+O"
Command="{StaticResource GenericCommand}"
CommandParameter="Select Project/Solution"
Text="Project/Solution" />
<MenuFlyoutItem controls:Menu.InputGestureText="Ctrl+O"
Command="{StaticResource GenericCommand}"
CommandParameter="Select File"
Text="File" />
</MenuFlyoutSubItem>
<MenuFlyoutSeparator />
<MenuFlyoutItem Text="Page Setup" />
<MenuFlyoutItem controls:Menu.InputGestureText="Ctrl+P"
Command="{StaticResource GenericCommand}"
CommandParameter="Page is Printed!!"
Text="Print" />
<MenuFlyoutSeparator />
<MenuFlyoutSubItem Text="Recent Files">
<MenuFlyoutItem Text="UWP ToolKit GridSplitter" />
<MenuFlyoutItem Text="UWP ToolKit WrapPanel" />
</MenuFlyoutSubItem>
<MenuFlyoutItem controls:Menu.InputGestureText="Ctrl+Shift+E"
Command="{StaticResource GenericCommand}"
CommandParameter="Solution closed"
Text="Exit" />
</controls:MenuItem>


<controls:MenuItem controls:Menu.InputGestureText="Alt+E"
Header="Edit">
<MenuFlyoutSubItem Text="Go To">
<MenuFlyoutItem Text="Go To Line" />
<MenuFlyoutItem Text="Go To All" />
</MenuFlyoutSubItem>

<MenuFlyoutSubItem Text="Find and Replace">
<MenuFlyoutItem Text="Find" />
<MenuFlyoutItem Text="Replace" />
</MenuFlyoutSubItem>
</controls:MenuItem>

<controls:MenuItem controls:Menu.InputGestureText="Alt+V"
Header="View">
<MenuFlyoutSubItem Text="Designer">
<MenuFlyoutItem Text="VS Designer" />
<MenuFlyoutItem Text="Blend" />
</MenuFlyoutSubItem>

<MenuFlyoutSubItem Text="Solution Explorer">
<MenuFlyoutItem Text="Solutions" />
<MenuFlyoutItem Text="Projects" />
</MenuFlyoutSubItem>
</controls:MenuItem>

<controls:MenuItem controls:Menu.InputGestureText="Alt+P"
Header="Project">
<MenuFlyoutSubItem Text="Add Class">
<MenuFlyoutItem Text="Class" />
<MenuFlyoutItem Text="Interface" />
</MenuFlyoutSubItem>

<MenuFlyoutSubItem Text="Add new data source">
<MenuFlyoutItem Text="SQL" />
<MenuFlyoutItem Text="NoSQL" />
</MenuFlyoutSubItem>
</controls:MenuItem>

<controls:MenuItem controls:Menu.InputGestureText="Alt+B"
Header="Build">
<MenuFlyoutItem Text="Build Solution" />
<MenuFlyoutItem Text="Rebuild Solution" />
</controls:MenuItem>

<controls:MenuItem controls:Menu.InputGestureText="Alt+D"
Header="Debug">
<MenuFlyoutSubItem Text="Windows">
<MenuFlyoutItem Text="Windows 8" />
<MenuFlyoutItem Text="Windows 10" />
</MenuFlyoutSubItem>

<MenuFlyoutSubItem Text="Graphics">
<MenuFlyoutItem Text="Canvas" />
<MenuFlyoutItem Text="Grid" />
</MenuFlyoutSubItem>
</controls:MenuItem>

</controls:Menu>

<StackPanel Grid.Row="1">
<TextBlock Text="Click Alt to set focus on Classic Menu" />
<TextBlock Text="Any menu shortcut is Alt + (The first character of the menu name), ex to open File menu click Alt+F" />
<TextBlock Text="Create new project shortcut: Ctrl+Shift+N" />
<TextBlock Text="Create new file shortcut: Ctrl+N" />
<TextBlock Text="Open project shortcut: Ctrl+Shift+O" />
<TextBlock Text="Open file shortcut: Ctrl+O" />
<TextBlock Text="Print shortcut: Ctrl+P" />
<TextBlock Text="Exit solution shortcut: Ctrl+Shit+E" />
</StackPanel>

</Grid>
</Page>
Loading