Skip to content
Merged
Show file tree
Hide file tree
Changes from 39 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,14 @@
<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\Menu\MenuStyles.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;
}
}
167 changes: 167 additions & 0 deletions Microsoft.Toolkit.Uwp.SampleApp/SamplePages/Menu/Menu.bind
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
<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>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="MenuStyles.xaml" />
</ResourceDictionary.MergedDictionaries>

<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 HeaderButtonStyle="{StaticResource MenuHeaderButtonStyle}"
MenuFlyoutStyle="{StaticResource MenuStyle}"
Copy link
Contributor

Choose a reason for hiding this comment

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

I tested removing the MenuFlyoutStyle, and Styles for the MenuFlyoutItem and MenuFlyoutSubItem. I didn't see any issues with styling. Any reason we need to have these?

Copy link
Member Author

Choose a reason for hiding this comment

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

This what happened when I removed the MenyFlyoutStyle and MenuFlyoutItem and Sub styles
image

and this what happens when I removed the MenyFlyoutItem and SubItem styles
issuewithstyle

As you can see the problem is not with the first menuItem generation but with the second

Copy link
Contributor

Choose a reason for hiding this comment

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

You also need to remove the implicit styles from the MenuStyles file. This is what I see:
image

Copy link
Member Author

@IbraheemOsama IbraheemOsama May 19, 2017

Choose a reason for hiding this comment

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

This is the default style for the menu which could be achieved by just adding the control, I wanted to show developers how they can style whatever they want beside I like the black colour more :)

Copy link
Contributor

Choose a reason for hiding this comment

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

Understand, but it also seems like it's needed to get it up and running.

Copy link
Contributor

Choose a reason for hiding this comment

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

Anyone else have thoughts? @nmetulev ?

Copy link

Choose a reason for hiding this comment

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

Do the sub-menu flyouts respect the parent RequestedTheme on the top level Classic Menu control?

Copy link
Contributor

Choose a reason for hiding this comment

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

Agree with @skendrot, if the styles are not necessary to get started, we should not have them in the sample app, it makes the control look much more complicated. If the styles are required, they should be part of the control.

I also see the need for having a way to showcase what is possible with the controls. Not sure if that should be in the sample app, or a sample outside of the app we can link to from the docs. We should probably have a larger discussion on this somewhere else :)

Copy link
Contributor

Choose a reason for hiding this comment

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

Great question @mdtauk. I tested this and the menu flyout does respect the requested theme but the menu itself does not.

Copy link
Contributor

Choose a reason for hiding this comment

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

I removed all styling from the sample and found that there is no indication that a particular menu is open. The MenuItem should have a visual state for when it's open

Orientation="Horizontal">

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


<controls:MenuItem Header="Edit">
<MenuFlyoutSubItem Text="Go To">
<MenuFlyoutItem Style="{StaticResource MenuFlyoutItemStyle}"
Text="Go To Line" />
<MenuFlyoutItem Style="{StaticResource MenuFlyoutItemStyle}"
Text="Go To All" />
</MenuFlyoutSubItem>

<MenuFlyoutSubItem Text="Find and Replace">
<MenuFlyoutItem Style="{StaticResource MenuFlyoutItemStyle}"
Text="Find" />
<MenuFlyoutItem Style="{StaticResource MenuFlyoutItemStyle}"
Text="Replace" />
</MenuFlyoutSubItem>
</controls:MenuItem>

<controls:MenuItem Header="View">
<MenuFlyoutSubItem Text="Designer">
<MenuFlyoutItem Style="{StaticResource MenuFlyoutItemStyle}"
Text="VS Designer" />
<MenuFlyoutItem Style="{StaticResource MenuFlyoutItemStyle}"
Text="Blend" />
</MenuFlyoutSubItem>

<MenuFlyoutSubItem Text="Solution Explorer">
<MenuFlyoutItem Style="{StaticResource MenuFlyoutItemStyle}"
Text="Solutions" />
<MenuFlyoutItem Style="{StaticResource MenuFlyoutItemStyle}"
Text="Projects" />
</MenuFlyoutSubItem>
</controls:MenuItem>

<controls:MenuItem Header="Project">
<MenuFlyoutSubItem Text="Add Class">
<MenuFlyoutItem Style="{StaticResource MenuFlyoutItemStyle}"
Text="Class" />
<MenuFlyoutItem Style="{StaticResource MenuFlyoutItemStyle}"
Text="Interface" />
</MenuFlyoutSubItem>

<MenuFlyoutSubItem Text="Add new data source">
<MenuFlyoutItem Style="{StaticResource MenuFlyoutItemStyle}"
Text="SQL" />
<MenuFlyoutItem Style="{StaticResource MenuFlyoutItemStyle}"
Text="NoSQL" />
</MenuFlyoutSubItem>
</controls:MenuItem>

<controls:MenuItem Header="Build">
<MenuFlyoutItem Style="{StaticResource MenuFlyoutItemStyle}"
Text="Build Solution" />
<MenuFlyoutItem Style="{StaticResource MenuFlyoutItemStyle}"
Text="Rebuild Solution" />
</controls:MenuItem>

<controls:MenuItem Header="Debug">
<MenuFlyoutSubItem Text="Windows">
<MenuFlyoutItem Style="{StaticResource MenuFlyoutItemStyle}"
Text="Windows 8" />
<MenuFlyoutItem Style="{StaticResource MenuFlyoutItemStyle}"
Text="Windows 10" />
</MenuFlyoutSubItem>

<MenuFlyoutSubItem Text="Graphics">
<MenuFlyoutItem Style="{StaticResource MenuFlyoutItemStyle}"
Text="Canvas" />
<MenuFlyoutItem Style="{StaticResource MenuFlyoutItemStyle}"
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.
Loading