Skip to content

Commit

Permalink
Merge pull request #773 from Microsoft/Issue633-CommunityToolkit15
Browse files Browse the repository at this point in the history
Update to UWP Community Toolkit 1.5
  • Loading branch information
ralarcon authored Jul 12, 2017
2 parents 828c796 + c9d16a2 commit 96d079e
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 328 deletions.
4 changes: 2 additions & 2 deletions templates/Features/LiveTile/_postaction.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
<!-- Nuget package references -->
<!--{[{-->
<PackageReference Include="Microsoft.Toolkit.Uwp.Notifications">
<Version>1.4.1</Version>
<Version>1.5.0</Version>
</PackageReference>
<!--}]}-->
<!--}]}-->
4 changes: 2 additions & 2 deletions templates/Features/ToastNotifications/_postaction.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
<!-- Nuget package references -->
<!--{[{-->
<PackageReference Include="Microsoft.Toolkit.Uwp.Notifications">
<Version>1.4.1</Version>
<Version>1.5.0</Version>
</PackageReference>
<!--}]}-->
<!--}]}-->
Original file line number Diff line number Diff line change
Expand Up @@ -88,124 +88,20 @@
</VisualStateManager.VisualStateGroups>
</Grid>
</DataTemplate>
<Style x:Key="FallCreatorsUpdateHamburgerMenuStyle" TargetType="controls:HamburgerMenu">
<Setter Property="HamburgerMenuTemplate">
<Setter.Value>
<DataTemplate>
<FontIcon
FontFamily="Segoe MDL2 Assets"
FontSize="16"
Glyph="&#xE700;" />
</DataTemplate>
</Setter.Value>
</Setter>
<Setter Property="IsTabStop" Value="False" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="controls:HamburgerMenu">
<Grid>
<SplitView
x:Name="MainSplitView"
CompactPaneLength="{TemplateBinding CompactPaneLength}"
DisplayMode="{TemplateBinding DisplayMode}"
IsPaneOpen="{Binding IsPaneOpen, Mode=TwoWay, RelativeSource={RelativeSource Mode=TemplatedParent}}"
IsTabStop="False"
OpenPaneLength="{TemplateBinding OpenPaneLength}"
PaneBackground="{TemplateBinding PaneBackground}"
PanePlacement="{TemplateBinding PanePlacement}">
<SplitView.Pane>
<Grid x:Name="PaneGrid" FlowDirection="LeftToRight">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid
Grid.Row="0"
Height="{TemplateBinding HamburgerHeight}"
Margin="0,0,0,8" />

<ListView
x:Name="ButtonsListView"
Grid.Row="1"
Width="{TemplateBinding OpenPaneLength}"
IsItemClickEnabled="True"
ItemTemplate="{TemplateBinding ItemTemplate}"
ItemTemplateSelector="{TemplateBinding ItemTemplateSelector}"
ItemsSource="{TemplateBinding ItemsSource}"
ScrollViewer.VerticalScrollBarVisibility="Auto"
SelectedIndex="{Binding SelectedIndex, Mode=TwoWay, RelativeSource={RelativeSource Mode=TemplatedParent}}"
SelectedItem="{Binding SelectedItem, Mode=TwoWay, RelativeSource={RelativeSource Mode=TemplatedParent}}"
SelectionMode="None"
TabIndex="1">
<ListView.ItemContainerStyle>
<Style TargetType="ListViewItem">
<Setter Property="Padding" Value="0" />
</Style>
</ListView.ItemContainerStyle>
</ListView>
<ListView
x:Name="OptionsListView"
Grid.Row="2"
Width="{TemplateBinding OpenPaneLength}"
IsItemClickEnabled="True"
Margin="0,20,0,8"
VerticalAlignment="Bottom"
ItemTemplate="{TemplateBinding OptionsItemTemplate}"
ItemTemplateSelector="{TemplateBinding ItemTemplateSelector}"
ItemsSource="{TemplateBinding OptionsItemsSource}"
ScrollViewer.VerticalScrollBarVisibility="Disabled"
SelectedIndex="{Binding SelectedOptionsIndex, Mode=TwoWay, RelativeSource={RelativeSource Mode=TemplatedParent}}"
SelectedItem="{Binding SelectedOptionsItem, Mode=TwoWay, RelativeSource={RelativeSource Mode=TemplatedParent}}"
SelectionMode="None"
TabIndex="2">
<ListView.ItemContainerStyle>
<Style TargetType="ListViewItem">
<Setter Property="Padding" Value="0" />
</Style>
</ListView.ItemContainerStyle>
</ListView>
</Grid>
</SplitView.Pane>
<ContentPresenter
x:Name="ContentPart"
Content="{TemplateBinding Content}" />
</SplitView>
<Button
x:Name="HamburgerButton"
Width="{TemplateBinding HamburgerWidth}"
Height="{TemplateBinding HamburgerHeight}"
Margin="0"
Padding="0"
VerticalAlignment="Top"
Background="Transparent"
BorderThickness="0"
TabIndex="0"
Visibility="{TemplateBinding HamburgerVisibility}">
<ContentControl
ContentTemplate="{TemplateBinding HamburgerMenuTemplate}"
Foreground="{TemplateBinding Foreground}"
IsTabStop="False" />
</Button>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Page.Resources>

<controls:HamburgerMenu
x:Name="NavigationMenu"
DisplayMode="{x:Bind DisplayMode, Mode=OneWay}"
PaneBackground="{ThemeResource SystemControlBackgroundAltHighBrush}"
IsPaneOpen="{x:Bind IsPaneOpen, Mode=TwoWay}"
ItemTemplate="{StaticResource NavigationMenuItemDataTemplate}"
ItemsSource="{x:Bind PrimaryItems}"
OptionsItemTemplate="{StaticResource NavigationMenuItemDataTemplate}"
OptionsItemsSource="{x:Bind SecondaryItems}"
ItemClick="ItemClicked"
OptionsItemClick="ItemClicked"
Style="{StaticResource FallCreatorsUpdateHamburgerMenuStyle}"
PaneBackground="{ThemeResource SystemControlBackgroundAltHighBrush}"
PaneForeground="{ThemeResource SystemControlForegroundBaseHighBrush}"
>
<Grid Background="{ThemeResource SystemControlBackgroundAltHighBrush}">
<Frame x:Name="shellFrame"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- Nuget package references -->
<!--{[{-->
<PackageReference Include="Microsoft.Toolkit.Uwp.UI.Controls">
<Version>1.4.1</Version>
<Version>1.5.0</Version>
</PackageReference>
<!--}]}-->
<!--}]}-->
Original file line number Diff line number Diff line change
Expand Up @@ -90,122 +90,18 @@
</VisualStateManager.VisualStateGroups>
</Grid>
</DataTemplate>
<Style x:Key="FallCreatorsUpdateHamburgerMenuStyle" TargetType="controls:HamburgerMenu">
<Setter Property="HamburgerMenuTemplate">
<Setter.Value>
<DataTemplate>
<FontIcon
FontFamily="Segoe MDL2 Assets"
FontSize="16"
Glyph="&#xE700;" />
</DataTemplate>
</Setter.Value>
</Setter>
<Setter Property="IsTabStop" Value="False" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="controls:HamburgerMenu">
<Grid>
<SplitView
x:Name="MainSplitView"
CompactPaneLength="{TemplateBinding CompactPaneLength}"
DisplayMode="{TemplateBinding DisplayMode}"
IsPaneOpen="{Binding IsPaneOpen, Mode=TwoWay, RelativeSource={RelativeSource Mode=TemplatedParent}}"
IsTabStop="False"
OpenPaneLength="{TemplateBinding OpenPaneLength}"
PaneBackground="{TemplateBinding PaneBackground}"
PanePlacement="{TemplateBinding PanePlacement}">
<SplitView.Pane>
<Grid x:Name="PaneGrid" FlowDirection="LeftToRight">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid
Grid.Row="0"
Height="{TemplateBinding HamburgerHeight}"
Margin="0,0,0,8" />

<ListView
x:Name="ButtonsListView"
Grid.Row="1"
Width="{TemplateBinding OpenPaneLength}"
IsItemClickEnabled="True"
ItemTemplate="{TemplateBinding ItemTemplate}"
ItemTemplateSelector="{TemplateBinding ItemTemplateSelector}"
ItemsSource="{TemplateBinding ItemsSource}"
ScrollViewer.VerticalScrollBarVisibility="Auto"
SelectedIndex="{Binding SelectedIndex, Mode=TwoWay, RelativeSource={RelativeSource Mode=TemplatedParent}}"
SelectedItem="{Binding SelectedItem, Mode=TwoWay, RelativeSource={RelativeSource Mode=TemplatedParent}}"
SelectionMode="None"
TabIndex="1">
<ListView.ItemContainerStyle>
<Style TargetType="ListViewItem">
<Setter Property="Padding" Value="0" />
</Style>
</ListView.ItemContainerStyle>
</ListView>
<ListView
x:Name="OptionsListView"
Grid.Row="2"
Width="{TemplateBinding OpenPaneLength}"
IsItemClickEnabled="True"
Margin="0,20,0,8"
VerticalAlignment="Bottom"
ItemTemplate="{TemplateBinding OptionsItemTemplate}"
ItemTemplateSelector="{TemplateBinding ItemTemplateSelector}"
ItemsSource="{TemplateBinding OptionsItemsSource}"
ScrollViewer.VerticalScrollBarVisibility="Disabled"
SelectedIndex="{Binding SelectedOptionsIndex, Mode=TwoWay, RelativeSource={RelativeSource Mode=TemplatedParent}}"
SelectedItem="{Binding SelectedOptionsItem, Mode=TwoWay, RelativeSource={RelativeSource Mode=TemplatedParent}}"
SelectionMode="None"
TabIndex="2">
<ListView.ItemContainerStyle>
<Style TargetType="ListViewItem">
<Setter Property="Padding" Value="0" />
</Style>
</ListView.ItemContainerStyle>
</ListView>
</Grid>
</SplitView.Pane>
<ContentPresenter
x:Name="ContentPart"
Content="{TemplateBinding Content}" />
</SplitView>
<Button
x:Name="HamburgerButton"
Width="{TemplateBinding HamburgerWidth}"
Height="{TemplateBinding HamburgerHeight}"
Margin="0"
Padding="0"
VerticalAlignment="Top"
Background="Transparent"
BorderThickness="0"
TabIndex="0"
Visibility="{TemplateBinding HamburgerVisibility}">
<ContentControl
ContentTemplate="{TemplateBinding HamburgerMenuTemplate}"
Foreground="{TemplateBinding Foreground}"
IsTabStop="False" />
</Button>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Page.Resources>

<controls:HamburgerMenu
x:Name="NavigationMenu"
DisplayMode="{x:Bind ViewModel.DisplayMode, Mode=OneWay}"
PaneBackground="{ThemeResource SystemControlBackgroundAltHighBrush}"
IsPaneOpen="{x:Bind ViewModel.IsPaneOpen, Mode=TwoWay}"
ItemTemplate="{StaticResource NavigationMenuItemDataTemplate}"
ItemsSource="{x:Bind ViewModel.PrimaryItems}"
OptionsItemTemplate="{StaticResource NavigationMenuItemDataTemplate}"
OptionsItemsSource="{x:Bind ViewModel.SecondaryItems}"
Style="{StaticResource FallCreatorsUpdateHamburgerMenuStyle}"
PaneBackground="{ThemeResource SystemControlBackgroundAltHighBrush}"
PaneForeground="{ThemeResource SystemControlForegroundBaseHighBrush}"
>
<i:Interaction.Behaviors>
<ic:EventTriggerBehavior EventName="ItemClick">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- Nuget package references -->
<!--{[{-->
<PackageReference Include="Microsoft.Toolkit.Uwp.UI.Controls">
<Version>1.4.1</Version>
<Version>1.5.0</Version>
</PackageReference>
<!--}]}-->
<!--}]}-->
Loading

0 comments on commit 96d079e

Please sign in to comment.