Skip to content

Commit

Permalink
Merge pull request #1318 from Microsoft/1.5.1
Browse files Browse the repository at this point in the history
1.5.1
  • Loading branch information
nmetulev authored Jul 14, 2017
2 parents 21bdfac + ebe04a1 commit e06998e
Show file tree
Hide file tree
Showing 12 changed files with 153 additions and 85 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
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
Binary file removed Microsoft.Toolkit.Uwp.Services/nuget.exe
Binary file not shown.
48 changes: 0 additions & 48 deletions Microsoft.Toolkit.Uwp.UI.Controls/HamburgerMenu/HamburgerMenu.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,54 +2,6 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Microsoft.Toolkit.Uwp.UI.Controls">

<Style TargetType="local:HamburgerMenuGlyphItem">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="local:HamburgerMenuGlyphItem">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="48" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<FontIcon FontFamily="Segoe MDL2 Assets"
FontSize="16"
Foreground="White"
Glyph="{TemplateBinding Glyph}"
Margin="16,12"/>
<TextBlock FontSize="16"
Foreground="White"
Grid.Column="1"
Text="{TemplateBinding Label}"
VerticalAlignment="Center"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>

<Style TargetType="local:HamburgerMenuImageItem">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="local:HamburgerMenuImageItem">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="48" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Image Margin="16,12"
Source="{TemplateBinding Thumbnail}"
Stretch="UniformToFill"/>
<TextBlock FontSize="16"
Foreground="White"
Grid.Column="1"
Text="{TemplateBinding Label}"
VerticalAlignment="Center"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>

<Style x:Key="HambugerMenuItemStyle" TargetType="ListViewItem">
<Setter Property="Foreground" Value="{ThemeResource SystemControlForegroundBaseHighBrush}" />
<Setter Property="Background" Value="Transparent" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,6 @@ public class HamburgerMenuGlyphItem : HamburgerMenuItem
/// </summary>
public static readonly DependencyProperty GlyphProperty = DependencyProperty.Register(nameof(Glyph), typeof(string), typeof(HamburgerMenuItem), new PropertyMetadata(null));

/// <summary>
/// Initializes a new instance of the <see cref="HamburgerMenuGlyphItem"/> class.
/// </summary>
public HamburgerMenuGlyphItem()
{
DefaultStyleKey = typeof(HamburgerMenuGlyphItem);
}

/// <summary>
/// Gets or sets a value that specifies the glyph to use from Segoe MDL2 Assets font.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,6 @@ public class HamburgerMenuImageItem : HamburgerMenuItem
/// </summary>
public static readonly DependencyProperty ThumbnailProperty = DependencyProperty.Register(nameof(Thumbnail), typeof(ImageSource), typeof(HamburgerMenuItem), new PropertyMetadata(null));

/// <summary>
/// Initializes a new instance of the <see cref="HamburgerMenuImageItem"/> class.
/// </summary>
public HamburgerMenuImageItem()
{
DefaultStyleKey = typeof(HamburgerMenuImageItem);
}

/// <summary>
/// Gets or sets a value that specifies a bitmap to display with an Image control.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
/// <summary>
/// The HamburgerMenuItem provides an abstract implementation for HamburgerMenu entries.
/// </summary>
public abstract class HamburgerMenuItem : Control
public abstract class HamburgerMenuItem : DependencyObject
{
/// <summary>
/// Identifies the <see cref="Label"/> dependency property.
Expand All @@ -31,6 +31,11 @@ public abstract class HamburgerMenuItem : Control
/// </summary>
public static readonly DependencyProperty TargetPageTypeProperty = DependencyProperty.Register(nameof(TargetPageType), typeof(Type), typeof(HamburgerMenuItem), new PropertyMetadata(null));

/// <summary>
/// Identifies the <see cref="Tag"/> dependency property.
/// </summary>
public static readonly DependencyProperty TagProperty = DependencyProperty.Register(nameof(Tag), typeof(object), typeof(HamburgerMenuItem), new PropertyMetadata(null));

/// <summary>
/// Gets or sets a value that specifies label to display.
/// </summary>
Expand Down Expand Up @@ -62,5 +67,21 @@ public Type TargetPageType
SetValue(TargetPageTypeProperty, value);
}
}

/// <summary>
/// Gets or sets a value that specifies an user specific value.
/// </summary>
public object Tag
{
get
{
return GetValue(TagProperty);
}

set
{
SetValue(TagProperty, value);
}
}
}
}
Binary file modified build/tools/nuget/NuGet.exe
Binary file not shown.
3 changes: 2 additions & 1 deletion docs/controls/RadialProgressBar.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ The control uses the same dependency properties as the standard Progress Bar, wi
Minimum="0"
Maximum="180"
Thickness="4"
Outline="Red">
Outline="Gray"
Foreground="Red">
</controls:RadialProgressBar>

```
Expand Down
2 changes: 1 addition & 1 deletion docs/helpers/BluetoothLEHelper.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,6 @@ if (BluetoothLEHelper.IsBluetoothLESupported)

## API

* [BluetoothLEHelper source code](https://github.com/Microsoft/UWPCommunityToolkit/blob/master/Microsoft.Toolkit.Uwp/BluetoothLEHelper/)
* [BluetoothLEHelper source code](https://github.com/Microsoft/UWPCommunityToolkit/blob/master/Microsoft.Toolkit.Uwp/Helpers/BluetoothLEHelper/)


1 change: 1 addition & 0 deletions githubresources/content/links.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@

* [Json.Net](http://www.newtonsoft.com/json): Popular high-performance JSON framework
* [Template 10](https://github.com/Windows-XAML/Template10): Visual Studio project templates to help you create an UWP application
* [UI for UWP](https://github.com/telerik/ui-for-uwp): 20+ UI controls for developers building UWP applications

0 comments on commit e06998e

Please sign in to comment.