Skip to content

Commit e06998e

Browse files
authored
Merge pull request #1318 from Microsoft/1.5.1
1.5.1
2 parents 21bdfac + ebe04a1 commit e06998e

File tree

12 files changed

+153
-85
lines changed

12 files changed

+153
-85
lines changed

Microsoft.Toolkit.Uwp.SampleApp/SamplePages/HamburgerMenu/HamburgerMenuCode.bind

Lines changed: 46 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,47 @@
88
xmlns:data="using:Microsoft.Toolkit.Uwp.SampleApp.Data"
99
mc:Ignorable="d">
1010

11+
<Page.Resources>
12+
<DataTemplate x:Key="HamburgerMenuItem" x:DataType="controls:HamburgerMenuGlyphItem">
13+
<Grid>
14+
<Grid.ColumnDefinitions>
15+
<ColumnDefinition Width="48" />
16+
<ColumnDefinition />
17+
</Grid.ColumnDefinitions>
18+
<FontIcon Grid.Column="0"
19+
FontSize="16"
20+
FontFamily="Segoe MDL2 Assets"
21+
Glyph="{Binding Glyph}"
22+
Foreground="White" />
23+
<TextBlock Grid.Column="1"
24+
Text="{x:Bind Label}"
25+
Foreground="White"
26+
FontSize="16"
27+
VerticalAlignment="Center" />
28+
</Grid>
29+
</DataTemplate>
30+
31+
<DataTemplate x:Key="HamburgerMenuImageItem" x:DataType="controls:HamburgerMenuImageItem">
32+
<Grid>
33+
<Grid.ColumnDefinitions>
34+
<ColumnDefinition Width="48" />
35+
<ColumnDefinition />
36+
</Grid.ColumnDefinitions>
37+
<Image Source="{Binding Thumbnail}" Stretch="UniformToFill" Margin="16,12" />
38+
<TextBlock Grid.Column="1"
39+
Text="{x:Bind Label}"
40+
Foreground="White"
41+
FontSize="16"
42+
VerticalAlignment="Center" />
43+
</Grid>
44+
</DataTemplate>
45+
</Page.Resources>
46+
1147
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" Margin="50" BorderThickness="1" BorderBrush="Black">
1248
<controls:HamburgerMenu PaneBackground="@[PaneBackground:Brush:Black]" x:Name="HamburgerMenu"
1349
Foreground="White"
50+
ItemTemplate="{StaticResource HamburgerMenuImageItem}"
51+
OptionsItemTemplate="{StaticResource HamburgerMenuItem}"
1452
ItemClick="HamburgerMenu_OnItemClick"
1553
OptionsItemClick="HamburgerMenu_OnOptionsItemClick"
1654
OpenPaneLength="@[OpenPaneLength:Slider:240:50-400]"
@@ -22,14 +60,14 @@
2260
<!-- Items -->
2361
<controls:HamburgerMenu.ItemsSource>
2462
<controls:HamburgerMenuItemCollection>
25-
<controls:HamburgerMenuImageItem Thumbnail="ms-appx:///Assets/Photos/BigFourSummerHeat.jpg"
26-
Label="Big four summer heat" />
27-
<controls:HamburgerMenuImageItem Thumbnail="ms-appx:///Assets/Photos/BisonBadlandsChillin.jpg"
28-
Label="Bison badlands Chillin" />
29-
<controls:HamburgerMenuImageItem Thumbnail="ms-appx:///Assets/Photos/GiantSlabInOregon.jpg"
30-
Label="Giant slab in Oregon" />
31-
<controls:HamburgerMenuImageItem Thumbnail="ms-appx:///Assets/Photos/LakeAnnMushroom.jpg"
32-
Label="Lake Ann Mushroom" />
63+
<controls:HamburgerMenuImageItem Label="Big four summer heat"
64+
Thumbnail="/Assets/Photos/BigFourSummerHeat.jpg"/>
65+
<controls:HamburgerMenuImageItem Label="Bison badlands Chillin"
66+
Thumbnail="/Assets/Photos/BisonBadlandsChillin.jpg"/>
67+
<controls:HamburgerMenuImageItem Label="Giant slab in Oregon"
68+
Thumbnail="/Assets/Photos/GiantSlabInOregon.jpg"/>
69+
<controls:HamburgerMenuImageItem Label="Lake Ann Mushroom"
70+
Thumbnail="/Assets/Photos/LakeAnnMushroom.jpg"/>
3371
</controls:HamburgerMenuItemCollection>
3472
</controls:HamburgerMenu.ItemsSource>
3573

Microsoft.Toolkit.Uwp.SampleApp/SamplePages/HamburgerMenu/HamburgerMenuPage.xaml

Lines changed: 51 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,47 @@
55
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
66
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
77
mc:Ignorable="d">
8+
9+
<Page.Resources>
10+
<DataTemplate x:Key="HamburgerMenuItem"
11+
x:DataType="controls:HamburgerMenuGlyphItem">
12+
<Grid>
13+
<Grid.ColumnDefinitions>
14+
<ColumnDefinition Width="48" />
15+
<ColumnDefinition />
16+
</Grid.ColumnDefinitions>
17+
<FontIcon Grid.Column="0"
18+
FontFamily="Segoe MDL2 Assets"
19+
FontSize="16"
20+
Foreground="White"
21+
Glyph="{Binding Glyph}" />
22+
<TextBlock Grid.Column="1"
23+
VerticalAlignment="Center"
24+
FontSize="16"
25+
Foreground="White"
26+
Text="{x:Bind Label}" />
27+
</Grid>
28+
</DataTemplate>
29+
30+
<DataTemplate x:Key="HamburgerMenuImageItem"
31+
x:DataType="controls:HamburgerMenuImageItem">
32+
<Grid>
33+
<Grid.ColumnDefinitions>
34+
<ColumnDefinition Width="48" />
35+
<ColumnDefinition />
36+
</Grid.ColumnDefinitions>
37+
<Image Margin="16,12"
38+
Source="{Binding Thumbnail}"
39+
Stretch="UniformToFill" />
40+
<TextBlock Grid.Column="1"
41+
VerticalAlignment="Center"
42+
FontSize="16"
43+
Foreground="White"
44+
Text="{x:Bind Label}" />
45+
</Grid>
46+
</DataTemplate>
47+
</Page.Resources>
48+
849
<Grid Padding="50"
950
Background="{StaticResource Brush-Grey-05}">
1051
<controls:HamburgerMenu x:Name="HamburgerMenuControl"
@@ -16,20 +57,22 @@
1657
HamburgerWidth="48"
1758
IsPaneOpen="{Binding IsPaneOpen.Value, Mode=TwoWay}"
1859
ItemClick="HamburgerMenu_OnItemClick"
60+
ItemTemplate="{StaticResource HamburgerMenuImageItem}"
1961
OpenPaneLength="{Binding OpenPaneLength.Value}"
2062
OptionsItemClick="HamburgerMenu_OnOptionsItemClick"
63+
OptionsItemTemplate="{StaticResource HamburgerMenuItem}"
2164
PaneBackground="{Binding PaneBackground.Value}">
2265
<!-- Items -->
2366
<controls:HamburgerMenu.ItemsSource>
2467
<controls:HamburgerMenuItemCollection>
25-
<controls:HamburgerMenuImageItem Thumbnail="ms-appx:///Assets/Photos/BigFourSummerHeat.jpg"
26-
Label="Big four summer heat" />
27-
<controls:HamburgerMenuImageItem Thumbnail="ms-appx:///Assets/Photos/BisonBadlandsChillin.jpg"
28-
Label="Bison badlands Chillin" />
29-
<controls:HamburgerMenuImageItem Thumbnail="ms-appx:///Assets/Photos/GiantSlabInOregon.jpg"
30-
Label="Giant slab in Oregon" />
31-
<controls:HamburgerMenuImageItem Thumbnail="ms-appx:///Assets/Photos/LakeAnnMushroom.jpg"
32-
Label="Lake Ann Mushroom" />
68+
<controls:HamburgerMenuImageItem Label="Big four summer heat"
69+
Thumbnail="ms-appx:///Assets/Photos/BigFourSummerHeat.jpg" />
70+
<controls:HamburgerMenuImageItem Label="Bison badlands Chillin"
71+
Thumbnail="ms-appx:///Assets/Photos/BisonBadlandsChillin.jpg" />
72+
<controls:HamburgerMenuImageItem Label="Giant slab in Oregon"
73+
Thumbnail="ms-appx:///Assets/Photos/GiantSlabInOregon.jpg" />
74+
<controls:HamburgerMenuImageItem Label="Lake Ann Mushroom"
75+
Thumbnail="ms-appx:///Assets/Photos/LakeAnnMushroom.jpg" />
3376
</controls:HamburgerMenuItemCollection>
3477
</controls:HamburgerMenu.ItemsSource>
3578

Microsoft.Toolkit.Uwp.SampleApp/Shell.xaml

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,40 @@
1919
<Page.Resources>
2020
<DataTemplate x:Key="ButtonTemplate"
2121
x:DataType="local:SampleCategory">
22-
<controls:HamburgerMenuImageItem Thumbnail="{x:Bind Icon}" Label="{x:Bind Name}"/>
22+
<Grid>
23+
<Grid.ColumnDefinitions>
24+
<ColumnDefinition Width="48" />
25+
<ColumnDefinition />
26+
</Grid.ColumnDefinitions>
27+
<Image Margin="16,12"
28+
Source="{x:Bind Icon}"
29+
Stretch="Uniform" />
30+
<TextBlock Grid.Column="1"
31+
VerticalAlignment="Center"
32+
FontSize="16"
33+
Foreground="White"
34+
Text="{x:Bind Name}" />
35+
</Grid>
2336
</DataTemplate>
2437

2538
<DataTemplate x:Key="OptionTemplate"
2639
x:DataType="local:Option">
27-
<controls:HamburgerMenuGlyphItem Glyph="{x:Bind Glyph}" Label="{x:Bind Name}"/>
40+
<Grid>
41+
<Grid.ColumnDefinitions>
42+
<ColumnDefinition Width="48" />
43+
<ColumnDefinition />
44+
</Grid.ColumnDefinitions>
45+
<FontIcon Grid.Column="0"
46+
FontFamily="Segoe MDL2 Assets"
47+
FontSize="16"
48+
Foreground="White"
49+
Glyph="{x:Bind Glyph}" />
50+
<TextBlock Grid.Column="1"
51+
VerticalAlignment="Center"
52+
FontSize="16"
53+
Foreground="White"
54+
Text="{x:Bind Name}" />
55+
</Grid>
2856
</DataTemplate>
2957

3058
</Page.Resources>
-3.77 MB
Binary file not shown.

Microsoft.Toolkit.Uwp.UI.Controls/HamburgerMenu/HamburgerMenu.xaml

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -2,54 +2,6 @@
22
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
33
xmlns:local="using:Microsoft.Toolkit.Uwp.UI.Controls">
44

5-
<Style TargetType="local:HamburgerMenuGlyphItem">
6-
<Setter Property="Template">
7-
<Setter.Value>
8-
<ControlTemplate TargetType="local:HamburgerMenuGlyphItem">
9-
<Grid>
10-
<Grid.ColumnDefinitions>
11-
<ColumnDefinition Width="48" />
12-
<ColumnDefinition />
13-
</Grid.ColumnDefinitions>
14-
<FontIcon FontFamily="Segoe MDL2 Assets"
15-
FontSize="16"
16-
Foreground="White"
17-
Glyph="{TemplateBinding Glyph}"
18-
Margin="16,12"/>
19-
<TextBlock FontSize="16"
20-
Foreground="White"
21-
Grid.Column="1"
22-
Text="{TemplateBinding Label}"
23-
VerticalAlignment="Center"/>
24-
</Grid>
25-
</ControlTemplate>
26-
</Setter.Value>
27-
</Setter>
28-
</Style>
29-
30-
<Style TargetType="local:HamburgerMenuImageItem">
31-
<Setter Property="Template">
32-
<Setter.Value>
33-
<ControlTemplate TargetType="local:HamburgerMenuImageItem">
34-
<Grid>
35-
<Grid.ColumnDefinitions>
36-
<ColumnDefinition Width="48" />
37-
<ColumnDefinition />
38-
</Grid.ColumnDefinitions>
39-
<Image Margin="16,12"
40-
Source="{TemplateBinding Thumbnail}"
41-
Stretch="UniformToFill"/>
42-
<TextBlock FontSize="16"
43-
Foreground="White"
44-
Grid.Column="1"
45-
Text="{TemplateBinding Label}"
46-
VerticalAlignment="Center"/>
47-
</Grid>
48-
</ControlTemplate>
49-
</Setter.Value>
50-
</Setter>
51-
</Style>
52-
535
<Style x:Key="HambugerMenuItemStyle" TargetType="ListViewItem">
546
<Setter Property="Foreground" Value="{ThemeResource SystemControlForegroundBaseHighBrush}" />
557
<Setter Property="Background" Value="Transparent" />

Microsoft.Toolkit.Uwp.UI.Controls/HamburgerMenu/MenuItems/HamburgerMenuGlyphItem.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,6 @@ public class HamburgerMenuGlyphItem : HamburgerMenuItem
2424
/// </summary>
2525
public static readonly DependencyProperty GlyphProperty = DependencyProperty.Register(nameof(Glyph), typeof(string), typeof(HamburgerMenuItem), new PropertyMetadata(null));
2626

27-
/// <summary>
28-
/// Initializes a new instance of the <see cref="HamburgerMenuGlyphItem"/> class.
29-
/// </summary>
30-
public HamburgerMenuGlyphItem()
31-
{
32-
DefaultStyleKey = typeof(HamburgerMenuGlyphItem);
33-
}
34-
3527
/// <summary>
3628
/// Gets or sets a value that specifies the glyph to use from Segoe MDL2 Assets font.
3729
/// </summary>

Microsoft.Toolkit.Uwp.UI.Controls/HamburgerMenu/MenuItems/HamburgerMenuImageItem.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,6 @@ public class HamburgerMenuImageItem : HamburgerMenuItem
2626
/// </summary>
2727
public static readonly DependencyProperty ThumbnailProperty = DependencyProperty.Register(nameof(Thumbnail), typeof(ImageSource), typeof(HamburgerMenuItem), new PropertyMetadata(null));
2828

29-
/// <summary>
30-
/// Initializes a new instance of the <see cref="HamburgerMenuImageItem"/> class.
31-
/// </summary>
32-
public HamburgerMenuImageItem()
33-
{
34-
DefaultStyleKey = typeof(HamburgerMenuImageItem);
35-
}
36-
3729
/// <summary>
3830
/// Gets or sets a value that specifies a bitmap to display with an Image control.
3931
/// </summary>

Microsoft.Toolkit.Uwp.UI.Controls/HamburgerMenu/MenuItems/HamburgerMenuItem.cs

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
1919
/// <summary>
2020
/// The HamburgerMenuItem provides an abstract implementation for HamburgerMenu entries.
2121
/// </summary>
22-
public abstract class HamburgerMenuItem : Control
22+
public abstract class HamburgerMenuItem : DependencyObject
2323
{
2424
/// <summary>
2525
/// Identifies the <see cref="Label"/> dependency property.
@@ -31,6 +31,11 @@ public abstract class HamburgerMenuItem : Control
3131
/// </summary>
3232
public static readonly DependencyProperty TargetPageTypeProperty = DependencyProperty.Register(nameof(TargetPageType), typeof(Type), typeof(HamburgerMenuItem), new PropertyMetadata(null));
3333

34+
/// <summary>
35+
/// Identifies the <see cref="Tag"/> dependency property.
36+
/// </summary>
37+
public static readonly DependencyProperty TagProperty = DependencyProperty.Register(nameof(Tag), typeof(object), typeof(HamburgerMenuItem), new PropertyMetadata(null));
38+
3439
/// <summary>
3540
/// Gets or sets a value that specifies label to display.
3641
/// </summary>
@@ -62,5 +67,21 @@ public Type TargetPageType
6267
SetValue(TargetPageTypeProperty, value);
6368
}
6469
}
70+
71+
/// <summary>
72+
/// Gets or sets a value that specifies an user specific value.
73+
/// </summary>
74+
public object Tag
75+
{
76+
get
77+
{
78+
return GetValue(TagProperty);
79+
}
80+
81+
set
82+
{
83+
SetValue(TagProperty, value);
84+
}
85+
}
6586
}
6687
}

build/tools/nuget/NuGet.exe

617 KB
Binary file not shown.

docs/controls/RadialProgressBar.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ The control uses the same dependency properties as the standard Progress Bar, wi
1818
Minimum="0"
1919
Maximum="180"
2020
Thickness="4"
21-
Outline="Red">
21+
Outline="Gray"
22+
Foreground="Red">
2223
</controls:RadialProgressBar>
2324

2425
```

0 commit comments

Comments
 (0)