summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.UAP
diff options
context:
space:
mode:
authorE.Z. Hart <hartez@users.noreply.github.com>2016-12-02 20:48:42 (GMT)
committerRui Marinho <me@ruimarinho.net>2016-12-02 20:48:42 (GMT)
commit4df66d139f8128486b3e34e1c206413abd1babd5 (patch)
tree3a7e1581240872ce3fff0559524cc6092d45014f /Xamarin.Forms.Platform.UAP
parentbadc701871a1190d6acb3495d3cefa93cff810c5 (diff)
downloadxamarin-forms-4df66d139f8128486b3e34e1c206413abd1babd5.zip
xamarin-forms-4df66d139f8128486b3e34e1c206413abd1babd5.tar.gz
xamarin-forms-4df66d139f8128486b3e34e1c206413abd1babd5.tar.bz2
Allow CommandBar to expand and show command labels (#594)
* Allow CommandBar to expand and show command labels Consolidate command bar placement code * Make title text wrapping consistent between NavigationPage and MasterDetailPage * Align toolbar/navigation bar behavior with other platforms
Diffstat (limited to 'Xamarin.Forms.Platform.UAP')
-rw-r--r--Xamarin.Forms.Platform.UAP/FormsCommandBar.cs79
-rw-r--r--Xamarin.Forms.Platform.UAP/FormsCommandBarStyle.xaml800
-rw-r--r--Xamarin.Forms.Platform.UAP/MasterDetailControl.cs28
-rw-r--r--Xamarin.Forms.Platform.UAP/MasterDetailControlStyle.xaml33
-rw-r--r--Xamarin.Forms.Platform.UAP/PageControlStyle.xaml25
-rw-r--r--Xamarin.Forms.Platform.UAP/Resources.xaml1
-rw-r--r--Xamarin.Forms.Platform.UAP/TabbedPageStyle.xaml25
-rw-r--r--Xamarin.Forms.Platform.UAP/ToolbarPlacementHelper.cs56
-rw-r--r--Xamarin.Forms.Platform.UAP/Xamarin.Forms.Platform.UAP.csproj5
9 files changed, 973 insertions, 79 deletions
diff --git a/Xamarin.Forms.Platform.UAP/FormsCommandBar.cs b/Xamarin.Forms.Platform.UAP/FormsCommandBar.cs
index 21e9ca1..4145186 100644
--- a/Xamarin.Forms.Platform.UAP/FormsCommandBar.cs
+++ b/Xamarin.Forms.Platform.UAP/FormsCommandBar.cs
@@ -1,18 +1,30 @@
-using Windows.Foundation.Collections;
+using System;
+using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
+using Windows.UI.Xaml.Data;
namespace Xamarin.Forms.Platform.UWP
{
public class FormsCommandBar : CommandBar
{
- // TODO Once 10.0.14393.0 is available, enable dynamic overflow: https://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.commandbar.isdynamicoverflowenabled.aspx
+ // TODO Once 10.0.14393.0 is available (and we don't have to support lower versions), enable dynamic overflow: https://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.commandbar.isdynamicoverflowenabled.aspx
+ Windows.UI.Xaml.Controls.Button _moreButton;
+
public FormsCommandBar()
{
PrimaryCommands.VectorChanged += OnCommandsChanged;
SecondaryCommands.VectorChanged += OnCommandsChanged;
UpdateVisibility();
+ WatchForContentChanges();
+ }
+
+ protected override void OnApplyTemplate()
+ {
+ base.OnApplyTemplate();
+
+ _moreButton = GetTemplateChild("MoreButton") as Windows.UI.Xaml.Controls.Button;
}
void OnCommandsChanged(IObservableVector<ICommandBarElement> sender, IVectorChangedEventArgs args)
@@ -22,7 +34,68 @@ namespace Xamarin.Forms.Platform.UWP
void UpdateVisibility()
{
- Visibility = PrimaryCommands.Count + SecondaryCommands.Count > 0 ? Visibility.Visible : Visibility.Collapsed;
+ var visibility = PrimaryCommands.Count + SecondaryCommands.Count > 0 ? Visibility.Visible : Visibility.Collapsed;
+
+ if (_moreButton != null)
+ {
+ // The "..." button should only be visible if we have commands to display
+ _moreButton.Visibility = visibility;
+
+ // There *is* an OverflowButtonVisibility property that does more or less the same thing,
+ // but it became available in 10.0.14393.0 and we have to support 10.0.10240
+ }
+
+ // If we have a title (or some other content) inside this command bar
+ // and that content is not collapsed
+ var frameworkElement = Content as FrameworkElement;
+
+ // Temporarily tie the visibility of the toolbar to the visibility of the Title
+ // to be consistent with the old style / other platforms
+ if (frameworkElement != null && frameworkElement.Visibility == Visibility.Collapsed)
+ {
+ Visibility = Visibility.Collapsed;
+ return;
+ }
+
+ if (frameworkElement != null && frameworkElement.Visibility != Visibility.Collapsed)
+ {
+ Visibility = Visibility.Visible;
+ }
+ else
+ {
+ // Otherwise, collapse it if there are no commands
+ Visibility = visibility;
+ }
+ }
+
+ void WatchForContentChanges()
+ {
+ // If the content of the command bar changes while it's collapsed, we need to
+ // react and update the visibility (e.g., if the bar is placed at the bottom and
+ // has no commands, then is moved to the top and now includes the title)
+
+ // There's no event on CommandBar when the content changes, so we'll bind our own
+ // dependency property to Content and update our visibility when it changes
+ var binding = new Windows.UI.Xaml.Data.Binding
+ {
+ Source = this,
+ Path = new PropertyPath(nameof(Content)),
+ Mode = Windows.UI.Xaml.Data.BindingMode.OneWay
+ };
+
+ BindingOperations.SetBinding(this, s_contentChangeWatcher, binding);
+ }
+
+ static readonly DependencyProperty s_contentChangeWatcher =
+ DependencyProperty.Register(
+ "ContentChangeWatcher",
+ typeof(object),
+ typeof(object),
+ new PropertyMetadata(null, ContentChanged));
+
+ static void ContentChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+ {
+ (d as FormsCommandBar)?.UpdateVisibility();
}
}
} \ No newline at end of file
diff --git a/Xamarin.Forms.Platform.UAP/FormsCommandBarStyle.xaml b/Xamarin.Forms.Platform.UAP/FormsCommandBarStyle.xaml
new file mode 100644
index 0000000..31b800f
--- /dev/null
+++ b/Xamarin.Forms.Platform.UAP/FormsCommandBarStyle.xaml
@@ -0,0 +1,800 @@
+<ResourceDictionary
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:local="using:Xamarin.Forms.Platform.UAP"
+ xmlns:uwp="using:Xamarin.Forms.Platform.UWP">
+ <Style x:Key="EllipsisButton" TargetType="Button">
+ <Setter Property="Background" Value="Transparent"/>
+ <Setter Property="Foreground" Value="{ThemeResource SystemControlForegroundBaseHighBrush}"/>
+ <Setter Property="BorderThickness" Value="0"/>
+ <Setter Property="Padding" Value="0,0,9,0"/>
+ <Setter Property="HorizontalAlignment" Value="Stretch"/>
+ <Setter Property="HorizontalContentAlignment" Value="Right"/>
+ <Setter Property="VerticalAlignment" Value="Stretch"/>
+ <Setter Property="VerticalContentAlignment" Value="Top"/>
+ <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}"/>
+ <Setter Property="FontWeight" Value="SemiBold"/>
+ <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}"/>
+ <Setter Property="Width" Value="{ThemeResource AppBarExpandButtonThemeWidth}"/>
+ <Setter Property="UseSystemFocusVisuals" Value="True"/>
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate TargetType="Button">
+ <Grid>
+ <VisualStateManager.VisualStateGroups>
+ <VisualStateGroup x:Name="CommonStates">
+ <VisualState x:Name="Normal"/>
+ <VisualState x:Name="PointerOver">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="ContentPresenter">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightListLowBrush}"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentPresenter">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAltBaseHighBrush}"/>
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ <VisualState x:Name="Pressed">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="ContentPresenter">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightListMediumBrush}"/>
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ <VisualState x:Name="Disabled">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentPresenter">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledBaseLowBrush}"/>
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ </VisualStateGroup>
+ </VisualStateManager.VisualStateGroups>
+ <ContentPresenter x:Name="ContentPresenter" AutomationProperties.AccessibilityView="Raw" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" ContentTemplate="{TemplateBinding ContentTemplate}" ContentTransitions="{TemplateBinding ContentTransitions}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
+ </Grid>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
+ <Style x:Key="FormsCommandBarStyle" TargetType="uwp:FormsCommandBar">
+ <Setter Property="Background" Value="{ThemeResource SystemControlBackgroundChromeMediumBrush}"/>
+ <Setter Property="Foreground" Value="{ThemeResource SystemControlForegroundBaseHighBrush}"/>
+ <Setter Property="IsTabStop" Value="False"/>
+ <Setter Property="VerticalAlignment" Value="Top"/>
+ <Setter Property="HorizontalAlignment" Value="Stretch"/>
+ <Setter Property="HorizontalContentAlignment" Value="Left"/>
+ <Setter Property="VerticalContentAlignment" Value="Top"/>
+ <Setter Property="ClosedDisplayMode" Value="Compact"/>
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate TargetType="uwp:FormsCommandBar">
+ <Grid x:Name="LayoutRoot" Background="{TemplateBinding Background}">
+ <Grid.Clip>
+ <RectangleGeometry Rect="{Binding TemplateSettings.ClipRect, RelativeSource={RelativeSource Mode=TemplatedParent}}">
+ <RectangleGeometry.Transform>
+ <TranslateTransform x:Name="ClipGeometryTransform" Y="{Binding TemplateSettings.CompactVerticalDelta, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ </RectangleGeometry.Transform>
+ </RectangleGeometry>
+ </Grid.Clip>
+ <VisualStateManager.VisualStateGroups>
+ <VisualStateGroup x:Name="CommonStates">
+ <VisualState x:Name="Normal"/>
+ <VisualState x:Name="Disabled">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="EllipsisIcon">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledBaseLowBrush}"/>
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ </VisualStateGroup>
+ <VisualStateGroup x:Name="DisplayModeStates">
+ <VisualStateGroup.Transitions>
+ <VisualTransition From="CompactClosed" GeneratedDuration="0:0:0.667" To="CompactOpenUp">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="VerticalAlignment" Storyboard.TargetName="MoreButton">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Stretch"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="HighContrastBorder">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Rect" Storyboard.TargetName="OverflowContentRootClip">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{Binding CommandBarTemplateSettings.OverflowContentClipRect, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ </ObjectAnimationUsingKeyFrames>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="OverflowContentRootTransform">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="{Binding CommandBarTemplateSettings.NegativeOverflowContentHeight, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ </DoubleAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsEnabled" Storyboard.TargetName="SecondaryItemsControl">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="True"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="OverflowPopupOffsetTransform">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1"/>
+ </ObjectAnimationUsingKeyFrames>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="ContentTransform">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="0"/>
+ <SplineDoubleKeyFrame KeySpline="0.1,0.9 0.2,1.0" KeyTime="0:0:0.667" Value="{Binding TemplateSettings.CompactVerticalDelta, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ </DoubleAnimationUsingKeyFrames>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="OverflowContentTransform">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="{Binding CommandBarTemplateSettings.OverflowContentHeight, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ <SplineDoubleKeyFrame KeySpline="0.1,0.9 0.2,1.0" KeyTime="0:0:0.667" Value="0"/>
+ </DoubleAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualTransition>
+ <VisualTransition From="CompactOpenUp" GeneratedDuration="0:0:0.167" To="CompactClosed">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="VerticalAlignment" Storyboard.TargetName="MoreButton">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Stretch"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="HighContrastBorder">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Rect" Storyboard.TargetName="OverflowContentRootClip">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{Binding CommandBarTemplateSettings.OverflowContentClipRect, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ </ObjectAnimationUsingKeyFrames>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="OverflowContentRootTransform">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="{Binding CommandBarTemplateSettings.NegativeOverflowContentHeight, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ </DoubleAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsEnabled" Storyboard.TargetName="SecondaryItemsControl">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="True"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="OverflowPopupOffsetTransform">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1"/>
+ </ObjectAnimationUsingKeyFrames>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="ContentTransform">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.CompactVerticalDelta, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ <SplineDoubleKeyFrame KeySpline="0.9,0.1 0.2,1.0" KeyTime="0:0:0.167" Value="0"/>
+ </DoubleAnimationUsingKeyFrames>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="OverflowContentTransform">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="0"/>
+ <SplineDoubleKeyFrame KeySpline="0.9,0.1 0.2,1.0" KeyTime="0:0:0.167" Value="{Binding CommandBarTemplateSettings.OverflowContentHeight, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ </DoubleAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualTransition>
+ <VisualTransition From="CompactClosed" GeneratedDuration="0:0:0.667" To="CompactOpenDown">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="VerticalAlignment" Storyboard.TargetName="MoreButton">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Stretch"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="HighContrastBorder">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Rect" Storyboard.TargetName="OverflowContentRootClip">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{Binding CommandBarTemplateSettings.OverflowContentClipRect, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsEnabled" Storyboard.TargetName="SecondaryItemsControl">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="True"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="OverflowPopupOffsetTransform">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="-1"/>
+ </ObjectAnimationUsingKeyFrames>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="ClipGeometryTransform">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.CompactVerticalDelta, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ <SplineDoubleKeyFrame KeySpline="0.1,0.9 0.2,1.0" KeyTime="0:0:0.667" Value="0"/>
+ </DoubleAnimationUsingKeyFrames>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="OverflowContentRootTransform">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="{ThemeResource AppBarThemeCompactHeight}"/>
+ <SplineDoubleKeyFrame KeySpline="0.1,0.9 0.2,1.0" KeyTime="0:0:0.667" Value="{Binding CommandBarTemplateSettings.ContentHeight, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ </DoubleAnimationUsingKeyFrames>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="OverflowContentTransform">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="{Binding CommandBarTemplateSettings.NegativeOverflowContentHeight, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ <SplineDoubleKeyFrame KeySpline="0.1,0.9 0.2,1.0" KeyTime="0:0:0.667" Value="0"/>
+ </DoubleAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualTransition>
+ <VisualTransition From="CompactOpenDown" GeneratedDuration="0:0:0.167" To="CompactClosed">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="VerticalAlignment" Storyboard.TargetName="MoreButton">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Stretch"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="HighContrastBorder">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Rect" Storyboard.TargetName="OverflowContentRootClip">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{Binding CommandBarTemplateSettings.OverflowContentClipRect, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsEnabled" Storyboard.TargetName="SecondaryItemsControl">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="True"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="OverflowPopupOffsetTransform">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="-1"/>
+ </ObjectAnimationUsingKeyFrames>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="ClipGeometryTransform">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="0"/>
+ <SplineDoubleKeyFrame KeySpline="0.9,0.1 0.2,1.0" KeyTime="0:0:0.167" Value="{Binding TemplateSettings.CompactVerticalDelta, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ </DoubleAnimationUsingKeyFrames>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="OverflowContentRootTransform">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="{Binding CommandBarTemplateSettings.ContentHeight, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ <SplineDoubleKeyFrame KeySpline="0.9,0.1 0.2,1.0" KeyTime="0:0:0.167" Value="{ThemeResource AppBarThemeCompactHeight}"/>
+ </DoubleAnimationUsingKeyFrames>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="OverflowContentTransform">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="0"/>
+ <SplineDoubleKeyFrame KeySpline="0.9,0.1 0.2,1.0" KeyTime="0:0:0.167" Value="{Binding CommandBarTemplateSettings.NegativeOverflowContentHeight, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ </DoubleAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualTransition>
+ <VisualTransition From="MinimalClosed" GeneratedDuration="0:0:0.667" To="MinimalOpenUp">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Padding" Storyboard.TargetName="MoreButton">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="16,11,16,0"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="MinHeight" Storyboard.TargetName="MoreButton">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{ThemeResource AppBarThemeMinimalHeight}"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="VerticalAlignment" Storyboard.TargetName="MoreButton">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Stretch"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="HighContrastBorder">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/>
+ </ObjectAnimationUsingKeyFrames>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="ClipGeometryTransform">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.MinimalVerticalDelta, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ </DoubleAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Rect" Storyboard.TargetName="OverflowContentRootClip">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{Binding CommandBarTemplateSettings.OverflowContentClipRect, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ </ObjectAnimationUsingKeyFrames>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="OverflowContentRootTransform">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="{Binding CommandBarTemplateSettings.NegativeOverflowContentHeight, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ </DoubleAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsEnabled" Storyboard.TargetName="SecondaryItemsControl">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="True"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="OverflowPopupOffsetTransform">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1"/>
+ </ObjectAnimationUsingKeyFrames>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="ContentTransform">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="0"/>
+ <SplineDoubleKeyFrame KeySpline="0.1,0.9 0.2,1.0" KeyTime="0:0:0.667" Value="{Binding TemplateSettings.MinimalVerticalDelta, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ </DoubleAnimationUsingKeyFrames>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="ContentControl">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="0"/>
+ <SplineDoubleKeyFrame KeySpline="0.1,0.9 0.2,1.0" KeyTime="0:0:0.667" Value="1"/>
+ </DoubleAnimationUsingKeyFrames>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PrimaryItemsControl">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="0"/>
+ <SplineDoubleKeyFrame KeySpline="0.1,0.9 0.2,1.0" KeyTime="0:0:0.667" Value="1"/>
+ </DoubleAnimationUsingKeyFrames>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="OverflowContentTransform">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="{Binding CommandBarTemplateSettings.OverflowContentHeight, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ <SplineDoubleKeyFrame KeySpline="0.1,0.9 0.2,1.0" KeyTime="0:0:0.667" Value="0"/>
+ </DoubleAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualTransition>
+ <VisualTransition From="MinimalOpenUp" GeneratedDuration="0:0:0.167" To="MinimalClosed">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Padding" Storyboard.TargetName="MoreButton">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="16,11,16,0"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="MinHeight" Storyboard.TargetName="MoreButton">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{ThemeResource AppBarThemeMinimalHeight}"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="VerticalAlignment" Storyboard.TargetName="MoreButton">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Stretch"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="HighContrastBorder">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/>
+ </ObjectAnimationUsingKeyFrames>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="ClipGeometryTransform">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.MinimalVerticalDelta, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ </DoubleAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Rect" Storyboard.TargetName="OverflowContentRootClip">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{Binding CommandBarTemplateSettings.OverflowContentClipRect, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ </ObjectAnimationUsingKeyFrames>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="OverflowContentRootTransform">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="{Binding CommandBarTemplateSettings.NegativeOverflowContentHeight, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ </DoubleAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsEnabled" Storyboard.TargetName="SecondaryItemsControl">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="True"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="OverflowPopupOffsetTransform">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1"/>
+ </ObjectAnimationUsingKeyFrames>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="ContentTransform">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.MinimalVerticalDelta, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ <SplineDoubleKeyFrame KeySpline="0.9,0.1 0.2,1.0" KeyTime="0:0:0.167" Value="0"/>
+ </DoubleAnimationUsingKeyFrames>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="ContentControl">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="1"/>
+ <SplineDoubleKeyFrame KeySpline="0.9,0.1 0.2,1.0" KeyTime="0:0:0.167" Value="0"/>
+ </DoubleAnimationUsingKeyFrames>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PrimaryItemsControl">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="1"/>
+ <SplineDoubleKeyFrame KeySpline="0.9,0.1 0.2,1.0" KeyTime="0:0:0.167" Value="0"/>
+ </DoubleAnimationUsingKeyFrames>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="OverflowContentTransform">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="0"/>
+ <SplineDoubleKeyFrame KeySpline="0.9,0.1 0.2,1.0" KeyTime="0:0:0.167" Value="{Binding CommandBarTemplateSettings.OverflowContentHeight, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ </DoubleAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualTransition>
+ <VisualTransition From="MinimalClosed" GeneratedDuration="0:0:0.667" To="MinimalOpenDown">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Padding" Storyboard.TargetName="MoreButton">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="16,11,16,0"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="MinHeight" Storyboard.TargetName="MoreButton">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{ThemeResource AppBarThemeMinimalHeight}"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="VerticalAlignment" Storyboard.TargetName="MoreButton">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Stretch"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="HighContrastBorder">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Rect" Storyboard.TargetName="OverflowContentRootClip">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{Binding CommandBarTemplateSettings.OverflowContentClipRect, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsEnabled" Storyboard.TargetName="SecondaryItemsControl">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="True"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="OverflowPopupOffsetTransform">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="-1"/>
+ </ObjectAnimationUsingKeyFrames>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="ClipGeometryTransform">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.MinimalVerticalDelta, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ <SplineDoubleKeyFrame KeySpline="0.1,0.9 0.2,1.0" KeyTime="0:0:0.667" Value="0"/>
+ </DoubleAnimationUsingKeyFrames>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="ContentControl">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="0"/>
+ <SplineDoubleKeyFrame KeySpline="0.1,0.9 0.2,1.0" KeyTime="0:0:0.667" Value="1"/>
+ </DoubleAnimationUsingKeyFrames>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PrimaryItemsControl">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="0"/>
+ <SplineDoubleKeyFrame KeySpline="0.1,0.9 0.2,1.0" KeyTime="0:0:0.667" Value="1"/>
+ </DoubleAnimationUsingKeyFrames>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="OverflowContentRootTransform">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="{ThemeResource AppBarThemeMinimalHeight}"/>
+ <SplineDoubleKeyFrame KeySpline="0.1,0.9 0.2,1.0" KeyTime="0:0:0.667" Value="{Binding CommandBarTemplateSettings.ContentHeight, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ </DoubleAnimationUsingKeyFrames>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="OverflowContentTransform">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="{Binding CommandBarTemplateSettings.NegativeOverflowContentHeight, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ <SplineDoubleKeyFrame KeySpline="0.1,0.9 0.2,1.0" KeyTime="0:0:0.667" Value="0"/>
+ </DoubleAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualTransition>
+ <VisualTransition From="MinimalOpenDown" GeneratedDuration="0:0:0.167" To="MinimalClosed">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Padding" Storyboard.TargetName="MoreButton">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="16,11,16,0"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="MinHeight" Storyboard.TargetName="MoreButton">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{ThemeResource AppBarThemeMinimalHeight}"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="VerticalAlignment" Storyboard.TargetName="MoreButton">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Stretch"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="HighContrastBorder">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Rect" Storyboard.TargetName="OverflowContentRootClip">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{Binding CommandBarTemplateSettings.OverflowContentClipRect, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsEnabled" Storyboard.TargetName="SecondaryItemsControl">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="True"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="OverflowPopupOffsetTransform">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="-1"/>
+ </ObjectAnimationUsingKeyFrames>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="ClipGeometryTransform">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="0"/>
+ <SplineDoubleKeyFrame KeySpline="0.9,0.1 0.2,1.0" KeyTime="0:0:0.167" Value="{Binding TemplateSettings.MinimalVerticalDelta, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ </DoubleAnimationUsingKeyFrames>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="ContentControl">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="1"/>
+ <SplineDoubleKeyFrame KeySpline="0.9,0.1 0.2,1.0" KeyTime="0:0:0.167" Value="0"/>
+ </DoubleAnimationUsingKeyFrames>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PrimaryItemsControl">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="1"/>
+ <SplineDoubleKeyFrame KeySpline="0.9,0.1 0.2,1.0" KeyTime="0:0:0.167" Value="0"/>
+ </DoubleAnimationUsingKeyFrames>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="OverflowContentRootTransform">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="{Binding CommandBarTemplateSettings.ContentHeight, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ <SplineDoubleKeyFrame KeySpline="0.9,0.1 0.2,1.0" KeyTime="0:0:0.167" Value="{ThemeResource AppBarThemeMinimalHeight}"/>
+ </DoubleAnimationUsingKeyFrames>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="OverflowContentTransform">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="0"/>
+ <SplineDoubleKeyFrame KeySpline="0.9,0.1 0.2,1.0" KeyTime="0:0:0.167" Value="{Binding CommandBarTemplateSettings.NegativeOverflowContentHeight, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ </DoubleAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualTransition>
+ <VisualTransition From="HiddenClosed" GeneratedDuration="0:0:0.667" To="HiddenOpenUp">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="VerticalAlignment" Storyboard.TargetName="MoreButton">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Stretch"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="HighContrastBorder">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/>
+ </ObjectAnimationUsingKeyFrames>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="ClipGeometryTransform">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.HiddenVerticalDelta, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ </DoubleAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Rect" Storyboard.TargetName="OverflowContentRootClip">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{Binding CommandBarTemplateSettings.OverflowContentClipRect, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ </ObjectAnimationUsingKeyFrames>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="OverflowContentRootTransform">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="{Binding CommandBarTemplateSettings.NegativeOverflowContentHeight, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ </DoubleAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsEnabled" Storyboard.TargetName="SecondaryItemsControl">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="True"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="OverflowPopupOffsetTransform">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1"/>
+ </ObjectAnimationUsingKeyFrames>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="ContentTransform">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="0"/>
+ <SplineDoubleKeyFrame KeySpline="0.1,0.9 0.2,1.0" KeyTime="0:0:0.667" Value="{Binding TemplateSettings.HiddenVerticalDelta, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ </DoubleAnimationUsingKeyFrames>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="OverflowContentTransform">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="{Binding CommandBarTemplateSettings.OverflowContentHeight, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ <SplineDoubleKeyFrame KeySpline="0.1,0.9 0.2,1.0" KeyTime="0:0:0.667" Value="0"/>
+ </DoubleAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualTransition>
+ <VisualTransition From="HiddenOpenUp" GeneratedDuration="0:0:0.167" To="HiddenClosed">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="VerticalAlignment" Storyboard.TargetName="MoreButton">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Stretch"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="HighContrastBorder">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/>
+ </ObjectAnimationUsingKeyFrames>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="ClipGeometryTransform">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.HiddenVerticalDelta, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ </DoubleAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Rect" Storyboard.TargetName="OverflowContentRootClip">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{Binding CommandBarTemplateSettings.OverflowContentClipRect, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ </ObjectAnimationUsingKeyFrames>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="OverflowContentRootTransform">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="{Binding CommandBarTemplateSettings.NegativeOverflowContentHeight, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ </DoubleAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsEnabled" Storyboard.TargetName="SecondaryItemsControl">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="True"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="OverflowPopupOffsetTransform">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1"/>
+ </ObjectAnimationUsingKeyFrames>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="ContentTransform">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.HiddenVerticalDelta, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ <SplineDoubleKeyFrame KeySpline="0.1,0.9 0.2,1.0" KeyTime="0:0:0.167" Value="0}"/>
+ </DoubleAnimationUsingKeyFrames>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="OverflowContentTransform">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="0"/>
+ <SplineDoubleKeyFrame KeySpline="0.9,0.1 0.2,1.0" KeyTime="0:0:0.167" Value="{Binding CommandBarTemplateSettings.OverflowContentHeight, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ </DoubleAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualTransition>
+ <VisualTransition From="HiddenClosed" GeneratedDuration="0:0:0.667" To="HiddenOpenDown">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="VerticalAlignment" Storyboard.TargetName="MoreButton">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Stretch"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="HighContrastBorder">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Rect" Storyboard.TargetName="OverflowContentRootClip">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{Binding CommandBarTemplateSettings.OverflowContentClipRect, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsEnabled" Storyboard.TargetName="SecondaryItemsControl">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="True"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="OverflowPopupOffsetTransform">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="-1"/>
+ </ObjectAnimationUsingKeyFrames>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="ClipGeometryTransform">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.HiddenVerticalDelta, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ <SplineDoubleKeyFrame KeySpline="0.1,0.9 0.2,1.0" KeyTime="0:0:0.667" Value="0"/>
+ </DoubleAnimationUsingKeyFrames>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="OverflowContentRootTransform">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="0"/>
+ <SplineDoubleKeyFrame KeySpline="0.1,0.9 0.2,1.0" KeyTime="0:0:0.667" Value="{Binding CommandBarTemplateSettings.ContentHeight, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ </DoubleAnimationUsingKeyFrames>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="OverflowContentTransform">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="{Binding CommandBarTemplateSettings.NegativeOverflowContentHeight, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ <SplineDoubleKeyFrame KeySpline="0.1,0.9 0.2,1.0" KeyTime="0:0:0.667" Value="0"/>
+ </DoubleAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualTransition>
+ <VisualTransition From="HiddenOpenDown" GeneratedDuration="0:0:0.167" To="HiddenClosed">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="VerticalAlignment" Storyboard.TargetName="MoreButton">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Stretch"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="HighContrastBorder">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Rect" Storyboard.TargetName="OverflowContentRootClip">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{Binding CommandBarTemplateSettings.OverflowContentClipRect, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsEnabled" Storyboard.TargetName="SecondaryItemsControl">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="True"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="OverflowPopupOffsetTransform">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="-1"/>
+ </ObjectAnimationUsingKeyFrames>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="ClipGeometryTransform">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="0"/>
+ <SplineDoubleKeyFrame KeySpline="0.9,0.1 0.2,1.0" KeyTime="0:0:0.167" Value="{Binding TemplateSettings.HiddenVerticalDelta, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ </DoubleAnimationUsingKeyFrames>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="OverflowContentRootTransform">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="{Binding CommandBarTemplateSettings.ContentHeight, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ <SplineDoubleKeyFrame KeySpline="0.9,0.1 0.2,1.0" KeyTime="0:0:0.167" Value="0"/>
+ </DoubleAnimationUsingKeyFrames>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="OverflowContentTransform">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="0"/>
+ <SplineDoubleKeyFrame KeySpline="0.9,0.1 0.2,1.0" KeyTime="0:0:0.167" Value="{Binding CommandBarTemplateSettings.NegativeOverflowContentHeight, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ </DoubleAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualTransition>
+ </VisualStateGroup.Transitions>
+ <VisualState x:Name="CompactClosed"/>
+ <VisualState x:Name="CompactOpenUp">
+ <Storyboard>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="ContentTransform">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.CompactVerticalDelta, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ </DoubleAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="VerticalAlignment" Storyboard.TargetName="MoreButton">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Stretch"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="HighContrastBorder">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Rect" Storyboard.TargetName="OverflowContentRootClip">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{Binding CommandBarTemplateSettings.OverflowContentClipRect, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ </ObjectAnimationUsingKeyFrames>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="OverflowContentRootTransform">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="{Binding CommandBarTemplateSettings.NegativeOverflowContentHeight, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ </DoubleAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsEnabled" Storyboard.TargetName="SecondaryItemsControl">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="True"/>
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ <VisualState x:Name="CompactOpenDown">
+ <Storyboard>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="ClipGeometryTransform">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="0"/>
+ </DoubleAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="VerticalAlignment" Storyboard.TargetName="MoreButton">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Stretch"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="HighContrastBorder">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Rect" Storyboard.TargetName="OverflowContentRootClip">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{Binding CommandBarTemplateSettings.OverflowContentClipRect, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ </ObjectAnimationUsingKeyFrames>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="OverflowContentRootTransform">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="{Binding CommandBarTemplateSettings.ContentHeight, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ </DoubleAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsEnabled" Storyboard.TargetName="SecondaryItemsControl">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="True"/>
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ <VisualState x:Name="MinimalClosed">
+ <Storyboard>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="ClipGeometryTransform">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.MinimalVerticalDelta, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ </DoubleAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsHitTestVisible" Storyboard.TargetName="ContentControl">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="False"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsEnabled" Storyboard.TargetName="ContentControl">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="False"/>
+ </ObjectAnimationUsingKeyFrames>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="ContentControl">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="0"/>
+ </DoubleAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Padding" Storyboard.TargetName="MoreButton">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="16,11,16,0"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="MinHeight" Storyboard.TargetName="MoreButton">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{ThemeResource AppBarThemeMinimalHeight}"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsHitTestVisible" Storyboard.TargetName="PrimaryItemsControl">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="False"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsEnabled" Storyboard.TargetName="PrimaryItemsControl">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="False"/>
+ </ObjectAnimationUsingKeyFrames>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PrimaryItemsControl">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="0"/>
+ </DoubleAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ <VisualState x:Name="MinimalOpenUp">
+ <Storyboard>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="ClipGeometryTransform">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.MinimalVerticalDelta, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ </DoubleAnimationUsingKeyFrames>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="ContentTransform">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.MinimalVerticalDelta, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ </DoubleAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Padding" Storyboard.TargetName="MoreButton">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="16,11,16,0"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="MinHeight" Storyboard.TargetName="MoreButton">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{ThemeResource AppBarThemeMinimalHeight}"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="VerticalAlignment" Storyboard.TargetName="MoreButton">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Stretch"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="HighContrastBorder">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Rect" Storyboard.TargetName="OverflowContentRootClip">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{Binding CommandBarTemplateSettings.OverflowContentClipRect, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ </ObjectAnimationUsingKeyFrames>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="OverflowContentRootTransform">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="{Binding CommandBarTemplateSettings.NegativeOverflowContentHeight, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ </DoubleAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsEnabled" Storyboard.TargetName="SecondaryItemsControl">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="True"/>
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ <VisualState x:Name="MinimalOpenDown">
+ <Storyboard>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="ClipGeometryTransform">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="0"/>
+ </DoubleAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Padding" Storyboard.TargetName="MoreButton">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="16,11,16,0"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="MinHeight" Storyboard.TargetName="MoreButton">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{ThemeResource AppBarThemeMinimalHeight}"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="VerticalAlignment" Storyboard.TargetName="MoreButton">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Stretch"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="HighContrastBorder">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Rect" Storyboard.TargetName="OverflowContentRootClip">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{Binding CommandBarTemplateSettings.OverflowContentClipRect, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ </ObjectAnimationUsingKeyFrames>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="OverflowContentRootTransform">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="{Binding CommandBarTemplateSettings.ContentHeight, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ </DoubleAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsEnabled" Storyboard.TargetName="SecondaryItemsControl">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="True"/>
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ <VisualState x:Name="HiddenClosed">
+ <Storyboard>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="ClipGeometryTransform">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.HiddenVerticalDelta, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ </DoubleAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsTabStop" Storyboard.TargetName="MoreButton">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="False"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsEnabled" Storyboard.TargetName="ContentControl">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="False"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsEnabled" Storyboard.TargetName="PrimaryItemsControl">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="False"/>
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ <VisualState x:Name="HiddenOpenUp">
+ <Storyboard>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="ClipGeometryTransform">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.HiddenVerticalDelta, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ </DoubleAnimationUsingKeyFrames>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="ContentTransform">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.HiddenVerticalDelta, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ </DoubleAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="VerticalAlignment" Storyboard.TargetName="MoreButton">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Stretch"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="HighContrastBorder">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Rect" Storyboard.TargetName="OverflowContentRootClip">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{Binding CommandBarTemplateSettings.OverflowContentClipRect, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ </ObjectAnimationUsingKeyFrames>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="OverflowContentRootTransform">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="{Binding CommandBarTemplateSettings.NegativeOverflowContentHeight, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ </DoubleAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsEnabled" Storyboard.TargetName="SecondaryItemsControl">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="True"/>
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ <VisualState x:Name="HiddenOpenDown">
+ <Storyboard>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="ClipGeometryTransform">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="0"/>
+ </DoubleAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="VerticalAlignment" Storyboard.TargetName="MoreButton">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Stretch"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="HighContrastBorder">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Rect" Storyboard.TargetName="OverflowContentRootClip">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{Binding CommandBarTemplateSettings.OverflowContentClipRect, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ </ObjectAnimationUsingKeyFrames>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Y" Storyboard.TargetName="OverflowContentRootTransform">
+ <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="{Binding CommandBarTemplateSettings.ContentHeight, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ </DoubleAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsEnabled" Storyboard.TargetName="SecondaryItemsControl">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="True"/>
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ </VisualStateGroup>
+ <VisualStateGroup x:Name="AvailableCommandsStates">
+ <VisualState x:Name="BothCommands"/>
+ <VisualState x:Name="PrimaryCommandsOnly">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="OverflowContentRoot">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Collapsed"/>
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ <VisualState x:Name="SecondaryCommandsOnly">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="PrimaryItemsControl">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Collapsed"/>
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ </VisualStateGroup>
+ </VisualStateManager.VisualStateGroups>
+ <Grid x:Name="ContentRoot" Background="{TemplateBinding Background}" Height="{TemplateBinding Height}" Margin="{TemplateBinding Padding}" Opacity="{TemplateBinding Opacity}" VerticalAlignment="Top">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="*"/>
+ <ColumnDefinition Width="Auto"/>
+ </Grid.ColumnDefinitions>
+ <Grid.RenderTransform>
+ <TranslateTransform x:Name="ContentTransform"/>
+ </Grid.RenderTransform>
+ <Grid>
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="*"/>
+ <ColumnDefinition Width="Auto"/>
+ </Grid.ColumnDefinitions>
+ <ContentControl x:Name="ContentControl" ContentTemplate="{TemplateBinding ContentTemplate}" ContentTransitions="{TemplateBinding ContentTransitions}" Content="{TemplateBinding Content}" Foreground="{TemplateBinding Foreground}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" IsTabStop="False" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
+ <ItemsControl x:Name="PrimaryItemsControl" Grid.Column="1" HorizontalAlignment="Right" IsTabStop="False" MinHeight="{ThemeResource AppBarThemeMinHeight}">
+ <ItemsControl.ItemsPanel>
+ <ItemsPanelTemplate>
+ <StackPanel Orientation="Horizontal"/>
+ </ItemsPanelTemplate>
+ </ItemsControl.ItemsPanel>
+ </ItemsControl>
+ </Grid>
+ <Button x:Name="MoreButton" Grid.Column="1" Foreground="{TemplateBinding Foreground}" MinHeight="{ThemeResource AppBarThemeCompactHeight}" Padding="16,23,16,0" Style="{StaticResource EllipsisButton}" VerticalAlignment="Top">
+ <FontIcon x:Name="EllipsisIcon" FontSize="16" FontFamily="{ThemeResource SymbolThemeFontFamily}" Glyph="&#xE10C;" Height="{ThemeResource AppBarExpandButtonCircleDiameter}" VerticalAlignment="Center"/>
+ </Button>
+ <Popup x:Name="OverflowPopup">
+ <Popup.RenderTransform>
+ <TranslateTransform x:Name="OverflowPopupOffsetTransform"/>
+ </Popup.RenderTransform>
+ <Grid x:Name="OverflowContentRoot" MaxHeight="{Binding CommandBarTemplateSettings.OverflowContentMaxHeight, RelativeSource={RelativeSource Mode=TemplatedParent}}" MinWidth="{Binding CommandBarTemplateSettings.OverflowContentMinWidth, RelativeSource={RelativeSource Mode=TemplatedParent}}">
+ <Grid.Clip>
+ <RectangleGeometry x:Name="OverflowContentRootClip"/>
+ </Grid.Clip>
+ <Grid.RenderTransform>
+ <TranslateTransform x:Name="OverflowContentRootTransform" X="{Binding CommandBarTemplateSettings.OverflowContentHorizontalOffset, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
+ </Grid.RenderTransform>
+ <CommandBarOverflowPresenter x:Name="SecondaryItemsControl" IsTabStop="False" IsEnabled="False" Style="{TemplateBinding CommandBarOverflowPresenterStyle}">
+ <CommandBarOverflowPresenter.ItemContainerStyle>
+ <Style TargetType="FrameworkElement">
+ <Setter Property="HorizontalAlignment" Value="Stretch"/>
+ <Setter Property="Width" Value="NaN"/>
+ </Style>
+ </CommandBarOverflowPresenter.ItemContainerStyle>
+ <CommandBarOverflowPresenter.RenderTransform>
+ <TranslateTransform x:Name="OverflowContentTransform"/>
+ </CommandBarOverflowPresenter.RenderTransform>
+ </CommandBarOverflowPresenter>
+ </Grid>
+ </Popup>
+ <Rectangle x:Name="HighContrastBorder" Grid.ColumnSpan="2" Stroke="{ThemeResource SystemControlForegroundTransparentBrush}" StrokeThickness="1" Visibility="Collapsed" VerticalAlignment="Stretch" x:DeferLoadStrategy="Lazy"/>
+ </Grid>
+ </Grid>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
+</ResourceDictionary>
diff --git a/Xamarin.Forms.Platform.UAP/MasterDetailControl.cs b/Xamarin.Forms.Platform.UAP/MasterDetailControl.cs
index dddd0ba..2357232 100644
--- a/Xamarin.Forms.Platform.UAP/MasterDetailControl.cs
+++ b/Xamarin.Forms.Platform.UAP/MasterDetailControl.cs
@@ -49,8 +49,7 @@ namespace Xamarin.Forms.Platform.UWP
new PropertyMetadata(default(Visibility)));
CommandBar _commandBar;
- Border _bottomCommandBarArea;
- Border _topCommandBarArea;
+ readonly ToolbarPlacementHelper _toolbarPlacementHelper = new ToolbarPlacementHelper();
TaskCompletionSource<CommandBar> _commandBarTcs;
FrameworkElement _masterPresenter;
@@ -174,7 +173,7 @@ namespace Xamarin.Forms.Platform.UWP
set
{
_toolbarPlacement = value;
- UpdateToolbarPlacement();
+ _toolbarPlacementHelper.UpdateToolbarPlacement();
}
}
@@ -236,17 +235,8 @@ namespace Xamarin.Forms.Platform.UWP
_detailPresenter = GetTemplateChild("DetailPresenter") as FrameworkElement;
_commandBar = GetTemplateChild("CommandBar") as CommandBar;
- _bottomCommandBarArea = GetTemplateChild("BottomCommandBarArea") as Border;
- _topCommandBarArea = GetTemplateChild("TopCommandBarArea") as Border;
-
- if (_commandBar != null && _bottomCommandBarArea != null && _topCommandBarArea != null)
- {
- // We have to wait for the command bar to load so that it'll be in the control hierarchy
- // otherwise we can't properly move it to wherever the toolbar is supposed to be
- _commandBar.Loaded += (sender, args) => UpdateToolbarPlacement();
- }
-
- UpdateToolbarPlacement();
+ _toolbarPlacementHelper.Initialize(_commandBar, () => ToolbarPlacement, GetTemplateChild);
+
UpdateMode();
if (_commandBarTcs != null)
@@ -263,11 +253,6 @@ namespace Xamarin.Forms.Platform.UWP
((MasterDetailControl)dependencyObject).UpdateMode();
}
- static void ToolbarPlacementChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs args)
- {
- ((MasterDetailControl)dependencyObject).UpdateToolbarPlacement();
- }
-
static void CollapsedPaneWidthChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs)
{
((MasterDetailControl)dependencyObject).UpdateMode();
@@ -304,10 +289,5 @@ namespace Xamarin.Forms.Platform.UWP
? Visibility.Visible
: Visibility.Collapsed;
}
-
- void UpdateToolbarPlacement()
- {
- ToolbarPlacementHelper.UpdateToolbarPlacement(_commandBar, ToolbarPlacement, _bottomCommandBarArea, _topCommandBarArea);
- }
}
} \ No newline at end of file
diff --git a/Xamarin.Forms.Platform.UAP/MasterDetailControlStyle.xaml b/Xamarin.Forms.Platform.UAP/MasterDetailControlStyle.xaml
index d82f78a..3f13f76 100644
--- a/Xamarin.Forms.Platform.UAP/MasterDetailControlStyle.xaml
+++ b/Xamarin.Forms.Platform.UAP/MasterDetailControlStyle.xaml
@@ -29,29 +29,26 @@
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
- <Grid x:Name="TitleBar" Background="{TemplateBinding ToolbarBackground}" HorizontalAlignment="Stretch">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto"></ColumnDefinition>
- <ColumnDefinition Width="*"></ColumnDefinition>
- </Grid.ColumnDefinitions>
+ <Border x:Name="TopCommandBarArea" HorizontalAlignment="Stretch" Background="{TemplateBinding ToolbarBackground}">
+ <uwp:FormsCommandBar x:Name="CommandBar" Background="{TemplateBinding ToolbarBackground}" MinHeight="{ThemeResource TitleBarHeight}">
+ <uwp:FormsCommandBar.Content>
+ <Border x:Name="TitleArea" Height="{ThemeResource TitleBarHeight}">
+ <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Background="{TemplateBinding ToolbarBackground}" >
- <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Background="{TemplateBinding ToolbarBackground}" >
-
- <Button Name="ContentTogglePane" Style="{ThemeResource PaneButton}" Foreground="{TemplateBinding ToolbarForeground}"
+ <Button Name="ContentTogglePane" Style="{ThemeResource PaneButton}" Foreground="{TemplateBinding ToolbarForeground}"
Visibility="{TemplateBinding ContentTogglePaneButtonVisibility}" />
- <Border Height="{ThemeResource TitleBarHeight}" Visibility="{TemplateBinding DetailTitleVisibility}">
- <TextBlock Text="{TemplateBinding DetailTitle}" VerticalAlignment="Center" Margin="10,0,0,0" Foreground="{TemplateBinding ToolbarForeground}" Style="{ThemeResource TitleTextBlockStyle}" />
- </Border>
-
- </StackPanel>
+ <Border Height="{ThemeResource TitleBarHeight}" Visibility="{TemplateBinding DetailTitleVisibility}">
+ <TextBlock Text="{TemplateBinding DetailTitle}" VerticalAlignment="Center" Margin="10,0,0,0" Foreground="{TemplateBinding ToolbarForeground}" Style="{ThemeResource TitleTextBlockStyle}" />
+ </Border>
- <Border x:Name="TopCommandBarArea" Grid.Column="1" HorizontalAlignment="Stretch">
- <uwp:FormsCommandBar x:Name="CommandBar" VerticalContentAlignment="Top" Background="{TemplateBinding ToolbarBackground}" Height="{ThemeResource TitleBarHeight}" />
- </Border>
- </Grid>
+ </StackPanel>
+ </Border>
+ </uwp:FormsCommandBar.Content>
+ </uwp:FormsCommandBar>
+ </Border>
- <ContentPresenter x:Name="DetailPresenter" Grid.Row="1" Content="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Detail}" />
+ <ContentPresenter x:Name="DetailPresenter" Grid.Row="1" Content="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Detail}" />
<Border x:Name="BottomCommandBarArea" Grid.Row="2" HorizontalAlignment="Stretch"></Border>
</Grid>
diff --git a/Xamarin.Forms.Platform.UAP/PageControlStyle.xaml b/Xamarin.Forms.Platform.UAP/PageControlStyle.xaml
index bd19948..4f3f883 100644
--- a/Xamarin.Forms.Platform.UAP/PageControlStyle.xaml
+++ b/Xamarin.Forms.Platform.UAP/PageControlStyle.xaml
@@ -16,22 +16,17 @@
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
- <Grid x:Name="TitleBar" Background="{TemplateBinding ToolbarBackground}" HorizontalAlignment="Stretch">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto"></ColumnDefinition>
- <ColumnDefinition Width="*"></ColumnDefinition>
- </Grid.ColumnDefinitions>
+ <Border x:Name="TopCommandBarArea" HorizontalAlignment="Stretch" Background="{TemplateBinding ToolbarBackground}">
+ <uwp:FormsCommandBar x:Name="CommandBar" Background="{TemplateBinding ToolbarBackground}" MinHeight="{ThemeResource TitleBarHeight}">
+ <uwp:FormsCommandBar.Content>
+ <Border x:Name="TitleArea" Visibility="{TemplateBinding TitleVisibility}" Height="{ThemeResource TitleBarHeight}">
+ <TextBlock Text="{Binding Title}" TextWrapping="NoWrap" VerticalAlignment="Center" Margin="10,0,0,0" Foreground="{TemplateBinding TitleBrush}" Style="{ThemeResource TitleTextBlockStyle}" />
+ </Border>
+ </uwp:FormsCommandBar.Content>
+ </uwp:FormsCommandBar>
+ </Border>
- <Border Height="{ThemeResource TitleBarHeight}" Visibility="{TemplateBinding TitleVisibility}">
- <TextBlock Text="{Binding Title}" VerticalAlignment="Center" Padding="10,0,0,0" Foreground="{TemplateBinding TitleBrush}" Style="{ThemeResource TitleTextBlockStyle}" />
- </Border>
-
- <Border x:Name="TopCommandBarArea" Grid.Column="1" HorizontalAlignment="Stretch">
- <uwp:FormsCommandBar x:Name="CommandBar" Background="{TemplateBinding ToolbarBackground}" Height="{ThemeResource TitleBarHeight}" />
- </Border>
- </Grid>
-
- <ContentPresenter Margin="{TemplateBinding ContentMargin}" ContentTransitions="{TemplateBinding ContentTransitions}" x:Name="presenter" Grid.Row="1" />
+ <ContentPresenter Margin="{TemplateBinding ContentMargin}" ContentTransitions="{TemplateBinding ContentTransitions}" x:Name="presenter" Grid.Row="1" />
<Border x:Name="BottomCommandBarArea" Grid.Row="2" HorizontalAlignment="Stretch"></Border>
</Grid>
diff --git a/Xamarin.Forms.Platform.UAP/Resources.xaml b/Xamarin.Forms.Platform.UAP/Resources.xaml
index 732283e..1ec6be7 100644
--- a/Xamarin.Forms.Platform.UAP/Resources.xaml
+++ b/Xamarin.Forms.Platform.UAP/Resources.xaml
@@ -5,6 +5,7 @@
x:Class="Xamarin.Forms.Platform.UWP.Resources">
<ResourceDictionary.MergedDictionaries>
+ <ResourceDictionary Source="FormsCommandBarStyle.xaml" />
<ResourceDictionary Source="PageControlStyle.xaml" />
<ResourceDictionary Source="FormsTextBoxStyle.xaml" />
<ResourceDictionary Source="AutoSuggestStyle.xaml" />
diff --git a/Xamarin.Forms.Platform.UAP/TabbedPageStyle.xaml b/Xamarin.Forms.Platform.UAP/TabbedPageStyle.xaml
index 6d54a07..1fda50c 100644
--- a/Xamarin.Forms.Platform.UAP/TabbedPageStyle.xaml
+++ b/Xamarin.Forms.Platform.UAP/TabbedPageStyle.xaml
@@ -64,22 +64,17 @@
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
- <Grid x:Name="TitleBar" Background="{TemplateBinding ToolbarBackground}" HorizontalAlignment="Stretch">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto"></ColumnDefinition>
- <ColumnDefinition Width="*"></ColumnDefinition>
- </Grid.ColumnDefinitions>
+ <Border x:Name="TopCommandBarArea" HorizontalAlignment="Stretch" Background="{TemplateBinding ToolbarBackground}">
+ <uwp:FormsCommandBar x:Name="CommandBar" Background="{TemplateBinding ToolbarBackground}" MinHeight="{ThemeResource TitleBarHeight}">
+ <uwp:FormsCommandBar.Content>
+ <Border x:Name="TitleArea" Visibility="{TemplateBinding TitleVisibility}" Height="{ThemeResource TitleBarHeight}">
+ <TextBlock Text="{Binding Title}" VerticalAlignment="Center" Padding="10,0,0,0" Foreground="Red" Style="{ThemeResource TitleTextBlockStyle}" />
+ </Border>
+ </uwp:FormsCommandBar.Content>
+ </uwp:FormsCommandBar>
+ </Border>
- <Border Height="{ThemeResource TitleBarHeight}" Visibility="{TemplateBinding TitleVisibility}">
- <TextBlock Text="{Binding Title}" VerticalAlignment="Center" Padding="10,0,0,0" Foreground="{TemplateBinding ToolbarForeground}" Style="{ThemeResource TitleTextBlockStyle}" />
- </Border>
-
- <Border x:Name="TopCommandBarArea" Grid.Column="1" HorizontalAlignment="Stretch">
- <uwp:FormsCommandBar x:Name="CommandBar" VerticalContentAlignment="Top" Background="{TemplateBinding ToolbarBackground}" Height="{ThemeResource TitleBarHeight}" />
- </Border>
- </Grid>
-
- <Grid Grid.Row="1">
+ <Grid Grid.Row="1">
<Grid.Resources>
<ControlTemplate x:Key="NextTemplate" TargetType="Button">
<Border x:Name="Root" BorderBrush="{ThemeResource SystemControlForegroundTransparentBrush}" BorderThickness="{ThemeResource PivotNavButtonBorderThemeThickness}" Background="{ThemeResource SystemControlBackgroundBaseMediumLowBrush}">
diff --git a/Xamarin.Forms.Platform.UAP/ToolbarPlacementHelper.cs b/Xamarin.Forms.Platform.UAP/ToolbarPlacementHelper.cs
index 24feecb..1b36010 100644
--- a/Xamarin.Forms.Platform.UAP/ToolbarPlacementHelper.cs
+++ b/Xamarin.Forms.Platform.UAP/ToolbarPlacementHelper.cs
@@ -1,18 +1,50 @@
-using Windows.UI.Xaml.Controls;
+using System;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
using Xamarin.Forms.PlatformConfiguration.WindowsSpecific;
namespace Xamarin.Forms.Platform.UWP
{
internal class ToolbarPlacementHelper
{
- public static void UpdateToolbarPlacement(CommandBar toolbar, ToolbarPlacement toolbarPlacement, Border bottomCommandBarArea, Border topCommandBarArea)
+ Border _bottomCommandBarArea;
+ CommandBar _commandBar;
+ Func<ToolbarPlacement> _getToolbarPlacement;
+ Border _titleArea;
+ Border _topCommandBarArea;
+
+ public void Initialize(CommandBar commandBar, Func<ToolbarPlacement> getToolbarPlacement,
+ Func<string, DependencyObject> getTemplateChild)
+ {
+ _commandBar = commandBar;
+ _getToolbarPlacement = getToolbarPlacement;
+ _bottomCommandBarArea = getTemplateChild("BottomCommandBarArea") as Border;
+ _topCommandBarArea = getTemplateChild("TopCommandBarArea") as Border;
+ _titleArea = getTemplateChild("TitleArea") as Border;
+
+ if (_commandBar != null && _bottomCommandBarArea != null && _topCommandBarArea != null)
+ {
+ // We have to wait for the command bar to load so that it'll be in the control hierarchy
+ // otherwise we can't properly move it to wherever the toolbar is supposed to be
+ _commandBar.Loaded += (sender, args) => UpdateToolbarPlacement();
+ }
+ }
+
+ public void UpdateToolbarPlacement()
{
- if (toolbar == null || bottomCommandBarArea == null || topCommandBarArea == null)
+ if (_commandBar == null || _getToolbarPlacement == null || _bottomCommandBarArea == null ||
+ _topCommandBarArea == null)
{
- // Haven't applied the template yet, so we're not ready to do this
+ // Template hasn't been applied yet, so we're not ready to update the toolbar placement
return;
}
+ UpdateToolbarPlacement(_commandBar, _getToolbarPlacement(), _bottomCommandBarArea, _topCommandBarArea, _titleArea);
+ }
+
+ static void UpdateToolbarPlacement(CommandBar toolbar, ToolbarPlacement toolbarPlacement, Border bottomCommandBarArea,
+ Border topCommandBarArea, Border titleArea)
+ {
// Figure out what's hosting the command bar right now
var current = toolbar.Parent as Border;
@@ -41,6 +73,22 @@ namespace Xamarin.Forms.Platform.UWP
// Remove the command bar from its current host and add it to the new one
current.Child = null;
target.Child = toolbar;
+
+ if (titleArea != null)
+ {
+ if (target == bottomCommandBarArea)
+ {
+ // If the title is hosted in the command bar and we're moving the command bar to the bottom,
+ // put the title into the topCommandBarArea
+ toolbar.Content = null;
+ topCommandBarArea.Child = titleArea;
+ }
+ else
+ {
+ // Put the title back into the command bar
+ toolbar.Content = titleArea;
+ }
+ }
}
}
} \ No newline at end of file
diff --git a/Xamarin.Forms.Platform.UAP/Xamarin.Forms.Platform.UAP.csproj b/Xamarin.Forms.Platform.UAP/Xamarin.Forms.Platform.UAP.csproj
index 4f38306..72c9245 100644
--- a/Xamarin.Forms.Platform.UAP/Xamarin.Forms.Platform.UAP.csproj
+++ b/Xamarin.Forms.Platform.UAP/Xamarin.Forms.Platform.UAP.csproj
@@ -443,6 +443,11 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
+ <Page Include="FormsCommandBarStyle.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Page>
<Page Include="FormsTextBoxStyle.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>