-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Classic menu #1086
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Classic menu #1086
Changes from 11 commits
856ccb9
2388c94
b1d7520
b8fd598
0f0dd32
61acc21
aea3bb5
43e96a1
1d43869
091faaf
ecd0544
201644f
11e95c0
39a7b2b
0e6637d
d6be89d
4cc9d0e
3693abf
dcfef83
a20c4de
8055fa1
3bef24d
e5fad33
e4ba89e
d246391
008a4ba
b9f1294
dc12a3f
fc4adcd
a2b3bc4
0a0624e
1fe90f1
14c432b
a78f90e
caedbe7
99bffdc
a5f01a6
4253f83
fc93320
203098c
ab129cf
bfe9695
91c6c32
3587d7c
c0dc082
23283b7
ec9afa4
c854baf
1c39eab
50faf2f
ae51858
33f8bfb
86d261e
015747a
184731f
da18bf4
b529aa9
eafdcde
fa79558
f2877f0
41ea514
6fde02e
d931857
03c7502
50ba981
4a143ae
57a3d67
ab21155
9324573
5e19294
9fee708
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,123 @@ | ||
| <Page | ||
| x:Class="Microsoft.Toolkit.Uwp.SampleApp.SamplePages.ColumnResizer.ColumnResizerPage" | ||
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
| xmlns:local="using:Microsoft.Toolkit.Uwp.SampleApp.SamplePages.ColumnResizer" | ||
| xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
| xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
| xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls" | ||
| mc:Ignorable="d"> | ||
|
|
||
| <Grid Background="{StaticResource Brush-Grey-05}" Padding="48"> | ||
| <Grid.RowDefinitions> | ||
| <RowDefinition MinHeight="100"></RowDefinition> | ||
| <RowDefinition Height="11"></RowDefinition> | ||
| <RowDefinition></RowDefinition> | ||
| </Grid.RowDefinitions> | ||
| <Grid.ColumnDefinitions> | ||
| <ColumnDefinition></ColumnDefinition> | ||
| <ColumnDefinition></ColumnDefinition> | ||
| <ColumnDefinition></ColumnDefinition> | ||
| </Grid.ColumnDefinitions> | ||
|
|
||
| <Rectangle Grid.Column="0" | ||
| Grid.Row="0" | ||
| Fill="{StaticResource Brush-White}" | ||
| Stroke="{StaticResource Brush-Grey-04}" | ||
| StrokeThickness="1"/> | ||
| <Rectangle Grid.Column="1" | ||
| Grid.Row="0" | ||
| Fill="{StaticResource Brush-White}" | ||
| Stroke="{StaticResource Brush-Grey-04}" | ||
| StrokeThickness="1"/> | ||
| <Rectangle Grid.Column="2" | ||
| Grid.Row="0" | ||
| Fill="{StaticResource Brush-White}" | ||
| Stroke="{StaticResource Brush-Grey-04}" | ||
| StrokeThickness="1"/> | ||
| <Rectangle Grid.Column="0" | ||
| Grid.Row="2" | ||
| Fill="{StaticResource Brush-White}" | ||
| Stroke="{StaticResource Brush-Grey-04}" | ||
| StrokeThickness="1"/> | ||
| <Rectangle Grid.Column="1" | ||
| Grid.Row="2" | ||
| Fill="{StaticResource Brush-White}" | ||
| Stroke="{StaticResource Brush-Grey-04}" | ||
| StrokeThickness="1"/> | ||
| <Rectangle Grid.Column="2" | ||
| Grid.Row="2" | ||
| Fill="{StaticResource Brush-White}" | ||
| Stroke="{StaticResource Brush-Grey-04}" | ||
| StrokeThickness="1"/> | ||
|
|
||
| <TextBlock Grid.Column="0" | ||
| TextWrapping="Wrap" | ||
| Margin="12,12"> | ||
| This text to simulate the resizing feature of the Grid Splitter Control, try to move the splitter to see the effect RowDefinition MinHeight="100" | ||
| </TextBlock> | ||
| <TextBlock Grid.Column="1" | ||
| Grid.Row="0" | ||
| TextWrapping="Wrap" | ||
| Margin="12,12"> | ||
| This text to simulate the resizing feature of the Grid Splitter Control, try to move the splitter to see the effect | ||
| </TextBlock> | ||
| <TextBlock Grid.Column="2" | ||
| Grid.Row="0" | ||
| TextWrapping="Wrap" | ||
| Margin="12,12"> | ||
| This text to simulate the resizing feature of the Grid Splitter Control, try to move the splitter to see the effect | ||
| </TextBlock> | ||
|
|
||
| <TextBlock Grid.Column="0" | ||
| Grid.Row="2" | ||
| TextWrapping="Wrap" | ||
| Margin="12,12"> | ||
| This text to simulate the resizing feature of the Grid Splitter Control, try to move the splitter to see the effect | ||
| </TextBlock> | ||
| <TextBlock Grid.Column="1" | ||
| Grid.Row="2" | ||
| TextWrapping="Wrap" | ||
| Margin="12,12"> | ||
| This text to simulate the resizing feature of the Grid Splitter Control, try to move the splitter to see the effect | ||
| </TextBlock> | ||
| <TextBlock Grid.Column="2" | ||
| Grid.Row="2" | ||
| TextWrapping="Wrap" | ||
| Margin="12,12"> | ||
| This text to simulate the resizing feature of the Grid Splitter Control, try to move the splitter to see the effect | ||
| </TextBlock> | ||
|
|
||
| <!--Column Grid Splitter--> | ||
| <controls:GridSplitter | ||
| Width="11" | ||
| Background="{StaticResource Brush-Grey-04}" | ||
| GripperCursor="@[GripperCursor:Enum:GripperCursorType.Default]" | ||
| HorizontalAlignment="@[HorizontalAlignment:Enum:HorizontalAlignment.Left]" | ||
| Grid.Column="@[Column:Slider:1:0-2]" | ||
| ResizeDirection="@[ResizeDirection:Enum:GridResizeDirection.Auto]" | ||
| ResizeBehavior="@[ResizeBehavior:Enum:GridResizeBehavior.BasedOnAlignment]" | ||
| CursorBehavior="@[CursorBehavior:Enum:SplitterCursorBehavior.ChangeOnSplitterHover]" | ||
| GripperForeground="White"> | ||
| </controls:GridSplitter> | ||
|
|
||
| <!--Row Grid Splitter--> | ||
| <controls:GridSplitter | ||
| Grid.Row="1" | ||
| Background="{StaticResource Brush-Grey-04}" Height="11" | ||
| HorizontalAlignment="Stretch"> | ||
| <controls:GridSplitter.Element> | ||
| <Grid> | ||
| <TextBlock HorizontalAlignment="Center" | ||
| IsHitTestVisible="False" | ||
| VerticalAlignment="Center" | ||
| Text="" | ||
| Foreground="White" | ||
| FontFamily="Segoe MDL2 Assets"> | ||
| </TextBlock> | ||
| </Grid> | ||
| </controls:GridSplitter.Element> | ||
| </controls:GridSplitter> | ||
|
|
||
| </Grid> | ||
| </Page> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| <Page x:Class="Microsoft.Toolkit.Uwp.SampleApp.SamplePages.ClassicMenuPage" | ||
| 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.ClassicMenu.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"> | ||
|
|
||
| <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> | ||
| <Grid.Resources> | ||
| <commands:NewProjectCommand x:Key="NewProject" /> | ||
| <commands:NewFileCommand x:Key="NewFile" /> | ||
| <commands:GenericCommand x:Key="GenericCommand" /> | ||
| </Grid.Resources> | ||
|
|
||
| <Grid.RowDefinitions> | ||
| <RowDefinition Height="1*" /> | ||
|
||
| <RowDefinition Height="3*" /> | ||
| </Grid.RowDefinitions> | ||
|
|
||
|
|
||
| <controls:ClassicMenu Orientation="Horizontal"> | ||
| <controls:ClassicMenuItem Header="File"> | ||
| <MenuFlyoutSubItem Text="New"> | ||
| <MenuFlyoutItem controls:ClassicMenu.InputGestureText="Ctrl+Shift+N" | ||
| Command="{StaticResource NewProject}" | ||
| Text="Project" /> | ||
| <MenuFlyoutItem controls:ClassicMenu.InputGestureText="Ctrl+N" | ||
| Command="{StaticResource NewFile}" | ||
| Text="File" /> | ||
| </MenuFlyoutSubItem> | ||
| <MenuFlyoutSubItem Text="Open"> | ||
| <MenuFlyoutItem controls:ClassicMenu.InputGestureText="Ctrl+Shift+O" | ||
| Command="{StaticResource GenericCommand}" | ||
| CommandParameter="Select Project/Solution" | ||
| Text="Project/Solution" /> | ||
| <MenuFlyoutItem controls:ClassicMenu.InputGestureText="Ctrl+O" | ||
| Command="{StaticResource GenericCommand}" | ||
| CommandParameter="Select File" | ||
| Text="File" /> | ||
| </MenuFlyoutSubItem> | ||
| <MenuFlyoutSeparator /> | ||
| <MenuFlyoutItem Text="Page Setup" /> | ||
| <MenuFlyoutItem controls:ClassicMenu.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:ClassicMenu.InputGestureText="Ctrl+Shit+E" | ||
| Command="{StaticResource GenericCommand}" | ||
| CommandParameter="Solution closed" | ||
| Text="Exit" /> | ||
| </controls:ClassicMenuItem> | ||
|
|
||
|
|
||
| <controls:ClassicMenuItem Header="Edit"> | ||
| <MenuFlyoutSubItem Text="Go To"> | ||
| <MenuFlyoutItem Text="Go To Line" /> | ||
| <MenuFlyoutItem Text="Go To All" /> | ||
| </MenuFlyoutSubItem> | ||
| </controls:ClassicMenuItem> | ||
|
|
||
| <controls:ClassicMenuItem Header="View" /> | ||
|
||
|
|
||
| <controls:ClassicMenuItem Header="Project" /> | ||
|
|
||
| <controls:ClassicMenuItem Header="Build" /> | ||
|
|
||
| <controls:ClassicMenuItem Header="Debug" /> | ||
|
|
||
| </controls:ClassicMenu> | ||
|
|
||
|
|
||
| <StackPanel Grid.Row="1"> | ||
| <TextBlock Text="Click Alt to set focus on Classic Menu" /> | ||
| <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> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| // ****************************************************************** | ||
| // 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 Windows.UI.Xaml.Controls; | ||
|
|
||
| namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages | ||
| { | ||
| public sealed partial class ClassicMenuPage : Page | ||
| { | ||
| public ClassicMenuPage() | ||
| { | ||
| InitializeComponent(); | ||
| } | ||
| } | ||
| } |
| 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.ClassicMenu.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; | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,7 @@ | |
| "Name": "Controls", | ||
| "Icon": "Icons/Foundation.png", | ||
| "Samples": [ | ||
| { | ||
| { | ||
| "Name": "Carousel", | ||
| "Type": "CarouselPage", | ||
| "About": "Presents items in a carousel control. It reacts to changes in the layout as well as the content so it can adapt to different form factors automatically.", | ||
|
|
@@ -212,6 +212,15 @@ | |
| "XamlCodeFile": "TextBoxRegex.bind", | ||
| "Icon": "/SamplePages/TextBoxRegex/TextBoxRegex.png", | ||
| "DocumentationUrl": "https://raw.githubusercontent.com/Microsoft/UWPCommunityToolkit/dev/docs/controls/TextBoxRegex.md" | ||
| }, | ||
| { | ||
| "Name": "ClassicMenu", | ||
| "Type": "ClassicMenuPage", | ||
| "About": "", | ||
|
||
| "CodeUrl": "https://github.com/Microsoft/UWPCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Controls/TextBoxRegex", | ||
| "XamlCodeFile": "ClassicMenu.bind", | ||
| "Icon": "/SamplePages/ClassicMenu/ClassicMenu.png", | ||
| "DocumentationUrl": "https://raw.githubusercontent.com/Microsoft/UWPCommunityToolkit/dev/docs/controls/TextBoxRegex.md" | ||
| } | ||
| ] | ||
| }, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorrect xaml in this file