Skip to content

Commit

Permalink
Merge pull request #1323 from Microsoft/dev
Browse files Browse the repository at this point in the history
1.5.1
  • Loading branch information
nmetulev authored Jul 17, 2017
2 parents 367cd72 + e06998e commit ae3a3d9
Show file tree
Hide file tree
Showing 15 changed files with 222 additions and 244 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,47 @@
xmlns:data="using:Microsoft.Toolkit.Uwp.SampleApp.Data"
mc:Ignorable="d">

<Page.Resources>
<DataTemplate x:Key="HamburgerMenuItem" x:DataType="controls:HamburgerMenuGlyphItem">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="48" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<FontIcon Grid.Column="0"
FontSize="16"
FontFamily="Segoe MDL2 Assets"
Glyph="{Binding Glyph}"
Foreground="White" />
<TextBlock Grid.Column="1"
Text="{x:Bind Label}"
Foreground="White"
FontSize="16"
VerticalAlignment="Center" />
</Grid>
</DataTemplate>

<DataTemplate x:Key="HamburgerMenuImageItem" x:DataType="controls:HamburgerMenuImageItem">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="48" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Image Source="{Binding Thumbnail}" Stretch="UniformToFill" Margin="16,12" />
<TextBlock Grid.Column="1"
Text="{x:Bind Label}"
Foreground="White"
FontSize="16"
VerticalAlignment="Center" />
</Grid>
</DataTemplate>
</Page.Resources>

<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" Margin="50" BorderThickness="1" BorderBrush="Black">
<controls:HamburgerMenu PaneBackground="@[PaneBackground:Brush:Black]" x:Name="HamburgerMenu"
Foreground="White"
ItemTemplate="{StaticResource HamburgerMenuImageItem}"
OptionsItemTemplate="{StaticResource HamburgerMenuItem}"
ItemClick="HamburgerMenu_OnItemClick"
OptionsItemClick="HamburgerMenu_OnOptionsItemClick"
OpenPaneLength="@[OpenPaneLength:Slider:240:50-400]"
Expand All @@ -22,14 +60,14 @@
<!-- Items -->
<controls:HamburgerMenu.ItemsSource>
<controls:HamburgerMenuItemCollection>
<controls:HamburgerMenuImageItem Thumbnail="ms-appx:///Assets/Photos/BigFourSummerHeat.jpg"
Label="Big four summer heat" />
<controls:HamburgerMenuImageItem Thumbnail="ms-appx:///Assets/Photos/BisonBadlandsChillin.jpg"
Label="Bison badlands Chillin" />
<controls:HamburgerMenuImageItem Thumbnail="ms-appx:///Assets/Photos/GiantSlabInOregon.jpg"
Label="Giant slab in Oregon" />
<controls:HamburgerMenuImageItem Thumbnail="ms-appx:///Assets/Photos/LakeAnnMushroom.jpg"
Label="Lake Ann Mushroom" />
<controls:HamburgerMenuImageItem Label="Big four summer heat"
Thumbnail="/Assets/Photos/BigFourSummerHeat.jpg"/>
<controls:HamburgerMenuImageItem Label="Bison badlands Chillin"
Thumbnail="/Assets/Photos/BisonBadlandsChillin.jpg"/>
<controls:HamburgerMenuImageItem Label="Giant slab in Oregon"
Thumbnail="/Assets/Photos/GiantSlabInOregon.jpg"/>
<controls:HamburgerMenuImageItem Label="Lake Ann Mushroom"
Thumbnail="/Assets/Photos/LakeAnnMushroom.jpg"/>
</controls:HamburgerMenuItemCollection>
</controls:HamburgerMenu.ItemsSource>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,47 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">

<Page.Resources>
<DataTemplate x:Key="HamburgerMenuItem"
x:DataType="controls:HamburgerMenuGlyphItem">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="48" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<FontIcon Grid.Column="0"
FontFamily="Segoe MDL2 Assets"
FontSize="16"
Foreground="White"
Glyph="{Binding Glyph}" />
<TextBlock Grid.Column="1"
VerticalAlignment="Center"
FontSize="16"
Foreground="White"
Text="{x:Bind Label}" />
</Grid>
</DataTemplate>

<DataTemplate x:Key="HamburgerMenuImageItem"
x:DataType="controls:HamburgerMenuImageItem">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="48" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Image Margin="16,12"
Source="{Binding Thumbnail}"
Stretch="UniformToFill" />
<TextBlock Grid.Column="1"
VerticalAlignment="Center"
FontSize="16"
Foreground="White"
Text="{x:Bind Label}" />
</Grid>
</DataTemplate>
</Page.Resources>

<Grid Padding="50"
Background="{StaticResource Brush-Grey-05}">
<controls:HamburgerMenu x:Name="HamburgerMenuControl"
Expand All @@ -16,20 +57,22 @@
HamburgerWidth="48"
IsPaneOpen="{Binding IsPaneOpen.Value, Mode=TwoWay}"
ItemClick="HamburgerMenu_OnItemClick"
ItemTemplate="{StaticResource HamburgerMenuImageItem}"
OpenPaneLength="{Binding OpenPaneLength.Value}"
OptionsItemClick="HamburgerMenu_OnOptionsItemClick"
OptionsItemTemplate="{StaticResource HamburgerMenuItem}"
PaneBackground="{Binding PaneBackground.Value}">
<!-- Items -->
<controls:HamburgerMenu.ItemsSource>
<controls:HamburgerMenuItemCollection>
<controls:HamburgerMenuImageItem Thumbnail="ms-appx:///Assets/Photos/BigFourSummerHeat.jpg"
Label="Big four summer heat" />
<controls:HamburgerMenuImageItem Thumbnail="ms-appx:///Assets/Photos/BisonBadlandsChillin.jpg"
Label="Bison badlands Chillin" />
<controls:HamburgerMenuImageItem Thumbnail="ms-appx:///Assets/Photos/GiantSlabInOregon.jpg"
Label="Giant slab in Oregon" />
<controls:HamburgerMenuImageItem Thumbnail="ms-appx:///Assets/Photos/LakeAnnMushroom.jpg"
Label="Lake Ann Mushroom" />
<controls:HamburgerMenuImageItem Label="Big four summer heat"
Thumbnail="ms-appx:///Assets/Photos/BigFourSummerHeat.jpg" />
<controls:HamburgerMenuImageItem Label="Bison badlands Chillin"
Thumbnail="ms-appx:///Assets/Photos/BisonBadlandsChillin.jpg" />
<controls:HamburgerMenuImageItem Label="Giant slab in Oregon"
Thumbnail="ms-appx:///Assets/Photos/GiantSlabInOregon.jpg" />
<controls:HamburgerMenuImageItem Label="Lake Ann Mushroom"
Thumbnail="ms-appx:///Assets/Photos/LakeAnnMushroom.jpg" />
</controls:HamburgerMenuItemCollection>
</controls:HamburgerMenu.ItemsSource>

Expand Down
9 changes: 7 additions & 2 deletions Microsoft.Toolkit.Uwp.SampleApp/SamplePages/Menu/Menu.bind
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,13 @@
Orientation="@[Orientation:Enum:Orientation.Horizontal]"
TooltipPlacement="@[TooltipPlacement:Enum:PlacementMode.Bottom]">

<controls:MenuItem controls:Menu.InputGestureText="Alt+F"
Header="File">
<controls:MenuItem controls:Menu.InputGestureText="Alt+F">
<controls:MenuItem.Header>
<StackPanel Orientation="Horizontal">
<SymbolIcon Symbol="Document" />
<TextBlock Text="File" Margin="5,0,0,0" />
</StackPanel>
</controls:MenuItem.Header>
<MenuFlyoutSubItem Text="New">
<MenuFlyoutItem controls:Menu.InputGestureText="Ctrl+Shift+N"
Command="{StaticResource NewProject}"
Expand Down
146 changes: 8 additions & 138 deletions Microsoft.Toolkit.Uwp.SampleApp/SamplePages/Menu/MenuPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,14 @@
TooltipPlacement="{Binding TooltipPlacement.Value, Mode=TwoWay}">

<controls:MenuItem Name="FileMenu"
controls:Menu.InputGestureText="Alt+F"
Header="File">
controls:Menu.InputGestureText="Alt+F">
<controls:MenuItem.Header>
<StackPanel Orientation="Horizontal">
<SymbolIcon Symbol="Document" />
<TextBlock Text="File" Margin="5,0,0,0" />
</StackPanel>
</controls:MenuItem.Header>

<MenuFlyoutSubItem Text="New">
<MenuFlyoutItem controls:Menu.InputGestureText="Ctrl+Shift+N"
Command="{StaticResource NewProject}"
Expand Down Expand Up @@ -121,142 +127,6 @@
<MenuFlyoutItem Text="Grid" />
</MenuFlyoutSubItem>
</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: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: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: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: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: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: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: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: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: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: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:MenuItem Header="Debug">

</controls:MenuItem>

</controls:Menu>

<StackPanel Grid.Row="1">
Expand Down
32 changes: 30 additions & 2 deletions Microsoft.Toolkit.Uwp.SampleApp/Shell.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,40 @@
<Page.Resources>
<DataTemplate x:Key="ButtonTemplate"
x:DataType="local:SampleCategory">
<controls:HamburgerMenuImageItem Thumbnail="{x:Bind Icon}" Label="{x:Bind Name}"/>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="48" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Image Margin="16,12"
Source="{x:Bind Icon}"
Stretch="Uniform" />
<TextBlock Grid.Column="1"
VerticalAlignment="Center"
FontSize="16"
Foreground="White"
Text="{x:Bind Name}" />
</Grid>
</DataTemplate>

<DataTemplate x:Key="OptionTemplate"
x:DataType="local:Option">
<controls:HamburgerMenuGlyphItem Glyph="{x:Bind Glyph}" Label="{x:Bind Name}"/>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="48" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<FontIcon Grid.Column="0"
FontFamily="Segoe MDL2 Assets"
FontSize="16"
Foreground="White"
Glyph="{x:Bind Glyph}" />
<TextBlock Grid.Column="1"
VerticalAlignment="Center"
FontSize="16"
Foreground="White"
Text="{x:Bind Name}" />
</Grid>
</DataTemplate>

</Page.Resources>
Expand Down
Loading

0 comments on commit ae3a3d9

Please sign in to comment.