Added basic sample
This commit is contained in:
Родитель
889a59f316
Коммит
a65b0a7120
|
@ -272,6 +272,7 @@
|
|||
<Content Include="Icons\More.png" />
|
||||
<Content Include="Icons\Notifications.png" />
|
||||
<Content Include="Icons\Services.png" />
|
||||
<Content Include="SamplePages\TabbedCommandBar\TabbedCommandBar.png" />
|
||||
<Content Include="SamplePages\TilesBrush\TilesBrush.png" />
|
||||
<Content Include="SamplePages\Eyedropper\Eyedropper.png" />
|
||||
<Content Include="SamplePages\OnDevice\OnDevice.png" />
|
||||
|
@ -515,6 +516,9 @@
|
|||
<Compile Include="SamplePages\FocusBehavior\FocusBehaviorPage.xaml.cs">
|
||||
<DependentUpon>FocusBehaviorPage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SamplePages\TabbedCommandBar\TabbedCommandBarPage.xaml.cs">
|
||||
<DependentUpon>TabbedCommandBarPage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SamplePages\TilesBrush\TilesBrushPage.xaml.cs">
|
||||
<DependentUpon>TilesBrushPage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
|
@ -1001,6 +1005,13 @@
|
|||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Content Include="SamplePages\TabbedCommandBar\TabbedCommandBar.bind">
|
||||
<SubType>Designer</SubType>
|
||||
</Content>
|
||||
<Page Include="SamplePages\TabbedCommandBar\TabbedCommandBarPage.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="SamplePages\TilesBrush\TilesBrushPage.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
|
|
|
@ -0,0 +1,79 @@
|
|||
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
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>
|
||||
<controls:TabbedCommandBar>
|
||||
<controls:TabbedCommandBar.Footer>
|
||||
<CommandBar Background="Transparent" DefaultLabelPosition="Right">
|
||||
<AppBarButton Label="Share" Icon="Share"/>
|
||||
<AppBarButton Label="Comments" Icon="Message"/>
|
||||
</CommandBar>
|
||||
</controls:TabbedCommandBar.Footer>
|
||||
<controls:TabbedCommandBarItem Header="Home">
|
||||
<AppBarButton Icon="Undo" Label="Undo"/>
|
||||
<AppBarButton Icon="Redo" Label="Redo"/>
|
||||
<AppBarButton Icon="Paste" Label="Paste"/>
|
||||
<AppBarSeparator />
|
||||
<AppBarElementContainer>
|
||||
<ComboBox SelectedIndex="0">
|
||||
<ComboBoxItem Content="Arial" />
|
||||
<ComboBoxItem Content="Calibri" />
|
||||
<ComboBoxItem Content="JetBrains Mono" />
|
||||
<ComboBoxItem Content="Roboto" />
|
||||
<ComboBoxItem Content="Sergio UI" />
|
||||
<ComboBoxItem Content="Sergio UI Semibold" />
|
||||
</ComboBox>
|
||||
</AppBarElementContainer>
|
||||
<AppBarToggleButton Icon="Bold" Label="Bold" />
|
||||
<AppBarToggleButton Icon="Italic" Label="Italic" />
|
||||
<AppBarToggleButton Icon="Underline" Label="Underline" />
|
||||
</controls:TabbedCommandBarItem>
|
||||
<controls:TabbedCommandBarItem Header="Insert">
|
||||
<AppBarButton Icon="Pictures" Label="Pictures">
|
||||
<AppBarButton.Flyout>
|
||||
<MenuFlyout Placement="BottomEdgeAlignedLeft">
|
||||
<MenuFlyoutItem Text="This Device">
|
||||
<MenuFlyoutItem.Icon>
|
||||
<FontIcon FontFamily="Segoe MDL2 Assets" Glyph="" />
|
||||
</MenuFlyoutItem.Icon>
|
||||
</MenuFlyoutItem>
|
||||
<MenuFlyoutItem Text="Stock Images">
|
||||
<MenuFlyoutItem.Icon>
|
||||
<FontIcon FontFamily="Segoe MDL2 Assets" Glyph="" />
|
||||
</MenuFlyoutItem.Icon>
|
||||
</MenuFlyoutItem>
|
||||
<MenuFlyoutItem Icon="Globe" Text="Online Pictures" />
|
||||
</MenuFlyout>
|
||||
</AppBarButton.Flyout>
|
||||
</AppBarButton>
|
||||
<AppBarButton Label="Shapes">
|
||||
<AppBarButton.Icon>
|
||||
<FontIcon FontFamily="Segoe UI Symbol" Glyph="□" />
|
||||
</AppBarButton.Icon>
|
||||
</AppBarButton>
|
||||
<AppBarButton Label="Icons">
|
||||
<AppBarButton.Icon>
|
||||
<FontIcon FontFamily="Segoe MDL2 Assets" Glyph="" />
|
||||
</AppBarButton.Icon>
|
||||
</AppBarButton>
|
||||
<AppBarButton Label="3D Models">
|
||||
<AppBarButton.Icon>
|
||||
<FontIcon FontFamily="Segoe MDL2 Assets" Glyph="" />
|
||||
</AppBarButton.Icon>
|
||||
</AppBarButton>
|
||||
<AppBarSeparator/>
|
||||
<AppBarButton Label="Add-ins">
|
||||
<AppBarButton.Icon>
|
||||
<FontIcon FontFamily="Segoe MDL2 Assets" Glyph="" />
|
||||
</AppBarButton.Icon>
|
||||
</AppBarButton>
|
||||
<controls:TabbedCommandBarItem.SecondaryCommands>
|
||||
<AppBarButton Icon="Add" Label="New item" />
|
||||
</controls:TabbedCommandBarItem.SecondaryCommands>
|
||||
</controls:TabbedCommandBarItem>
|
||||
</controls:TabbedCommandBar>
|
||||
</Grid>
|
||||
</Page>
|
Двоичные данные
Microsoft.Toolkit.Uwp.SampleApp/SamplePages/TabbedCommandBar/TabbedCommandBar.png
Normal file
Двоичные данные
Microsoft.Toolkit.Uwp.SampleApp/SamplePages/TabbedCommandBar/TabbedCommandBar.png
Normal file
Двоичный файл не отображается.
После Ширина: | Высота: | Размер: 2.9 KiB |
|
@ -0,0 +1,16 @@
|
|||
<Page x:Class="Microsoft.Toolkit.Uwp.SampleApp.SamplePages.TabbedCommandBarPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="using:Microsoft.Toolkit.Uwp.SampleApp.SamplePages"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<!-- Shallow Copy -->
|
||||
<Grid Visibility="Collapsed">
|
||||
<controls:TabbedCommandBar />
|
||||
<controls:TabbedCommandBarItem Header="Dummy" />
|
||||
</Grid>
|
||||
</Page>
|
|
@ -0,0 +1,34 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices.WindowsRuntime;
|
||||
using Windows.Foundation;
|
||||
using Windows.Foundation.Collections;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Windows.UI.Xaml.Controls.Primitives;
|
||||
using Windows.UI.Xaml.Data;
|
||||
using Windows.UI.Xaml.Input;
|
||||
using Windows.UI.Xaml.Media;
|
||||
using Windows.UI.Xaml.Navigation;
|
||||
|
||||
// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
|
||||
{
|
||||
/// <summary>
|
||||
/// An empty page that can be used on its own or navigated to within a Frame.
|
||||
/// </summary>
|
||||
public sealed partial class TabbedCommandBarPage : Page
|
||||
{
|
||||
public TabbedCommandBarPage()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -433,6 +433,16 @@
|
|||
"XamlCodeFile": "TokenizingTextBoxXaml.bind",
|
||||
"Icon": "/SamplePages/TokenizingTextBox/TokenizingTextBox.png",
|
||||
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/controls/TokenizingTextBox.md"
|
||||
},
|
||||
{
|
||||
"Name": "TabbedCommandBar",
|
||||
"Type": "TabbedCommandBarPage",
|
||||
"Subcategory": "Layout",
|
||||
"About": "A control for displaying multiple CommandBars in the same space, like Microsoft Office's ribbon.",
|
||||
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Controls/TabbedCommandBar",
|
||||
"XamlCodeFile": "TabbedCommandBar.bind",
|
||||
"Icon": "/SamplePages/TabbedCommandBar/TabbedCommandBar.png",
|
||||
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/controls/TabbedCommandBar.md"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
@ -45,6 +45,7 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="TabbedCommandBar\RibbonNavigationViewStyle.xaml" />
|
||||
<None Remove="TabbedCommandBar\TabbedCommandBar.xaml" />
|
||||
</ItemGroup>
|
||||
|
||||
|
@ -89,6 +90,13 @@
|
|||
</ItemGroup>
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<Page Update="TabbedCommandBar\RibbonNavigationViewStyle.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<Page Update="TabbedCommandBar\TabbedCommandBar.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
|
|
|
@ -0,0 +1,271 @@
|
|||
<ResourceDictionary
|
||||
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">
|
||||
<Style x:Key="RibbonTabNavigationViewStyle"
|
||||
TargetType="NavigationView">
|
||||
<Setter Property="PaneToggleButtonStyle" Value="{StaticResource PaneToggleButtonStyle}" />
|
||||
<Setter Property="IsTabStop" Value="False" />
|
||||
<Setter Property="CompactPaneLength" Value="{ThemeResource NavigationViewCompactPaneLength}" />
|
||||
<Setter Property="Background" Value="{ThemeResource SystemControlChromeMediumLowAcrylicWindowMediumBrush}" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="NavigationView">
|
||||
<Grid x:Name="RootGrid">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel x:Name="TopNavArea"
|
||||
Grid.Row="0"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Top"
|
||||
Background="{TemplateBinding Background}"
|
||||
Canvas.ZIndex="1"
|
||||
XYFocusKeyboardNavigation="Enabled">
|
||||
<Grid x:Name="TopNavTopPadding"
|
||||
Height="{Binding TemplateSettings.TopPadding, RelativeSource={RelativeSource Mode=TemplatedParent}}"
|
||||
Visibility="{Binding TemplateSettings.TopPaneVisibility, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
|
||||
<Grid x:Name="TopNavGrid"
|
||||
Height="{ThemeResource NavigationViewTopPaneHeight}"
|
||||
Visibility="{Binding TemplateSettings.TopPaneVisibility, RelativeSource={RelativeSource Mode=TemplatedParent}}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*"
|
||||
MinWidth="48" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid x:Name="TopNavLeftPadding"
|
||||
Grid.Column="1"
|
||||
Width="0" />
|
||||
<ContentControl x:Name="PaneHeaderOnTopPane"
|
||||
Grid.Column="2"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch"
|
||||
IsTabStop="False" />
|
||||
<NavigationViewList x:Name="TopNavMenuItemsHost"
|
||||
Grid.Column="3"
|
||||
AutomationProperties.LandmarkType="Navigation"
|
||||
IsItemClickEnabled="True"
|
||||
ItemContainerStyle="{TemplateBinding MenuItemContainerStyle}"
|
||||
ItemContainerStyleSelector="{TemplateBinding MenuItemContainerStyleSelector}"
|
||||
ItemTemplate="{TemplateBinding MenuItemTemplate}"
|
||||
ItemTemplateSelector="{TemplateBinding MenuItemTemplateSelector}"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
|
||||
ScrollViewer.HorizontalScrollMode="Disabled"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Hidden"
|
||||
ScrollViewer.VerticalScrollMode="Disabled"
|
||||
SelectionMode="Single"
|
||||
SingleSelectionFollowsFocus="{Binding TemplateSettings.SingleSelectionFollowsFocus, RelativeSource={RelativeSource Mode=TemplatedParent}}">
|
||||
<NavigationViewList.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<ItemsStackPanel Orientation="Horizontal" />
|
||||
</ItemsPanelTemplate>
|
||||
</NavigationViewList.ItemsPanel>
|
||||
<NavigationViewList.ItemContainerTransitions>
|
||||
<TransitionCollection />
|
||||
</NavigationViewList.ItemContainerTransitions>
|
||||
</NavigationViewList>
|
||||
<Button x:Name="TopNavOverflowButton"
|
||||
Grid.Column="4"
|
||||
Content="More"
|
||||
Style="{StaticResource NavigationViewOverflowButtonStyleWhenPaneOnTop}"
|
||||
Visibility="{Binding TemplateSettings.OverflowButtonVisibility, RelativeSource={RelativeSource Mode=TemplatedParent}}">
|
||||
<Button.Flyout>
|
||||
<Flyout Placement="Bottom"
|
||||
ShouldConstrainToRootBounds="False">
|
||||
<Flyout.FlyoutPresenterStyle>
|
||||
<Style TargetType="FlyoutPresenter">
|
||||
<Setter Property="Padding" Value="0,8" />
|
||||
<Setter Property="Margin" Value="0,-4,0,0" />
|
||||
</Style>
|
||||
</Flyout.FlyoutPresenterStyle>
|
||||
<NavigationViewList x:Name="TopNavMenuItemsOverflowHost"
|
||||
IsItemClickEnabled="True"
|
||||
ItemContainerStyle="{TemplateBinding MenuItemContainerStyle}"
|
||||
ItemContainerStyleSelector="{TemplateBinding MenuItemContainerStyleSelector}"
|
||||
ItemTemplate="{TemplateBinding MenuItemTemplate}"
|
||||
ItemTemplateSelector="{TemplateBinding MenuItemTemplateSelector}"
|
||||
SingleSelectionFollowsFocus="False">
|
||||
<NavigationViewList.ItemContainerTransitions>
|
||||
<TransitionCollection />
|
||||
</NavigationViewList.ItemContainerTransitions>
|
||||
</NavigationViewList>
|
||||
</Flyout>
|
||||
</Button.Flyout>
|
||||
</Button>
|
||||
<ContentControl x:Name="PaneCustomContentOnTopPane"
|
||||
Grid.Column="5"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch"
|
||||
IsTabStop="False" />
|
||||
<ContentControl x:Name="PaneFooterOnTopPane"
|
||||
Grid.Column="7"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch"
|
||||
IsTabStop="False" />
|
||||
</Grid>
|
||||
<Border x:Name="TopNavContentOverlayAreaGrid"
|
||||
Child="{TemplateBinding ContentOverlay}" />
|
||||
</StackPanel>
|
||||
<SplitView x:Name="RootSplitView"
|
||||
Grid.Row="1"
|
||||
Background="{TemplateBinding Background}"
|
||||
CompactPaneLength="{TemplateBinding CompactPaneLength}"
|
||||
DisplayMode="Inline"
|
||||
IsPaneOpen="{Binding IsPaneOpen, Mode=TwoWay, RelativeSource={RelativeSource Mode=TemplatedParent}}"
|
||||
IsTabStop="False"
|
||||
OpenPaneLength="{TemplateBinding OpenPaneLength}"
|
||||
PaneBackground="{ThemeResource NavigationViewDefaultPaneBackground}">
|
||||
<SplitView.Pane>
|
||||
<Grid x:Name="PaneContentGrid"
|
||||
Visibility="{Binding TemplateSettings.LeftPaneVisibility, RelativeSource={RelativeSource Mode=TemplatedParent}}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="0" />
|
||||
<RowDefinition x:Name="PaneContentGridToggleButtonRow"
|
||||
Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="8" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="8" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid x:Name="ContentPaneTopPadding"
|
||||
Height="{Binding TemplateSettings.TopPadding, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
|
||||
<Grid Grid.Row="2"
|
||||
Height="{StaticResource PaneToggleButtonHeight}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="{ThemeResource PaneToggleButtonWidth}" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<ContentControl x:Name="PaneHeaderContentBorder"
|
||||
Grid.Column="1"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch"
|
||||
IsTabStop="False" />
|
||||
</Grid>
|
||||
<ContentControl x:Name="PaneCustomContentBorder"
|
||||
Grid.Row="4"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch"
|
||||
IsTabStop="False" />
|
||||
<NavigationViewList x:Name="MenuItemsHost"
|
||||
Grid.Row="6"
|
||||
Margin="0,0,0,20"
|
||||
HorizontalAlignment="Stretch"
|
||||
IsItemClickEnabled="True"
|
||||
ItemContainerStyle="{TemplateBinding MenuItemContainerStyle}"
|
||||
ItemContainerStyleSelector="{TemplateBinding MenuItemContainerStyleSelector}"
|
||||
ItemTemplate="{TemplateBinding MenuItemTemplate}"
|
||||
ItemTemplateSelector="{TemplateBinding MenuItemTemplateSelector}"
|
||||
SelectedItem="{TemplateBinding SelectedItem}"
|
||||
SelectionMode="Single"
|
||||
SingleSelectionFollowsFocus="{Binding TemplateSettings.SingleSelectionFollowsFocus, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
|
||||
<ContentControl x:Name="FooterContentBorder"
|
||||
Grid.Row="7"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch"
|
||||
IsTabStop="False" />
|
||||
</Grid>
|
||||
</SplitView.Pane>
|
||||
<Grid x:Name="ContentGrid">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid x:Name="ContentTopPadding"
|
||||
Height="{Binding TemplateSettings.TopPadding, RelativeSource={RelativeSource Mode=TemplatedParent}}"
|
||||
Visibility="{Binding TemplateSettings.LeftPaneVisibility, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
|
||||
<ContentControl x:Name="HeaderContent"
|
||||
Grid.Row="1"
|
||||
MinHeight="{StaticResource PaneToggleButtonHeight}"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch"
|
||||
Content="{TemplateBinding Header}"
|
||||
ContentTemplate="{TemplateBinding HeaderTemplate}"
|
||||
IsTabStop="False"
|
||||
Style="{StaticResource NavigationViewTitleHeaderContentControlTextStyle}" />
|
||||
<ContentPresenter Grid.Row="2"
|
||||
AutomationProperties.LandmarkType="Main"
|
||||
Content="{TemplateBinding Content}" />
|
||||
</Grid>
|
||||
</SplitView>
|
||||
</Grid>
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="DisplayModeGroup">
|
||||
<VisualState x:Name="Compact" />
|
||||
<VisualState x:Name="Expanded">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="RootSplitView.PaneBackground" Value="{ThemeResource NavigationViewExpandedPaneBackground}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Minimal">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="HeaderContent.Margin" Value="48,5,0,0" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
<VisualState x:Name="TopNavigationMinimal" />
|
||||
<VisualState x:Name="MinimalWithBackButton">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="HeaderContent.Margin" Value="104,5,0,0" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
<VisualStateGroup x:Name="HeaderGroup">
|
||||
<VisualState x:Name="HeaderVisible" />
|
||||
<VisualState x:Name="HeaderCollapsed">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="HeaderContent.Visibility" Value="Collapsed" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
<VisualStateGroup x:Name="PaneStateListSizeGroup">
|
||||
<VisualState x:Name="ListSizeFull" />
|
||||
<VisualState x:Name="ListSizeCompact">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="MenuItemsHost.HorizontalAlignment" Value="Left" />
|
||||
<Setter Target="MenuItemsHost.Width" Value="{Binding CompactPaneLength, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
|
||||
<Setter Target="SettingsNavPaneItem.HorizontalAlignment" Value="Left" />
|
||||
<Setter Target="SettingsNavPaneItem.Width" Value="{Binding CompactPaneLength, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
|
||||
<Setter Target="PaneTitleTextBlock.Visibility" Value="Collapsed" />
|
||||
<Setter Target="PaneHeaderContentBorder.Visibility" Value="Collapsed" />
|
||||
<Setter Target="PaneCustomContentBorder.HorizontalAlignment" Value="Left" />
|
||||
<Setter Target="PaneCustomContentBorder.Width" Value="{Binding CompactPaneLength, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
|
||||
<Setter Target="FooterContentBorder.HorizontalAlignment" Value="Left" />
|
||||
<Setter Target="FooterContentBorder.Width" Value="{Binding CompactPaneLength, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
<VisualStateGroup x:Name="TitleBarVisibilityGroup">
|
||||
<VisualState x:Name="TitleBarVisible" />
|
||||
<VisualState x:Name="TitleBarCollapsed">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="PaneContentGrid.Margin" Value="0,32,0,0" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
<VisualStateGroup x:Name="OverflowLabelGroup">
|
||||
<VisualState x:Name="OverflowButtonWithLabel" />
|
||||
<VisualState x:Name="OverflowButtonNoLabel">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="TopNavOverflowButton.Style" Value="{ThemeResource NavigationViewOverflowButtonNoLabelStyleWhenPaneOnTop}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</ResourceDictionary>
|
|
@ -45,7 +45,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
|
|||
typeof(TabbedCommandBar),
|
||||
new PropertyMetadata(new Border()));
|
||||
|
||||
// I would prefer this be an IList<TabbedCommandBarItem>, but Intellisense really doesn't like that.
|
||||
// This should be an IList<TabbedCommandBarItem>, but Intellisense really doesn't like that.
|
||||
/// <summary>
|
||||
/// Gets or sets A list of <see cref="TabbedCommandBarItem"/>s to display in this <see cref="TabbedCommandBar"/>.
|
||||
/// </summary>
|
||||
|
@ -108,7 +108,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
|
|||
}
|
||||
else if (args.SelectedItem is NavigationViewItem navItem)
|
||||
{
|
||||
// This code is a hack and is only temporary, because I can't get binding to work.
|
||||
// This code is a hack, but it's necessary if binding doesn't work.
|
||||
// RibbonContent might be null here, there should be a check
|
||||
_ribbonContent.Content = Items[System.Math.Min(Items.Count - 1, _ribbonNavigationView.MenuItems.IndexOf(navItem))];
|
||||
}
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls">
|
||||
|
||||
<!-- For some reason this code causes an exception at runtime, that String couldn't be turned into a Uri. -->
|
||||
<!--<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="ms-appx:///Microsoft.Toolkit.Uwp.UI.Controls.Ribbon/TabbedCommandBar/TabbedCommandBar.xaml" />
|
||||
<ResourceDictionary Source="ms-appx:///Microsoft.Toolkit.Uwp.UI.Controls.Ribbon/TabbedCommandBar/TabbedCommandBarItem.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>-->
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="ms-appx:///Microsoft.Toolkit.Uwp.UI.Controls/TabbedCommandBar/RibbonNavigationViewStyle.xaml" />
|
||||
<!--<ResourceDictionary Source="ms-appx:///Microsoft.Toolkit.Uwp.UI.Controls/TabbedCommandBar/TabbedCommandBarItem.xaml" />-->
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
<Style BasedOn="{StaticResource CommandBarRevealStyle}"
|
||||
TargetType="controls:TabbedCommandBarItem">
|
||||
|
|
Загрузка…
Ссылка в новой задаче