summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.UAP
diff options
context:
space:
mode:
authorJason Smith <jason.smith@xamarin.com>2016-03-22 20:02:25 (GMT)
committerJason Smith <jason.smith@xamarin.com>2016-03-22 23:13:41 (GMT)
commit17fdde66d94155fc62a034fa6658995bef6fd6e5 (patch)
treeb5e5073a2a7b15cdbe826faa5c763e270a505729 /Xamarin.Forms.Platform.UAP
downloadxamarin-forms-17fdde66d94155fc62a034fa6658995bef6fd6e5.zip
xamarin-forms-17fdde66d94155fc62a034fa6658995bef6fd6e5.tar.gz
xamarin-forms-17fdde66d94155fc62a034fa6658995bef6fd6e5.tar.bz2
Initial import
Diffstat (limited to 'Xamarin.Forms.Platform.UAP')
-rw-r--r--Xamarin.Forms.Platform.UAP/FormsCommandBar.cs37
-rw-r--r--Xamarin.Forms.Platform.UAP/FormsTextBoxStyle.xaml199
-rw-r--r--Xamarin.Forms.Platform.UAP/IToolBarForegroundBinder.cs10
-rw-r--r--Xamarin.Forms.Platform.UAP/MasterDetailControl.cs222
-rw-r--r--Xamarin.Forms.Platform.UAP/MasterDetailPageRenderer.cs312
-rw-r--r--Xamarin.Forms.Platform.UAP/PageControl.xaml10
-rw-r--r--Xamarin.Forms.Platform.UAP/Properties/AssemblyInfo.cs60
-rw-r--r--Xamarin.Forms.Platform.UAP/Properties/Xamarin.Forms.Platform.UAP.rd.xml33
-rw-r--r--Xamarin.Forms.Platform.UAP/Resources.xaml1091
-rw-r--r--Xamarin.Forms.Platform.UAP/SearchBarRenderer.cs208
-rw-r--r--Xamarin.Forms.Platform.UAP/StepperControl.cs227
-rw-r--r--Xamarin.Forms.Platform.UAP/TabbedPageRenderer.cs264
-rw-r--r--Xamarin.Forms.Platform.UAP/Xamarin.Forms.Platform.UAP.csproj450
-rw-r--r--Xamarin.Forms.Platform.UAP/project.json16
14 files changed, 3139 insertions, 0 deletions
diff --git a/Xamarin.Forms.Platform.UAP/FormsCommandBar.cs b/Xamarin.Forms.Platform.UAP/FormsCommandBar.cs
new file mode 100644
index 0000000..2ca665a
--- /dev/null
+++ b/Xamarin.Forms.Platform.UAP/FormsCommandBar.cs
@@ -0,0 +1,37 @@
+using Windows.Foundation.Collections;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
+
+namespace Xamarin.Forms.Platform.UWP
+{
+ public class FormsCommandBar : CommandBar
+ {
+ Windows.UI.Xaml.Controls.Button _moreButton;
+
+ public FormsCommandBar()
+ {
+ PrimaryCommands.VectorChanged += OnCommandsChanged;
+ SecondaryCommands.VectorChanged += OnCommandsChanged;
+ }
+
+ protected override void OnApplyTemplate()
+ {
+ base.OnApplyTemplate();
+ _moreButton = GetTemplateChild("MoreButton") as Windows.UI.Xaml.Controls.Button;
+ UpdateMore();
+ }
+
+ void OnCommandsChanged(IObservableVector<ICommandBarElement> sender, IVectorChangedEventArgs args)
+ {
+ UpdateMore();
+ }
+
+ void UpdateMore()
+ {
+ if (_moreButton == null)
+ return;
+
+ _moreButton.Visibility = PrimaryCommands.Count > 0 || SecondaryCommands.Count > 0 ? Visibility.Visible : Visibility.Collapsed;
+ }
+ }
+} \ No newline at end of file
diff --git a/Xamarin.Forms.Platform.UAP/FormsTextBoxStyle.xaml b/Xamarin.Forms.Platform.UAP/FormsTextBoxStyle.xaml
new file mode 100644
index 0000000..c573552
--- /dev/null
+++ b/Xamarin.Forms.Platform.UAP/FormsTextBoxStyle.xaml
@@ -0,0 +1,199 @@
+<ResourceDictionary
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:uwp="using:Xamarin.Forms.Platform.UWP">
+
+ <uwp:TextAlignmentToHorizontalAlignmentConverter x:Key="AlignmentConverter" />
+ <Style x:Key="FormsTextBoxStyle" TargetType="uwp:FormsTextBox">
+ <Setter Property="MinWidth" Value="{ThemeResource TextControlThemeMinWidth}" />
+ <Setter Property="MinHeight" Value="{ThemeResource TextControlThemeMinHeight}" />
+ <Setter Property="Foreground" Value="{ThemeResource SystemControlForegroundBaseHighBrush}" />
+ <Setter Property="Background" Value="{ThemeResource SystemControlBackgroundAltHighBrush}" />
+ <Setter Property="BackgroundFocusBrush" Value="{ThemeResource SystemControlBackgroundChromeWhiteBrush}" />
+ <Setter Property="BorderBrush" Value="{ThemeResource SystemControlForegroundChromeDisabledLowBrush}" />
+ <Setter Property="SelectionHighlightColor" Value="{ThemeResource SystemControlHighlightAccentBrush}" />
+ <Setter Property="BorderThickness" Value="{ThemeResource TextControlBorderThemeThickness}" />
+ <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" />
+ <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" />
+ <Setter Property="PlaceholderForegroundBrush" Value="{ThemeResource SystemControlPageTextBaseMediumBrush}" />
+ <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Hidden" />
+ <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Hidden" />
+ <Setter Property="ScrollViewer.IsDeferredScrollingEnabled" Value="False" />
+ <Setter Property="Padding" Value="{ThemeResource TextControlThemePadding}" />
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate TargetType="uwp:FormsTextBox">
+ <Grid>
+ <Grid.Resources>
+ <Style x:Name="DeleteButtonStyle" TargetType="Button">
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate TargetType="Button">
+ <Grid x:Name="ButtonLayoutGrid" BorderBrush="{ThemeResource TextBoxButtonBorderThemeBrush}"
+ BorderThickness="{TemplateBinding BorderThickness}"
+ Background="{ThemeResource TextBoxButtonBackgroundThemeBrush}">
+ <VisualStateManager.VisualStateGroups>
+ <VisualStateGroup x:Name="CommonStates">
+ <VisualState x:Name="Normal" />
+ <VisualState x:Name="PointerOver">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground"
+ Storyboard.TargetName="GlyphElement">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAccentBrush}" />
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ <VisualState x:Name="Pressed">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background"
+ Storyboard.TargetName="ButtonLayoutGrid">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAccentBrush}" />
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground"
+ Storyboard.TargetName="GlyphElement">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAltChromeWhiteBrush}" />
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ <VisualState x:Name="Disabled">
+ <Storyboard>
+ <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="Opacity"
+ Storyboard.TargetName="ButtonLayoutGrid" />
+ </Storyboard>
+ </VisualState>
+ </VisualStateGroup>
+ </VisualStateManager.VisualStateGroups>
+ <TextBlock x:Name="GlyphElement" AutomationProperties.AccessibilityView="Raw"
+ Foreground="{ThemeResource SystemControlForegroundChromeBlackMediumBrush}" FontStyle="Normal"
+ FontSize="12" FontFamily="{ThemeResource SymbolThemeFontFamily}" HorizontalAlignment="Center"
+ Text="&#xE10A;" VerticalAlignment="Center" />
+ </Grid>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
+ </Grid.Resources>
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="*" />
+ <ColumnDefinition Width="Auto" />
+ </Grid.ColumnDefinitions>
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="*" />
+ </Grid.RowDefinitions>
+ <VisualStateManager.VisualStateGroups>
+ <VisualStateGroup x:Name="CommonStates">
+ <VisualState x:Name="Disabled">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground"
+ Storyboard.TargetName="HeaderContentPresenter">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledBaseLowBrush}" />
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background"
+ Storyboard.TargetName="BackgroundElement">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledTransparentBrush}" />
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="BorderElement">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlBackgroundBaseLowBrush}" />
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="BorderElement">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledBaseLowBrush}" />
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentElement">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledChromeDisabledLowBrush}" />
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground"
+ Storyboard.TargetName="PlaceholderTextContentPresenter">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledChromeDisabledLowBrush}" />
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ <VisualState x:Name="Normal" />
+ <VisualState x:Name="PointerOver">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="BorderElement">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightChromeAltLowBrush}" />
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundElement">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlBackgroundHoverOpacity}" />
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ <VisualState x:Name="Focused">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground"
+ Storyboard.TargetName="PlaceholderTextContentPresenter">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlPageTextChromeBlackMediumLowBrush}" />
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background"
+ Storyboard.TargetName="BackgroundElement">
+ <DiscreteObjectKeyFrame KeyTime="0"
+ Value="{Binding BackgroundFocusBrush, RelativeSource={RelativeSource TemplatedParent}}" />
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundElement">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlBackgroundFocusedOpacity}" />
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="BorderElement">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAccentBrush}" />
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentElement">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlForegroundChromeBlackHighBrush}" />
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="RequestedTheme"
+ Storyboard.TargetName="ContentElement">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="Light" />
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ </VisualStateGroup>
+ <VisualStateGroup x:Name="ButtonStates">
+ <VisualState x:Name="ButtonVisible">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="DeleteButton">
+ <DiscreteObjectKeyFrame KeyTime="0">
+ <DiscreteObjectKeyFrame.Value>
+ <Visibility>Visible</Visibility>
+ </DiscreteObjectKeyFrame.Value>
+ </DiscreteObjectKeyFrame>
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ <VisualState x:Name="ButtonCollapsed" />
+ </VisualStateGroup>
+ </VisualStateManager.VisualStateGroups>
+ <Border x:Name="BackgroundElement" Background="{TemplateBinding Background}" Grid.ColumnSpan="2"
+ Margin="{TemplateBinding BorderThickness}" Opacity="{ThemeResource TextControlBackgroundRestOpacity}"
+ Grid.Row="1" Grid.RowSpan="1" />
+ <Border x:Name="BorderElement" BorderBrush="{TemplateBinding BorderBrush}"
+ BorderThickness="{TemplateBinding BorderThickness}" Grid.ColumnSpan="2" Grid.Row="1" Grid.RowSpan="1" />
+ <ContentPresenter x:Name="HeaderContentPresenter" Grid.ColumnSpan="2"
+ ContentTemplate="{TemplateBinding HeaderTemplate}" Content="{TemplateBinding Header}"
+ Foreground="{ThemeResource SystemControlForegroundBaseHighBrush}" FontWeight="Normal"
+ Margin="0,0,0,8" Grid.Row="0" Visibility="Collapsed" x:DeferLoadStrategy="Lazy" />
+ <ScrollViewer x:Name="ContentElement" AutomationProperties.AccessibilityView="Raw"
+ HorizontalScrollMode="{TemplateBinding ScrollViewer.HorizontalScrollMode}"
+ HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
+ IsTabStop="False" IsHorizontalRailEnabled="{TemplateBinding ScrollViewer.IsHorizontalRailEnabled}"
+ IsVerticalRailEnabled="{TemplateBinding ScrollViewer.IsVerticalRailEnabled}"
+ IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}"
+ Margin="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}" Grid.Row="1"
+ VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"
+ VerticalScrollMode="{TemplateBinding ScrollViewer.VerticalScrollMode}" ZoomMode="Disabled" />
+ <ContentControl x:Name="PlaceholderTextContentPresenter" Grid.ColumnSpan="2"
+ Content="{TemplateBinding PlaceholderText}"
+ Foreground="{TemplateBinding PlaceholderForegroundBrush}" IsHitTestVisible="False"
+ IsTabStop="False" Margin="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}"
+ Grid.Row="1"
+ HorizontalAlignment="{Binding TextAlignment,
+ RelativeSource={RelativeSource Mode=TemplatedParent},
+ Converter={StaticResource AlignmentConverter}}" />
+ <Button x:Name="DeleteButton" BorderThickness="{TemplateBinding BorderThickness}" Grid.Column="1"
+ FontSize="{TemplateBinding FontSize}" IsTabStop="False" Margin="{ThemeResource HelperButtonThemePadding}"
+ MinWidth="34" Grid.Row="1" Style="{StaticResource DeleteButtonStyle}" Visibility="Collapsed"
+ VerticalAlignment="Stretch" />
+ </Grid>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
+</ResourceDictionary> \ No newline at end of file
diff --git a/Xamarin.Forms.Platform.UAP/IToolBarForegroundBinder.cs b/Xamarin.Forms.Platform.UAP/IToolBarForegroundBinder.cs
new file mode 100644
index 0000000..21562bd
--- /dev/null
+++ b/Xamarin.Forms.Platform.UAP/IToolBarForegroundBinder.cs
@@ -0,0 +1,10 @@
+using Windows.UI.Xaml.Controls;
+
+namespace Xamarin.Forms.Platform.UWP
+{
+ internal interface IToolBarForegroundBinder
+ {
+ void BindForegroundColor(AppBar appBar);
+ void BindForegroundColor(AppBarButton button);
+ }
+} \ No newline at end of file
diff --git a/Xamarin.Forms.Platform.UAP/MasterDetailControl.cs b/Xamarin.Forms.Platform.UAP/MasterDetailControl.cs
new file mode 100644
index 0000000..9ec03f8
--- /dev/null
+++ b/Xamarin.Forms.Platform.UAP/MasterDetailControl.cs
@@ -0,0 +1,222 @@
+using System.Threading.Tasks;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
+using Windows.UI.Xaml.Media;
+
+namespace Xamarin.Forms.Platform.UWP
+{
+ public class MasterDetailControl : Control, IToolbarProvider
+ {
+ public static readonly DependencyProperty MasterProperty = DependencyProperty.Register("Master", typeof(FrameworkElement), typeof(MasterDetailControl),
+ new PropertyMetadata(default(FrameworkElement)));
+
+ public static readonly DependencyProperty MasterTitleProperty = DependencyProperty.Register("MasterTitle", typeof(string), typeof(MasterDetailControl), new PropertyMetadata(default(string)));
+
+ public static readonly DependencyProperty DetailProperty = DependencyProperty.Register("Detail", typeof(FrameworkElement), typeof(MasterDetailControl),
+ new PropertyMetadata(default(FrameworkElement)));
+
+ public static readonly DependencyProperty IsPaneOpenProperty = DependencyProperty.Register("IsPaneOpen", typeof(bool), typeof(MasterDetailControl), new PropertyMetadata(default(bool)));
+
+ public static readonly DependencyProperty ShouldShowSplitModeProperty = DependencyProperty.Register("ShouldShowSplitMode", typeof(bool), typeof(MasterDetailControl),
+ new PropertyMetadata(default(bool), OnShouldShowSplitModeChanged));
+
+ public static readonly DependencyProperty DetailTitleProperty = DependencyProperty.Register("DetailTitle", typeof(string), typeof(MasterDetailControl), new PropertyMetadata(default(string)));
+
+ public static readonly DependencyProperty ToolbarForegroundProperty = DependencyProperty.Register("ToolbarForeground", typeof(Brush), typeof(MasterDetailControl),
+ new PropertyMetadata(default(Brush)));
+
+ public static readonly DependencyProperty ToolbarBackgroundProperty = DependencyProperty.Register("ToolbarBackground", typeof(Brush), typeof(MasterDetailControl),
+ new PropertyMetadata(default(Brush)));
+
+ public static readonly DependencyProperty MasterTitleVisibilityProperty = DependencyProperty.Register("MasterTitleVisibility", typeof(Visibility), typeof(MasterDetailControl),
+ new PropertyMetadata(default(Visibility)));
+
+ public static readonly DependencyProperty DetailTitleVisibilityProperty = DependencyProperty.Register("DetailTitleVisibility", typeof(Visibility), typeof(MasterDetailControl),
+ new PropertyMetadata(default(Visibility)));
+
+ public static readonly DependencyProperty MasterToolbarVisibilityProperty = DependencyProperty.Register("MasterToolbarVisibility", typeof(Visibility), typeof(MasterDetailControl),
+ new PropertyMetadata(default(Visibility)));
+
+ CommandBar _commandBar;
+
+ TaskCompletionSource<CommandBar> _commandBarTcs;
+ FrameworkElement _masterPresenter;
+ FrameworkElement _detailPresenter;
+ SplitView _split;
+
+ public MasterDetailControl()
+ {
+ DefaultStyleKey = typeof(MasterDetailControl);
+ MasterTitleVisibility = Visibility.Collapsed;
+ DetailTitleVisibility = Visibility.Collapsed;
+ if (Device.Idiom != TargetIdiom.Phone)
+ MasterToolbarVisibility = Visibility.Collapsed;
+ }
+
+ public FrameworkElement Detail
+ {
+ get { return (FrameworkElement)GetValue(DetailProperty); }
+ set { SetValue(DetailProperty, value); }
+ }
+
+ public Windows.Foundation.Size DetailSize
+ {
+ get
+ {
+ double height = ActualHeight;
+ double width = ActualWidth;
+
+ if (_commandBar != null)
+ height -= _commandBar.ActualHeight;
+
+ if (ShouldShowSplitMode && IsPaneOpen)
+ {
+ if (_split != null)
+ width -= _split.OpenPaneLength;
+ else if (_detailPresenter != null)
+ width -= _masterPresenter.ActualWidth;
+ }
+
+ return new Windows.Foundation.Size(width, height);
+ }
+ }
+
+ public string DetailTitle
+ {
+ get { return (string)GetValue(DetailTitleProperty); }
+ set { SetValue(DetailTitleProperty, value); }
+ }
+
+ public Visibility DetailTitleVisibility
+ {
+ get { return (Visibility)GetValue(DetailTitleVisibilityProperty); }
+ set { SetValue(DetailTitleVisibilityProperty, value); }
+ }
+
+ public bool IsPaneOpen
+ {
+ get { return (bool)GetValue(IsPaneOpenProperty); }
+ set { SetValue(IsPaneOpenProperty, value); }
+ }
+
+ public FrameworkElement Master
+ {
+ get { return (FrameworkElement)GetValue(MasterProperty); }
+ set { SetValue(MasterProperty, value); }
+ }
+
+ public Windows.Foundation.Size MasterSize
+ {
+ get
+ {
+ double height = ActualHeight;
+ double width = 0;
+
+ if (_commandBar != null)
+ height -= _commandBar.ActualHeight;
+
+ if (_split != null)
+ width = _split.OpenPaneLength;
+ else if (_masterPresenter != null)
+ width = _masterPresenter.ActualWidth;
+
+ return new Windows.Foundation.Size(width, height);
+ }
+ }
+
+ public string MasterTitle
+ {
+ get { return (string)GetValue(MasterTitleProperty); }
+ set { SetValue(MasterTitleProperty, value); }
+ }
+
+ public Visibility MasterTitleVisibility
+ {
+ get { return (Visibility)GetValue(MasterTitleVisibilityProperty); }
+ set { SetValue(MasterTitleVisibilityProperty, value); }
+ }
+
+ public Visibility MasterToolbarVisibility
+ {
+ get { return (Visibility)GetValue(MasterToolbarVisibilityProperty); }
+ set { SetValue(MasterToolbarVisibilityProperty, value); }
+ }
+
+ public bool ShouldShowSplitMode
+ {
+ get { return (bool)GetValue(ShouldShowSplitModeProperty); }
+ set { SetValue(ShouldShowSplitModeProperty, value); }
+ }
+
+ public Brush ToolbarBackground
+ {
+ get { return (Brush)GetValue(ToolbarBackgroundProperty); }
+ set { SetValue(ToolbarBackgroundProperty, value); }
+ }
+
+ public Brush ToolbarForeground
+ {
+ get { return (Brush)GetValue(ToolbarForegroundProperty); }
+ set { SetValue(ToolbarForegroundProperty, value); }
+ }
+
+ Task<CommandBar> IToolbarProvider.GetCommandBarAsync()
+ {
+ if (_commandBar != null)
+ return Task.FromResult(_commandBar);
+
+ _commandBarTcs = new TaskCompletionSource<CommandBar>();
+ ApplyTemplate();
+ return _commandBarTcs.Task;
+ }
+
+ protected override void OnApplyTemplate()
+ {
+ base.OnApplyTemplate();
+
+ _split = GetTemplateChild("SplitView") as SplitView;
+ if (_split == null)
+ return;
+
+ var paneToggle = GetTemplateChild("PaneTogglePane") as Windows.UI.Xaml.Controls.Button;
+ if (paneToggle != null)
+ paneToggle.Click += OnToggleClicked;
+
+ var contentToggle = GetTemplateChild("ContentTogglePane") as Windows.UI.Xaml.Controls.Button;
+ if (contentToggle != null)
+ contentToggle.Click += OnToggleClicked;
+
+ _masterPresenter = GetTemplateChild("MasterPresenter") as FrameworkElement;
+ _detailPresenter = GetTemplateChild("DetailPresenter") as FrameworkElement;
+
+ _commandBar = GetTemplateChild("CommandBar") as CommandBar;
+
+ UpdateMode();
+
+ TaskCompletionSource<CommandBar> tcs = _commandBarTcs;
+ if (tcs != null)
+ {
+ _commandBarTcs = null;
+ tcs.SetResult(_commandBar);
+ }
+ }
+
+ static void OnShouldShowSplitModeChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
+ {
+ ((MasterDetailControl)dependencyObject).UpdateMode();
+ }
+
+ void OnToggleClicked(object sender, RoutedEventArgs args)
+ {
+ IsPaneOpen = !IsPaneOpen;
+ }
+
+ void UpdateMode()
+ {
+ if (_split == null)
+ return;
+
+ _split.DisplayMode = ShouldShowSplitMode ? SplitViewDisplayMode.Inline : SplitViewDisplayMode.Overlay;
+ }
+ }
+} \ No newline at end of file
diff --git a/Xamarin.Forms.Platform.UAP/MasterDetailPageRenderer.cs b/Xamarin.Forms.Platform.UAP/MasterDetailPageRenderer.cs
new file mode 100644
index 0000000..c8c0978
--- /dev/null
+++ b/Xamarin.Forms.Platform.UAP/MasterDetailPageRenderer.cs
@@ -0,0 +1,312 @@
+using System;
+using System.ComponentModel;
+using System.Threading.Tasks;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Automation;
+using Windows.UI.Xaml.Controls;
+using Windows.UI.Xaml.Data;
+using Windows.UI.Xaml.Media;
+
+namespace Xamarin.Forms.Platform.UWP
+{
+ public class MasterDetailPageRenderer : IVisualElementRenderer, IToolbarProvider, ITitleProvider, IToolBarForegroundBinder
+ {
+ Page _master;
+ Page _detail;
+ bool _showTitle;
+
+ VisualElementTracker<Page, FrameworkElement> _tracker;
+
+ public MasterDetailControl Control { get; private set; }
+
+ public MasterDetailPage Element { get; private set; }
+
+ protected VisualElementTracker<Page, FrameworkElement> Tracker
+ {
+ get { return _tracker; }
+ set
+ {
+ if (_tracker == value)
+ return;
+
+ if (_tracker != null)
+ _tracker.Dispose();
+
+ _tracker = value;
+ }
+ }
+
+ public void Dispose()
+ {
+ ClearMaster();
+ ClearDetail();
+
+ Tracker = null;
+ if (Element != null)
+ SetElement(null);
+ }
+
+ Brush ITitleProvider.BarBackgroundBrush
+ {
+ set { Control.ToolbarBackground = value; }
+ }
+
+ Brush ITitleProvider.BarForegroundBrush
+ {
+ set { Control.ToolbarForeground = value; }
+ }
+
+ bool ITitleProvider.ShowTitle
+ {
+ get { return _showTitle; }
+
+ set
+ {
+ if (_showTitle == value)
+ return;
+ _showTitle = value;
+ if (_showTitle)
+ Control.DetailTitleVisibility = Visibility.Visible;
+ else
+ Control.DetailTitleVisibility = Visibility.Collapsed;
+ }
+ }
+
+ string ITitleProvider.Title
+ {
+ get { return Element?.Title; }
+
+ set
+ {
+ if (Control != null)
+ Control.DetailTitle = value;
+ }
+ }
+
+ Task<CommandBar> IToolbarProvider.GetCommandBarAsync()
+ {
+ return ((IToolbarProvider)Control)?.GetCommandBarAsync();
+ }
+
+ FrameworkElement IVisualElementRenderer.ContainerElement
+ {
+ get { return Control; }
+ }
+
+ VisualElement IVisualElementRenderer.Element
+ {
+ get { return Element; }
+ }
+
+ public event EventHandler<VisualElementChangedEventArgs> ElementChanged;
+
+ public SizeRequest GetDesiredSize(double widthConstraint, double heightConstraint)
+ {
+ Size size = Device.Info.ScaledScreenSize;
+ return new SizeRequest(new Size(size.Width, size.Height));
+ }
+
+ public void SetElement(VisualElement element)
+ {
+ MasterDetailPage old = Element;
+ Element = (MasterDetailPage)element;
+
+ if (element != old)
+ OnElementChanged(new ElementChangedEventArgs<MasterDetailPage>(old, Element));
+ }
+
+ protected virtual void OnElementChanged(ElementChangedEventArgs<MasterDetailPage> e)
+ {
+ if (e.OldElement != null)
+ e.OldElement.PropertyChanged -= OnElementPropertyChanged;
+
+ if (e.NewElement != null)
+ {
+ if (Control == null)
+ {
+ Control = new MasterDetailControl();
+ Control.Loaded += OnControlLoaded;
+ Control.Unloaded += OnControlUnlaoded;
+ Control.SizeChanged += OnNativeSizeChanged;
+
+ Control.RegisterPropertyChangedCallback(MasterDetailControl.IsPaneOpenProperty, OnIsPaneOpenChanged);
+
+ Tracker = new VisualElementTracker<Page, FrameworkElement> { Container = Control, Element = Element };
+ }
+
+ e.NewElement.PropertyChanged += OnElementPropertyChanged;
+ UpdateDetail();
+ UpdateMaster();
+ UpdateMode();
+ UpdateIsPresented();
+
+ if (!string.IsNullOrEmpty(e.NewElement.AutomationId))
+ Control.SetValue(AutomationProperties.AutomationIdProperty, e.NewElement.AutomationId);
+ }
+ }
+
+ protected virtual void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
+ {
+ if (e.PropertyName == MasterDetailPage.IsPresentedProperty.PropertyName)
+ UpdateIsPresented();
+ else if (e.PropertyName == "Master")
+ UpdateMaster();
+ else if (e.PropertyName == "Detail")
+ UpdateDetail();
+ else if (e.PropertyName == "ShouldShowSplitMode")
+ UpdateMode();
+ }
+
+ void ClearDetail()
+ {
+ ((ITitleProvider)this).ShowTitle = false;
+
+ if (_detail == null)
+ return;
+
+ _detail.PropertyChanged -= OnDetailPropertyChanged;
+
+ IVisualElementRenderer renderer = Platform.GetRenderer(_detail);
+ renderer?.Dispose();
+
+ _detail.ClearValue(Platform.RendererProperty);
+ _detail = null;
+ }
+
+ void ClearMaster()
+ {
+ if (_master == null)
+ return;
+
+ _master.PropertyChanged -= OnMasterPropertyChanged;
+
+ IVisualElementRenderer renderer = Platform.GetRenderer(_master);
+ renderer?.Dispose();
+
+ _master.ClearValue(Platform.RendererProperty);
+ _master = null;
+ }
+
+ void OnControlLoaded(object sender, RoutedEventArgs routedEventArgs)
+ {
+ if (Element == null)
+ return;
+
+ Element.SendAppearing();
+ UpdateBounds();
+ }
+
+ void OnControlUnlaoded(object sender, RoutedEventArgs routedEventArgs)
+ {
+ if (Element == null)
+ return;
+
+ Element.SendDisappearing();
+ }
+
+ void OnDetailPropertyChanged(object sender, PropertyChangedEventArgs e)
+ {
+ if (e.PropertyName == Page.TitleProperty.PropertyName || e.PropertyName == NavigationPage.CurrentPageProperty.PropertyName)
+ UpdateDetailTitle();
+ }
+
+ void OnIsPaneOpenChanged(DependencyObject sender, DependencyProperty dp)
+ {
+ ((IElementController)Element).SetValueFromRenderer(MasterDetailPage.IsPresentedProperty, Control.IsPaneOpen);
+ UpdateBounds();
+ }
+
+ void OnMasterPropertyChanged(object sender, PropertyChangedEventArgs e)
+ {
+ if (e.PropertyName == Page.TitleProperty.PropertyName)
+ Control.MasterTitle = _master?.Title;
+ }
+
+ void OnNativeSizeChanged(object sender, SizeChangedEventArgs e)
+ {
+ UpdateBounds();
+ }
+
+ void UpdateBounds()
+ {
+ Windows.Foundation.Size masterSize = Control.MasterSize;
+ Windows.Foundation.Size detailSize = Control.DetailSize;
+
+ Element.MasterBounds = new Rectangle(0, 0, masterSize.Width, masterSize.Height);
+ Element.DetailBounds = new Rectangle(0, 0, detailSize.Width, detailSize.Height);
+ }
+
+ void UpdateDetail()
+ {
+ ClearDetail();
+
+ FrameworkElement element = null;
+
+ _detail = Element.Detail;
+ if (_detail != null)
+ {
+ _detail.PropertyChanged += OnDetailPropertyChanged;
+
+ IVisualElementRenderer renderer = _detail.GetOrCreateRenderer();
+ element = renderer.ContainerElement;
+ }
+
+ Control.Detail = element;
+ UpdateDetailTitle();
+ }
+
+ void UpdateDetailTitle()
+ {
+ if (_detail == null)
+ return;
+
+ Control.DetailTitle = (_detail as NavigationPage)?.CurrentPage?.Title ?? _detail.Title ?? Element?.Title;
+ }
+
+ void UpdateIsPresented()
+ {
+ Control.IsPaneOpen = Element.IsPresented;
+ }
+
+ void UpdateMaster()
+ {
+ ClearMaster();
+
+ FrameworkElement element = null;
+ _master = Element.Master;
+ if (_master != null)
+ {
+ _master.PropertyChanged += OnMasterPropertyChanged;
+
+ IVisualElementRenderer renderer = _master.GetOrCreateRenderer();
+ element = renderer.ContainerElement;
+ }
+
+ Control.Master = element;
+ Control.MasterTitle = _master?.Title;
+ }
+
+ void UpdateMode()
+ {
+ Control.ShouldShowSplitMode = Element.ShouldShowSplitMode;
+ }
+
+#if WINDOWS_UWP
+ public void BindForegroundColor(AppBar appBar)
+ {
+ SetAppBarForegroundBinding(appBar);
+ }
+
+ public void BindForegroundColor(AppBarButton button)
+ {
+ SetAppBarForegroundBinding(button);
+ }
+
+ void SetAppBarForegroundBinding(FrameworkElement element)
+ {
+ element.SetBinding(Windows.UI.Xaml.Controls.Control.ForegroundProperty,
+ new Windows.UI.Xaml.Data.Binding { Path = new PropertyPath("Control.ToolbarForeground"), Source = this, RelativeSource = new RelativeSource { Mode = RelativeSourceMode.TemplatedParent } });
+ }
+#endif
+ }
+} \ No newline at end of file
diff --git a/Xamarin.Forms.Platform.UAP/PageControl.xaml b/Xamarin.Forms.Platform.UAP/PageControl.xaml
new file mode 100644
index 0000000..5732b86
--- /dev/null
+++ b/Xamarin.Forms.Platform.UAP/PageControl.xaml
@@ -0,0 +1,10 @@
+<ContentControl
+ x:Class="Xamarin.Forms.Platform.UWP.PageControl"
+ 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"
+ mc:Ignorable="d" d:DesignWidth="1024"
+ HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch">
+
+</ContentControl>
diff --git a/Xamarin.Forms.Platform.UAP/Properties/AssemblyInfo.cs b/Xamarin.Forms.Platform.UAP/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..01702c9
--- /dev/null
+++ b/Xamarin.Forms.Platform.UAP/Properties/AssemblyInfo.cs
@@ -0,0 +1,60 @@
+using System.Reflection;
+using System.Runtime.InteropServices;
+using Xamarin.Forms;
+using Xamarin.Forms.Platform.UWP;
+
+[assembly: AssemblyTitle("Xamarin.Forms.Platform.UAP")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCulture("")]
+[assembly: ComVisible(false)]
+[assembly: Dependency(typeof(WindowsSerializer))]
+
+// Views
+
+[assembly: ExportRenderer(typeof(Layout), typeof(LayoutRenderer))]
+[assembly: ExportRenderer(typeof(BoxView), typeof(BoxViewRenderer))]
+[assembly: ExportRenderer(typeof(Image), typeof(ImageRenderer))]
+[assembly: ExportRenderer(typeof(Label), typeof(LabelRenderer))]
+[assembly: ExportRenderer(typeof(Button), typeof(ButtonRenderer))]
+[assembly: ExportRenderer(typeof(ListView), typeof(ListViewRenderer))]
+[assembly: ExportRenderer(typeof(CarouselView), typeof(CarouselViewRenderer))]
+[assembly: ExportRenderer(typeof(ScrollView), typeof(ScrollViewRenderer))]
+[assembly: ExportRenderer(typeof(ProgressBar), typeof(ProgressBarRenderer))]
+[assembly: ExportRenderer(typeof(Slider), typeof(SliderRenderer))]
+[assembly: ExportRenderer(typeof(Switch), typeof(SwitchRenderer))]
+[assembly: ExportRenderer(typeof(WebView), typeof(WebViewRenderer))]
+[assembly: ExportRenderer(typeof(Frame), typeof(FrameRenderer))]
+[assembly: ExportRenderer(typeof(ActivityIndicator), typeof(ActivityIndicatorRenderer))]
+[assembly: ExportRenderer(typeof(Editor), typeof(EditorRenderer))]
+[assembly: ExportRenderer(typeof(Picker), typeof(PickerRenderer))]
+[assembly: ExportRenderer(typeof(TimePicker), typeof(TimePickerRenderer))]
+[assembly: ExportRenderer(typeof(DatePicker), typeof(DatePickerRenderer))]
+[assembly: ExportRenderer(typeof(Stepper), typeof(StepperRenderer))]
+[assembly: ExportRenderer(typeof(Entry), typeof(EntryRenderer))]
+[assembly: ExportRenderer(typeof(TableView), typeof(TableViewRenderer))]
+[assembly: ExportRenderer(typeof(NativeViewWrapper), typeof(NativeViewWrapperRenderer))]
+
+//ImageSources
+
+[assembly: ExportImageSourceHandler(typeof(FileImageSource), typeof(FileImageSourceHandler))]
+[assembly: ExportImageSourceHandler(typeof(StreamImageSource), typeof(StreamImagesourceHandler))]
+[assembly: ExportImageSourceHandler(typeof(UriImageSource), typeof(ImageLoaderSourceHandler))]
+
+// Pages
+
+[assembly: ExportRenderer(typeof(Page), typeof(PageRenderer))]
+[assembly: ExportRenderer(typeof(NavigationPage), typeof(NavigationPageRenderer))]
+[assembly: ExportRenderer(typeof(MasterDetailPage), typeof(MasterDetailPageRenderer))]
+[assembly: ExportRenderer(typeof(CarouselPage), typeof(CarouselPageRenderer))]
+
+// Cells
+
+[assembly: ExportCell(typeof(Cell), typeof(TextCellRenderer))]
+[assembly: ExportCell(typeof(ImageCell), typeof(ImageCellRenderer))]
+[assembly: ExportCell(typeof(EntryCell), typeof(EntryCellRenderer))]
+[assembly: ExportCell(typeof(SwitchCell), typeof(SwitchCellRenderer))]
+[assembly: ExportCell(typeof(ViewCell), typeof(ViewCellRenderer))]
+[assembly: Dependency(typeof(WindowsResourcesProvider))]
+[assembly: ExportRenderer(typeof(SearchBar), typeof(SearchBarRenderer))]
+[assembly: ExportRenderer(typeof(TabbedPage), typeof(TabbedPageRenderer))] \ No newline at end of file
diff --git a/Xamarin.Forms.Platform.UAP/Properties/Xamarin.Forms.Platform.UAP.rd.xml b/Xamarin.Forms.Platform.UAP/Properties/Xamarin.Forms.Platform.UAP.rd.xml
new file mode 100644
index 0000000..13a5a5a
--- /dev/null
+++ b/Xamarin.Forms.Platform.UAP/Properties/Xamarin.Forms.Platform.UAP.rd.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ This file contains Runtime Directives, specifications about types your application accesses
+ through reflection and other dynamic code patterns. Runtime Directives are used to control the
+ .NET Native optimizer and ensure that it does not remove code accessed by your library. If your
+ library does not do any reflection, then you generally do not need to edit this file. However,
+ if your library reflects over types, especially types passed to it or derived from its types,
+ then you should write Runtime Directives.
+
+ The most common use of reflection in libraries is to discover information about types passed
+ to the library. Runtime Directives have three ways to express requirements on types passed to
+ your library.
+
+ 1. Parameter, GenericParameter, TypeParameter, TypeEnumerableParameter
+ Use these directives to reflect over types passed as a parameter.
+
+ 2. SubTypes
+ Use a SubTypes directive to reflect over types derived from another type.
+
+ 3. AttributeImplies
+ Use an AttributeImplies directive to indicate that your library needs to reflect over
+ types or methods decorated with an attribute.
+
+ For more information on writing Runtime Directives for libraries, please visit
+ http://go.microsoft.com/fwlink/?LinkId=613100
+-->
+<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">
+ <Library Name="Xamarin.Forms.Platform.UAP">
+
+ <!-- add directives for your library here -->
+
+ </Library>
+</Directives>
diff --git a/Xamarin.Forms.Platform.UAP/Resources.xaml b/Xamarin.Forms.Platform.UAP/Resources.xaml
new file mode 100644
index 0000000..e26eb39
--- /dev/null
+++ b/Xamarin.Forms.Platform.UAP/Resources.xaml
@@ -0,0 +1,1091 @@
+<ResourceDictionary
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:uwp="using:Xamarin.Forms.Platform.UWP"
+ x:Class="Xamarin.Forms.Platform.UWP.Resources">
+
+ <ResourceDictionary.MergedDictionaries>
+ <ResourceDictionary Source="FormsTextBoxStyle.xaml" />
+ </ResourceDictionary.MergedDictionaries>
+
+ <uwp:CaseConverter x:Key="LowerConverter" ConvertToUpper="False" />
+ <uwp:CaseConverter x:Key="UpperConverter" ConvertToUpper="True" />
+ <uwp:HeightConverter x:Key="HeightConverter" />
+ <uwp:CollapseWhenEmptyConverter x:Key="CollapseWhenEmpty" />
+ <uwp:BoolToVisibilityConverter x:Key="BoolVisibilityConverter" />
+ <uwp:BoolToVisibilityConverter x:Key="InvertedBoolVisibilityConverter" FalseIsVisible="True" />
+ <uwp:PageToRenderedElementConverter x:Key="PageToRenderer" />
+ <uwp:ImageConverter x:Key="ImageConverter" />
+ <uwp:ViewToRendererConverter x:Key="ViewToRenderer" />
+ <uwp:ColorConverter x:Key="ColorConverter" />
+ <uwp:HorizontalTextAlignmentConverter x:Key="HorizontalTextAlignmentConverter" />
+ <uwp:TextAlignmentToHorizontalAlignmentConverter x:Key="AlignmentConverter" />
+ <uwp:KeyboardConverter x:Key="KeyboardConverter" />
+ <uwp:MasterBackgroundConverter x:Key="MasterBackgroundConverter" />
+ <x:Double x:Key="TitleBarHeight">48</x:Double>
+
+ <DataTemplate x:Key="PushPinTemplate">
+ <Path Data="M 50.7361,983.661 C 44.1895,983.661 38.8369,988.97 38.8369,995.517 39.8649,1003.3 45.246,1008.1 49.8547,1014.12 50.2838,1014.66 51.2336,1014.66 51.6619,1014.12 52.1384,1013.48 52.7575,1012.73 53.4248,1011.91 55.0322,1012.07 56.4727,1012.32 57.5676,1012.71 58.407,1013 59.06,1013.33 59.4192,1013.63 59.7784,1013.93 59.7716,1014.11 59.7716,1014.16 59.7716,1014.21 59.7716,1014.39 59.4192,1014.69 59.06,1014.99 58.407,1015.32 57.5676,1015.61 55.8888,1016.2 53.4519,1016.63 50.7361,1016.63 48.0204,1016.63 45.5399,1016.2 43.8611,1015.61 43.0218,1015.32 42.3695,1014.99 42.0103,1014.69 41.6504,1014.39 41.6135,1014.21 41.6135,1014.16 41.6135,1014.11 41.6511,1013.93 42.0103,1013.63 42.3695,1013.33 43.0218,1013 43.8611,1012.71 44.3158,1012.55 44.8455,1012.35 45.4039,1012.22 L 43.8611,1010.33 C 43.6124,1010.4 43.3441,1010.46 43.1119,1010.55 42.1005,1010.9 41.2318,1011.31 40.5555,1011.87 39.8799,1012.43 39.3216,1013.22 39.3216,1014.16 39.3216,1015.1 39.8799,1015.85 40.5555,1016.41 41.2318,1016.97 42.1005,1017.42 43.1119,1017.77 45.1356,1018.48 47.8025,1018.92 50.7362,1018.92 54.437,1018.81 57.9892,1018.36 60.8733,1016.41 62.5084,1014.79 62.0756,1013.4 60.8733,1011.87 60.1969,1011.31 59.3726,1010.9 58.3612,1010.55 57.4331,1010.22 56.3503,1009.94 55.1878,1009.75 56.1992,1008.51 57.2362,1007.18 58.2289,1005.79 60.5599,1002.51 62.5918,998.968 62.5918,995.517 62.5918,988.97 57.2836,983.661 50.7362,983.661 Z M 50.7361,989.655 C 47.571,989.655 44.9627,992.219 44.9627,995.385 44.9627,998.55 47.571,1001.16 50.7361,1001.16 53.902,1001.16 56.4659,998.55 56.4659,995.385 56.4659,992.219 53.902,989.655 50.7361,989.655 Z M 50.7361,991.947 C 52.6591,991.947 54.174,993.462 54.174,995.385 54.174,997.307 52.6591,998.866 50.7361,998.866 48.8139,998.866 47.2546,997.307 47.2546,995.385 47.2546,993.462 48.8139,991.947 50.7361,991.947 Z" Fill="#000000" Height="74" Stretch="Fill" Margin="0" Width="50"/>
+ </DataTemplate>
+
+ <Style x:Key="PageTitleStyle" TargetType="TextBlock">
+ <Setter Property="FontWeight" Value="Bold" />
+ </Style>
+
+ <Style x:Key="RootContainerStyle" TargetType="Canvas">
+ <Setter Property="Background" Value="{ThemeResource ApplicationPageBackgroundThemeBrush}" />
+ </Style>
+
+ <Style x:Key="ActionSheetStyle" TargetType="ContentDialog" />
+ <Style x:Key="ActionSheetList" TargetType="ListView">
+ <Setter Property="SelectionMode" Value="None" />
+ <Setter Property="ItemContainerStyle">
+ <Setter.Value>
+ <Style TargetType="ListViewItem">
+ <Setter Property="Margin" Value="0" />
+ <Setter Property="HorizontalContentAlignment" Value="Stretch" />
+ </Style>
+ </Setter.Value>
+ </Setter>
+ <Setter Property="ItemTemplate">
+ <Setter.Value>
+ <DataTemplate>
+ <TextBlock Text="{Binding}" HorizontalAlignment="Stretch" VerticalAlignment="Center" Style="{ThemeResource SubtitleTextBlockStyle}" />
+ </DataTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
+
+ <ControlTemplate TargetType="ContentDialog" x:Key="MyContentDialogControlTemplate">
+ <Border x:Name="Container">
+ <Grid x:Name="LayoutRoot">
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto" />
+ </Grid.RowDefinitions>
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto" />
+ </Grid.ColumnDefinitions>
+ <Border x:Name="BackgroundElement"
+ Background="{TemplateBinding Background}"
+ FlowDirection="{TemplateBinding FlowDirection}"
+ BorderThickness="{ThemeResource ContentDialogBorderWidth}"
+ BorderBrush="{ThemeResource SystemControlForegroundAccentBrush}"
+ MaxWidth="{TemplateBinding MaxWidth}"
+ MaxHeight="{TemplateBinding MaxHeight}"
+ MinWidth="{TemplateBinding MinWidth}"
+ MinHeight="{TemplateBinding MinHeight}" >
+ <Grid x:Name="DialogSpace" VerticalAlignment="Stretch">
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="*" />
+ <RowDefinition Height="Auto" />
+ </Grid.RowDefinitions>
+ <ScrollViewer x:Name="ContentScrollViewer"
+ HorizontalScrollBarVisibility="Disabled"
+ VerticalScrollBarVisibility="Disabled"
+ ZoomMode="Disabled"
+ Margin="{ThemeResource ContentDialogContentScrollViewerMargin}"
+ IsTabStop="False">
+ <Grid>
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto" />
+ <!--CHANGED HERE. Used to be Auto as well-->
+ <RowDefinition />
+ </Grid.RowDefinitions>
+ <ContentControl x:Name="Title"
+ Margin="{ThemeResource ContentDialogTitleMargin}"
+ Content="{TemplateBinding Title}"
+ ContentTemplate="{TemplateBinding TitleTemplate}"
+ FontSize="20"
+ FontFamily="Segoe UI"
+ FontWeight="Normal"
+ Foreground="{TemplateBinding Foreground}"
+ HorizontalAlignment="Left"
+ VerticalAlignment="Top"
+ IsTabStop="False"
+ MaxHeight="{ThemeResource ContentDialogTitleMaxHeight}" >
+ <ContentControl.Template>
+ <ControlTemplate TargetType="ContentControl">
+ <ContentPresenter
+ Content="{TemplateBinding Content}"
+ MaxLines="2"
+ TextWrapping="Wrap"
+ ContentTemplate="{TemplateBinding ContentTemplate}"
+ Margin="{TemplateBinding Padding}"
+ ContentTransitions="{TemplateBinding ContentTransitions}"
+ HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
+ VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
+ </ControlTemplate>
+ </ContentControl.Template>
+ </ContentControl>
+ <ContentPresenter x:Name="Content"
+ ContentTemplate="{TemplateBinding ContentTemplate}"
+ Content="{TemplateBinding Content}"
+ FontSize="{ThemeResource ControlContentThemeFontSize}"
+ FontFamily="{ThemeResource ContentControlThemeFontFamily}"
+ Margin="{ThemeResource ContentDialogContentMargin}"
+ Foreground="{TemplateBinding Foreground}"
+ Grid.Row="1"
+ TextWrapping="Wrap" />
+ </Grid>
+ </ScrollViewer>
+ <Grid x:Name="CommandSpace" Grid.Row="1" HorizontalAlignment="Stretch" VerticalAlignment="Bottom">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition/>
+ <ColumnDefinition/>
+ </Grid.ColumnDefinitions>
+ <Border x:Name="Button1Host"
+ Margin="{ThemeResource ContentDialogButton1HostMargin}"
+ MinWidth="{ThemeResource ContentDialogButtonMinWidth}"
+ MaxWidth="{ThemeResource ContentDialogButtonMaxWidth}"
+ Height="{ThemeResource ContentDialogButtonHeight}"
+ HorizontalAlignment="Stretch" />
+ <Border x:Name="Button2Host"
+ Margin="{ThemeResource ContentDialogButton2HostMargin}"
+ MinWidth="{ThemeResource ContentDialogButtonMinWidth}"
+ MaxWidth="{ThemeResource ContentDialogButtonMaxWidth}"
+ Height="{ThemeResource ContentDialogButtonHeight}"
+ Grid.Column="1"
+ HorizontalAlignment="Stretch" />
+ </Grid>
+ </Grid>
+ </Border>
+ </Grid>
+ </Border>
+ </ControlTemplate>
+
+ <Style x:Key="JumpListGrid" TargetType="GridView">
+ <Setter Property="ItemTemplate">
+ <Setter.Value>
+ <DataTemplate>
+ <Border Background="{ThemeResource SystemColorControlAccentBrush}" Padding="5" Margin="3" MinHeight="80" MinWidth="80">
+ <TextBlock Text="{Binding}" Style="{ThemeResource SubheaderTextBlockStyle}" VerticalAlignment="Bottom" />
+ </Border>
+ </DataTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
+
+ <Style TargetType="Button" x:Key="PaneButton">
+ <Setter Property="FontFamily" Value="{ThemeResource SymbolThemeFontFamily}" />
+ <Setter Property="FontSize" Value="20" />
+ <Setter Property="Height" Value="48" />
+ <Setter Property="Width" Value="48" />
+ <Setter Property="Content" Value="" />
+ </Style>
+
+ <DataTemplate x:Key="CellTemplate">
+ <uwp:CellControl HorizontalContentAlignment="Stretch" />
+ </DataTemplate>
+
+ <DataTemplate x:Key="TableRoot">
+ <TextBlock Margin="0,20,0,0" Text="{Binding Title,Converter={StaticResource LowerConverter}}" Style="{ThemeResource TitleTextBlockStyle}" Visibility="{Binding Text,RelativeSource={RelativeSource Mode=Self},Converter={StaticResource CollapseWhenEmpty}}" />
+ </DataTemplate>
+
+ <DataTemplate x:Key="TableSection">
+ <TextBlock Margin="0,20,0,0" Text="{Binding Title,Converter={StaticResource LowerConverter}}" Style="{ThemeResource SubtitleTextBlockStyle}" Visibility="{Binding Text,RelativeSource={RelativeSource Mode=Self},Converter={StaticResource CollapseWhenEmpty}}" />
+ </DataTemplate>
+
+ <uwp:ListViewGroupStyleSelector x:Key="ListViewGroupSelector" />
+
+ <DataTemplate x:Key="ListViewGroupTemplate">
+ <TextBlock Text="{Binding}" Style="{ThemeResource BaseTextBlockStyle}" />
+ </DataTemplate>
+
+ <GroupStyle x:Key="ListViewGroup" HidesIfEmpty="False">
+ <GroupStyle.HeaderContainerStyle>
+ <Style TargetType="ListViewHeaderItem">
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate>
+ <uwp:ListGroupHeaderPresenter />
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
+ </GroupStyle.HeaderContainerStyle>
+ <GroupStyle.HeaderTemplate>
+ <DataTemplate>
+ <uwp:CellControl IsGroupHeader="true" HorizontalContentAlignment="Stretch" />
+ </DataTemplate>
+ </GroupStyle.HeaderTemplate>
+ </GroupStyle>
+
+ <DataTemplate x:Key="ViewCell">
+ <ContentControl DataContext="{Binding Cell}">
+ <ContentPresenter Height="{Binding RenderHeight, Converter={StaticResource HeightConverter}}" Content="{Binding View, Converter={StaticResource ViewToRenderer}}" />
+ </ContentControl>
+ </DataTemplate>
+
+ <DataTemplate x:Key="ContainedPageTemplate">
+ <ContentPresenter Content="{Binding Converter={StaticResource PageToRenderer}}">
+ <ContentPresenter.Resources>
+ <Style TargetType="uwp:PageControl">
+ <Setter Property="Background" Value="Transparent" />
+ </Style>
+ </ContentPresenter.Resources>
+ </ContentPresenter>
+ </DataTemplate>
+
+ <DataTemplate x:Key="View">
+ <ContentPresenter Content="{Binding Converter={StaticResource ViewToRenderer}}" />
+ </DataTemplate>
+
+ <SolidColorBrush x:Key="TabButtonPointerOverBackgroundBrush" Color="#44888888" />
+ <SolidColorBrush x:Key="TabButtonBackgroundBrush" Color="#29888888" />
+
+ <Style x:Key="TitleToolbar" TargetType="uwp:FormsCommandBar">
+ <Setter Property="ContentTemplate">
+ <Setter.Value>
+ <DataTemplate>
+ <TextBlock Text="{Binding}" Margin="10,0,0,0" VerticalAlignment="Center" Style="{ThemeResource TitleTextBlockStyle}" />
+ </DataTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
+
+ <Style TargetType="uwp:MasterDetailControl">
+ <Setter Property="ToolbarForeground" Value="{ThemeResource DefaultTextForegroundThemeBrush}" />
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate TargetType="uwp:MasterDetailControl">
+ <SplitView x:Name="SplitView" IsPaneOpen="{Binding IsPaneOpen,RelativeSource={RelativeSource TemplatedParent},Mode=TwoWay}" DisplayMode="Overlay">
+ <SplitView.Pane>
+ <Grid>
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="*" />
+ </Grid.RowDefinitions>
+ <StackPanel Grid.Row="0" Orientation="Horizontal" Visibility="{TemplateBinding MasterToolbarVisibility}" Background="{TemplateBinding ToolbarBackground}">
+ <Button Name="PaneTogglePane" Style="{ThemeResource PaneButton}" Foreground="{TemplateBinding ToolbarForeground}" />
+ <TextBlock Style="{ThemeResource TitleTextBlockStyle}" VerticalAlignment="Center" Text="{TemplateBinding MasterTitle}" Visibility="{TemplateBinding MasterTitleVisibility}" Foreground="{TemplateBinding ToolbarForeground}"/>
+ </StackPanel>
+
+ <ContentPresenter x:Name="MasterPresenter" Grid.Row="1" Content="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Master}" />
+ </Grid>
+ </SplitView.Pane>
+ <SplitView.Content>
+ <Grid>
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="*" />
+ </Grid.RowDefinitions>
+
+ <uwp:FormsCommandBar x:Name="CommandBar" Grid.Row="0" Foreground="{TemplateBinding ToolbarForeground}" Background="{TemplateBinding ToolbarBackground}" Visibility="{TemplateBinding DetailTitleVisibility}" VerticalContentAlignment="Top">
+ <uwp:FormsCommandBar.Content>
+ <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
+ <Button Name="ContentTogglePane" Style="{ThemeResource PaneButton}" Foreground="{TemplateBinding ToolbarForeground}" Visibility="{Binding ElementName=SplitView,Path=IsPaneOpen,Converter={StaticResource InvertedBoolVisibilityConverter}}" />
+ <ContentControl VerticalAlignment="Top" VerticalContentAlignment="Center" Height="{StaticResource TitleBarHeight}">
+ <TextBlock Text="{TemplateBinding DetailTitle}" Margin="10,0,0,0" Foreground="{TemplateBinding ToolbarForeground}" Style="{ThemeResource TitleTextBlockStyle}" />
+ </ContentControl>
+ </StackPanel>
+ </uwp:FormsCommandBar.Content>
+ </uwp:FormsCommandBar>
+
+ <ContentPresenter x:Name="DetailPresenter" Grid.Row="1" Content="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Detail}" />
+ </Grid>
+ </SplitView.Content>
+ </SplitView>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
+
+ <Style x:Key="FormsListViewItem" TargetType="ListViewItem">
+ <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" />
+ <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" />
+ <Setter Property="Background" Value="Transparent" />
+ <Setter Property="Foreground" Value="{ThemeResource SystemControlForegroundBaseHighBrush}" />
+ <Setter Property="TabNavigation" Value="Local" />
+ <Setter Property="IsHoldingEnabled" Value="True" />
+ <Setter Property="Padding" Value="0" />
+ <Setter Property="HorizontalContentAlignment" Value="Stretch" />
+ <Setter Property="VerticalContentAlignment" Value="Center" />
+ <Setter Property="MinWidth" Value="{ThemeResource ListViewItemMinWidth}" />
+ <Setter Property="MinHeight" Value="0" />
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate TargetType="ListViewItem">
+ <ListViewItemPresenter
+ CheckBrush="{ThemeResource SystemControlForegroundBaseMediumHighBrush}"
+ ContentMargin="{TemplateBinding Padding}"
+ CheckMode="Inline"
+ ContentTransitions="{TemplateBinding ContentTransitions}"
+ CheckBoxBrush="{ThemeResource SystemControlForegroundBaseMediumHighBrush}"
+ DragForeground="{ThemeResource ListViewItemDragForegroundThemeBrush}"
+ DragOpacity="{ThemeResource ListViewItemDragThemeOpacity}"
+ DragBackground="{ThemeResource ListViewItemDragBackgroundThemeBrush}"
+ DisabledOpacity="{ThemeResource ListViewItemDisabledThemeOpacity}"
+ FocusBorderBrush="{ThemeResource SystemControlForegroundAltHighBrush}"
+ FocusSecondaryBorderBrush="{ThemeResource SystemControlForegroundBaseHighBrush}"
+ HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
+ PointerOverForeground="{ThemeResource SystemControlHighlightAltBaseHighBrush}"
+ PressedBackground="{ThemeResource SystemControlHighlightListMediumBrush}"
+ PlaceholderBackground="{ThemeResource ListViewItemPlaceholderBackgroundThemeBrush}"
+ PointerOverBackground="{ThemeResource SystemControlHighlightListLowBrush}"
+ ReorderHintOffset="{ThemeResource ListViewItemReorderHintThemeOffset}"
+ SelectedPressedBackground="{ThemeResource SystemControlHighlightListAccentHighBrush}"
+ SelectionCheckMarkVisualEnabled="True"
+ SelectedForeground="{ThemeResource SystemControlHighlightAltBaseHighBrush}"
+ SelectedPointerOverBackground="{ThemeResource SystemControlHighlightListAccentMediumBrush}"
+ SelectedBackground="{ThemeResource SystemControlHighlightListAccentLowBrush}"
+ VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" />
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
+ <Style x:Key="FormsCarouselViewItem" TargetType="FlipViewItem">
+ <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" />
+ <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" />
+ <Setter Property="Background" Value="Transparent" />
+ <Setter Property="Foreground" Value="{ThemeResource SystemControlForegroundBaseHighBrush}" />
+ <Setter Property="TabNavigation" Value="Local" />
+ <Setter Property="IsHoldingEnabled" Value="True" />
+ <Setter Property="Padding" Value="0" />
+ <Setter Property="HorizontalContentAlignment" Value="Stretch" />
+ <Setter Property="VerticalContentAlignment" Value="Center" />
+ <Setter Property="MinWidth" Value="{ThemeResource ListViewItemMinWidth}" />
+ <Setter Property="MinHeight" Value="0" />
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate TargetType="ListViewItem">
+ <ListViewItemPresenter
+ CheckBrush="{ThemeResource SystemControlForegroundBaseMediumHighBrush}"
+ ContentMargin="{TemplateBinding Padding}"
+ CheckMode="Inline"
+ ContentTransitions="{TemplateBinding ContentTransitions}"
+ CheckBoxBrush="{ThemeResource SystemControlForegroundBaseMediumHighBrush}"
+ DragForeground="{ThemeResource ListViewItemDragForegroundThemeBrush}"
+ DragOpacity="{ThemeResource ListViewItemDragThemeOpacity}"
+ DragBackground="{ThemeResource ListViewItemDragBackgroundThemeBrush}"
+ DisabledOpacity="{ThemeResource ListViewItemDisabledThemeOpacity}"
+ FocusBorderBrush="{ThemeResource SystemControlForegroundAltHighBrush}"
+ FocusSecondaryBorderBrush="{ThemeResource SystemControlForegroundBaseHighBrush}"
+ HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
+ PointerOverForeground="{ThemeResource SystemControlHighlightAltBaseHighBrush}"
+ PressedBackground="{ThemeResource SystemControlHighlightListMediumBrush}"
+ PlaceholderBackground="{ThemeResource ListViewItemPlaceholderBackgroundThemeBrush}"
+ PointerOverBackground="{ThemeResource SystemControlHighlightListLowBrush}"
+ ReorderHintOffset="{ThemeResource ListViewItemReorderHintThemeOffset}"
+ SelectedPressedBackground="{ThemeResource SystemControlHighlightListAccentHighBrush}"
+ SelectionCheckMarkVisualEnabled="True"
+ SelectedForeground="{ThemeResource SystemControlHighlightAltBaseHighBrush}"
+ SelectedPointerOverBackground="{ThemeResource SystemControlHighlightListAccentMediumBrush}"
+ SelectedBackground="{ThemeResource SystemControlHighlightListAccentLowBrush}"
+ VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" />
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
+
+ <DataTemplate x:Key="TextCell">
+ <StackPanel>
+ <TextBlock
+ Text="{Binding Text}"
+ Style="{ThemeResource BaseTextBlockStyle}"
+ Visibility="{Binding Text,RelativeSource={RelativeSource Self}, Converter={StaticResource CollapseWhenEmpty}}"
+ Foreground="{Binding TextColor, Converter={StaticResource ColorConverter}, ConverterParameter=DefaultTextForegroundThemeBrush}" />
+
+ <TextBlock
+ Text="{Binding Detail}"
+ Style="{ThemeResource BodyTextBlockStyle}"
+ Visibility="{Binding Text,RelativeSource={RelativeSource Self}, Converter={StaticResource CollapseWhenEmpty}}"
+ Foreground="{Binding DetailColor, Converter={StaticResource ColorConverter}, ConverterParameter=DefaultTextForegroundThemeBrush}"
+ x:Name="detail"/>
+ </StackPanel>
+ </DataTemplate>
+
+ <DataTemplate x:Key="ListViewHeaderTextCell">
+ <StackPanel>
+ <TextBlock
+ Text="{Binding Text}"
+ Style="{ThemeResource SubheaderTextBlockStyle}"
+ Visibility="{Binding Text,RelativeSource={RelativeSource Self}, Converter={StaticResource CollapseWhenEmpty}}"
+ Foreground="{Binding TextColor, Converter={StaticResource ColorConverter}, ConverterParameter=DefaultTextForegroundThemeBrush}" />
+
+ <TextBlock
+ Text="{Binding Detail}"
+ Style="{ThemeResource BodyTextBlockStyle}"
+ Visibility="{Binding Text,RelativeSource={RelativeSource Self}, Converter={StaticResource CollapseWhenEmpty}}"
+ Foreground="{Binding DetailColor, Converter={StaticResource ColorConverter}, ConverterParameter=DefaultTextForegroundThemeBrush}"
+ x:Name="detail" />
+ </StackPanel>
+ </DataTemplate>
+
+ <DataTemplate x:Key="ImageCell">
+ <Grid>
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto" />
+ <ColumnDefinition />
+ </Grid.ColumnDefinitions>
+
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ </Grid.RowDefinitions>
+
+ <Image Grid.Column="0" Grid.RowSpan="2"
+ DataContext="{Binding ImageSource, Converter={StaticResource ImageConverter}}"
+ Source="{Binding Value}"
+ VerticalAlignment="Center" />
+
+ <TextBlock Grid.Column="1" Grid.Row="0"
+ Text="{Binding Text}"
+ Style="{ThemeResource BaseTextBlockStyle}"
+ Visibility="{Binding Text,RelativeSource={RelativeSource Self}, Converter={StaticResource CollapseWhenEmpty}}"
+ Foreground="{Binding TextColor, Converter={StaticResource ColorConverter}, ConverterParameter=DefaultTextForegroundThemeBrush}" />
+
+ <TextBlock Grid.Column="1" Grid.Row="1"
+ Text="{Binding Detail}"
+ Style="{ThemeResource BodyTextBlockStyle}"
+ Visibility="{Binding Text,RelativeSource={RelativeSource Self}, Converter={StaticResource CollapseWhenEmpty}}"
+ Foreground="{Binding DetailColor, Converter={StaticResource ColorConverter}, ConverterParameter=DefaultTextForegroundThemeBrush}"
+ x:Name="detail" />
+ </Grid>
+ </DataTemplate>
+
+ <DataTemplate x:Key="SwitchCell">
+ <Grid HorizontalAlignment="Stretch">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="*" />
+ <ColumnDefinition Width="Auto" />
+ </Grid.ColumnDefinitions>
+
+ <TextBlock Grid.Column="0" Text="{Binding Text}" VerticalAlignment="Center" Style="{ThemeResource BaseTextBlockStyle}" />
+
+ <ToggleSwitch Grid.Column="1" IsOn="{Binding On, Mode=TwoWay}" OnContent="" OffContent="" VerticalAlignment="Center" />
+ </Grid>
+ </DataTemplate>
+
+ <DataTemplate x:Key="EntryCell">
+ <uwp:EntryCellTextBox IsEnabled="{Binding IsEnabled}" Header="{Binding}" Text="{Binding Text, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" TextAlignment="{Binding HorizontalTextAlignment,Converter={StaticResource HorizontalTextAlignmentConverter}}" PlaceholderText="{Binding Placeholder}" InputScope="{Binding Keyboard,Converter={StaticResource KeyboardConverter}}" HorizontalAlignment="Stretch">
+ <uwp:EntryCellTextBox.HeaderTemplate>
+ <DataTemplate>
+ <TextBlock Text="{Binding Label}" Style="{ThemeResource BaseTextBlockStyle}" Foreground="{Binding LabelColor, Converter={StaticResource ColorConverter}, ConverterParameter=DefaultTextForegroundThemeBrush}" />
+ </DataTemplate>
+ </uwp:EntryCellTextBox.HeaderTemplate>
+ </uwp:EntryCellTextBox>
+ </DataTemplate>
+
+ <Style x:Key="TabbedPageStyle" TargetType="uwp:FormsPivot">
+ <Setter Property="HeaderTemplate">
+ <Setter.Value>
+ <DataTemplate>
+ <TextBlock Text="{Binding Title}" Style="{ThemeResource BodyTextBlockStyle}" />
+ </DataTemplate>
+ </Setter.Value>
+ </Setter>
+
+ <Setter Property="ItemTemplate">
+ <Setter.Value>
+ <DataTemplate>
+ <uwp:TabbedPagePresenter Content="{Binding}" ContentTemplate="{ThemeResource ContainedPageTemplate}" />
+ </DataTemplate>
+ </Setter.Value>
+ </Setter>
+
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate TargetType="uwp:FormsPivot">
+ <Grid x:Name="RootElement" Background="{TemplateBinding Background}" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}">
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto"/>
+ <RowDefinition Height="*"/>
+ </Grid.RowDefinitions>
+ <VisualStateManager.VisualStateGroups>
+ <VisualStateGroup x:Name="NavigationButtonsVisibility">
+ <VisualState x:Name="NavigationButtonsHidden"/>
+ <VisualState x:Name="NavigationButtonsVisible">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="NextButton">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsEnabled" Storyboard.TargetName="NextButton">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="True"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PreviousButton">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsEnabled" Storyboard.TargetName="PreviousButton">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="True"/>
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ </VisualStateGroup>
+ <VisualStateGroup x:Name="HeaderStates">
+ <VisualState x:Name="HeaderDynamic"/>
+ <VisualState x:Name="HeaderStatic">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="Header">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="StaticHeader">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ </VisualStateGroup>
+ </VisualStateManager.VisualStateGroups>
+ <uwp:FormsCommandBar x:Name="CommandBar" Grid.Row="0" VerticalContentAlignment="Top" Background="{TemplateBinding ToolbarBackground}" Visibility="{TemplateBinding ToolbarVisibility}" >
+ <uwp:FormsCommandBar.Content>
+ <ContentControl VerticalAlignment="Top" VerticalContentAlignment="Center" Height="{ThemeResource TitleBarHeight}" >
+ <TextBlock Text="{TemplateBinding Title}" VerticalAlignment="Center" Padding="10,0,0,0" Foreground="{TemplateBinding ToolbarForeground}" Style="{ThemeResource TitleTextBlockStyle}" />
+ </ContentControl>
+ </uwp:FormsCommandBar.Content>
+ </uwp:FormsCommandBar>
+ <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}">
+ <VisualStateManager.VisualStateGroups>
+ <VisualStateGroup x:Name="CommonStates">
+ <VisualState x:Name="Normal"/>
+ <VisualState x:Name="PointerOver">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="Root">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightBaseMediumBrush}"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="Arrow">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAltAltMediumHighBrush}"/>
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ <VisualState x:Name="Pressed">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="Root">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightBaseMediumHighBrush}"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="Arrow">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAltAltMediumHighBrush}"/>
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ </VisualStateGroup>
+ </VisualStateManager.VisualStateGroups>
+ <FontIcon x:Name="Arrow" Foreground="{ThemeResource SystemControlForegroundAltMediumHighBrush}" FontSize="12" FontFamily="{ThemeResource SymbolThemeFontFamily}" Glyph="&#xE0E3;" HorizontalAlignment="Center" MirroredWhenRightToLeft="True" UseLayoutRounding="False" VerticalAlignment="Center"/>
+ </Border>
+ </ControlTemplate>
+ <ControlTemplate x:Key="PreviousTemplate" TargetType="Button">
+ <Border x:Name="Root" BorderBrush="{ThemeResource SystemControlForegroundTransparentBrush}" BorderThickness="{ThemeResource PivotNavButtonBorderThemeThickness}" Background="{ThemeResource SystemControlBackgroundBaseMediumLowBrush}">
+ <VisualStateManager.VisualStateGroups>
+ <VisualStateGroup x:Name="CommonStates">
+ <VisualState x:Name="Normal"/>
+ <VisualState x:Name="PointerOver">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="Root">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightBaseMediumBrush}"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="Arrow">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAltAltMediumHighBrush}"/>
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ <VisualState x:Name="Pressed">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="Root">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightBaseMediumHighBrush}"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="Arrow">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAltAltMediumHighBrush}"/>
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ </VisualStateGroup>
+ </VisualStateManager.VisualStateGroups>
+ <FontIcon x:Name="Arrow" Foreground="{ThemeResource SystemControlForegroundAltMediumHighBrush}" FontSize="12" FontFamily="{ThemeResource SymbolThemeFontFamily}" Glyph="&#xE0E2;" HorizontalAlignment="Center" MirroredWhenRightToLeft="True" UseLayoutRounding="False" VerticalAlignment="Center"/>
+ </Border>
+ </ControlTemplate>
+ </Grid.Resources>
+ <ScrollViewer x:Name="ScrollViewer" BringIntoViewOnFocusChange="False" HorizontalSnapPointsAlignment="Center" HorizontalSnapPointsType="MandatorySingle" HorizontalScrollBarVisibility="Hidden" Margin="{TemplateBinding Padding}" Template="{StaticResource ScrollViewerScrollBarlessTemplate}" VerticalSnapPointsType="None" VerticalScrollBarVisibility="Disabled" VerticalScrollMode="Disabled" VerticalContentAlignment="Stretch" ZoomMode="Disabled">
+ <PivotPanel x:Name="Panel" VerticalAlignment="Stretch">
+ <Grid x:Name="PivotLayoutElement">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto"/>
+ <ColumnDefinition Width="*"/>
+ <ColumnDefinition Width="Auto"/>
+ </Grid.ColumnDefinitions>
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto"/>
+ <RowDefinition Height="*"/>
+ </Grid.RowDefinitions>
+ <Grid.RenderTransform>
+ <CompositeTransform x:Name="PivotLayoutElementTranslateTransform"/>
+ </Grid.RenderTransform>
+ <ContentPresenter x:Name="LeftHeaderPresenter" ContentTemplate="{TemplateBinding LeftHeaderTemplate}" Content="{TemplateBinding LeftHeader}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
+ <ContentControl x:Name="HeaderClipper" Grid.Column="1" HorizontalContentAlignment="Stretch" UseSystemFocusVisuals="True">
+ <ContentControl.Clip>
+ <RectangleGeometry x:Name="HeaderClipperGeometry"/>
+ </ContentControl.Clip>
+ <Grid Background="Transparent">
+ <PivotHeaderPanel x:Name="StaticHeader" Visibility="Collapsed"/>
+ <PivotHeaderPanel x:Name="Header">
+ <PivotHeaderPanel.RenderTransform>
+ <TransformGroup>
+ <CompositeTransform x:Name="HeaderTranslateTransform"/>
+ <CompositeTransform x:Name="HeaderOffsetTranslateTransform"/>
+ </TransformGroup>
+ </PivotHeaderPanel.RenderTransform>
+ </PivotHeaderPanel>
+ </Grid>
+ </ContentControl>
+ <Button x:Name="PreviousButton" Background="Transparent" Grid.Column="1" HorizontalAlignment="Left" Height="36" IsTabStop="False" IsEnabled="False" Margin="{ThemeResource PivotNavButtonMargin}" Opacity="0" Template="{StaticResource PreviousTemplate}" UseSystemFocusVisuals="False" VerticalAlignment="Top" Width="20"/>
+ <Button x:Name="NextButton" Background="Transparent" Grid.Column="1" HorizontalAlignment="Right" Height="36" IsTabStop="False" IsEnabled="False" Margin="{ThemeResource PivotNavButtonMargin}" Opacity="0" Template="{StaticResource NextTemplate}" UseSystemFocusVisuals="False" VerticalAlignment="Top" Width="20"/>
+ <ContentPresenter x:Name="RightHeaderPresenter" ContentTemplate="{TemplateBinding RightHeaderTemplate}" Content="{TemplateBinding RightHeader}" Grid.Column="2" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
+ <ItemsPresenter x:Name="PivotItemPresenter" Grid.ColumnSpan="3" Grid.Row="1">
+ <ItemsPresenter.RenderTransform>
+ <TransformGroup>
+ <TranslateTransform x:Name="ItemsPresenterTranslateTransform"/>
+ <CompositeTransform x:Name="ItemsPresenterCompositeTransform"/>
+ </TransformGroup>
+ </ItemsPresenter.RenderTransform>
+ </ItemsPresenter>
+ </Grid>
+ </PivotPanel>
+ </ScrollViewer>
+ </Grid>
+ </Grid>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
+
+ <Style x:Key="PageControlDefaultStyle" TargetType="uwp:PageControl">
+ <Setter Property="ContentMargin" Value="0" />
+ <Setter Property="TitleBrush" Value="{ThemeResource DefaultTextForegroundThemeBrush}" />
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate TargetType="uwp:PageControl">
+ <Grid Background="{TemplateBinding Background}">
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="*" />
+ </Grid.RowDefinitions>
+
+ <uwp:FormsCommandBar x:Name="CommandBar" Grid.Row="0" VerticalContentAlignment="Top" Background="{TemplateBinding NavigationBarBackground}" Visibility="{Binding ShowNavigationBar,RelativeSource={RelativeSource Mode=TemplatedParent},Converter={StaticResource BoolVisibilityConverter}}">
+ <uwp:FormsCommandBar.Content>
+ <ContentControl VerticalAlignment="Top" VerticalContentAlignment="Center" Height="{ThemeResource TitleBarHeight}">
+ <TextBlock Text="{Binding Title}" VerticalAlignment="Center" Padding="10,0,0,0" Foreground="{TemplateBinding TitleBrush}" Style="{ThemeResource TitleTextBlockStyle}" />
+ </ContentControl>
+ </uwp:FormsCommandBar.Content>
+ </uwp:FormsCommandBar>
+
+ <ContentPresenter Margin="{TemplateBinding ContentMargin}" ContentTransitions="{TemplateBinding ContentTransitions}" x:Name="presenter" Grid.Row="1" />
+ </Grid>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
+
+ <Style TargetType="uwp:StepperControl">
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate>
+ <Grid HorizontalAlignment="Left">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="*" />
+ <ColumnDefinition Width="*" />
+ </Grid.ColumnDefinitions>
+
+ <Button Name="Minus" Grid.Column="0" Content="-" />
+ <Button Name="Plus" Grid.Column="1" Content="+" />
+ </Grid>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
+
+ <Style TargetType="uwp:PageControl" BasedOn="{StaticResource PageControlDefaultStyle}" />
+
+ <Style TargetType="TextBox">
+ <Setter Property="Margin" Value="0" />
+ </Style>
+
+ <Style TargetType="ToggleSwitch">
+ <Setter Property="MinWidth" Value="0"/>
+ </Style>
+
+ <SolidColorBrush x:Key="FormsCancelForegroundBrush" />
+ <SolidColorBrush x:Key="FormsCancelBackgroundBrush" />
+
+ <!-- Default Style for AutoSuggestBox -->
+ <Style TargetType="AutoSuggestBox">
+ <Setter Property="VerticalAlignment" Value="Top" />
+ <Setter Property="IsTabStop" Value="False" />
+ <Setter Property="TextBoxStyle" Value="{StaticResource AutoSuggestBoxTextBoxStyle}" />
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate TargetType="AutoSuggestBox">
+ <Grid>
+ <VisualStateManager.VisualStateGroups>
+ <VisualStateGroup x:Name="Orientation">
+ <VisualState x:Name="Landscape"/>
+ <VisualState x:Name="Portrait"/>
+ </VisualStateGroup>
+ </VisualStateManager.VisualStateGroups>
+ <uwp:FormsTextBox x:Name="TextBox"
+ Style="{TemplateBinding TextBoxStyle}"
+ FontFamily="{TemplateBinding FontFamily}"
+ FontSize="{TemplateBinding FontSize}"
+ FontStyle="{TemplateBinding FontStyle}"
+ PlaceholderText="{TemplateBinding PlaceholderText}"
+ Header="{TemplateBinding Header}"
+ Width="{TemplateBinding Width}"
+ ScrollViewer.BringIntoViewOnFocusChange="False"
+ Canvas.ZIndex="0"
+ Margin="0"
+ DesiredCandidateWindowAlignment="BottomEdge"/>
+ <Popup x:Name="SuggestionsPopup">
+ <Border x:Name="SuggestionsContainer">
+ <Border.RenderTransform>
+ <TranslateTransform x:Name="UpwardTransform"/>
+ </Border.RenderTransform>
+ <ListView x:Name="SuggestionsList"
+ Background="{ThemeResource SystemControlBackgroundChromeMediumLowBrush}"
+ BorderThickness="{ThemeResource AutoSuggestListBorderThemeThickness}"
+ BorderBrush="{ThemeResource SystemControlForegroundBaseMediumLowBrush}"
+ DisplayMemberPath="{TemplateBinding DisplayMemberPath}"
+ IsItemClickEnabled="True"
+ ItemTemplate="{TemplateBinding ItemTemplate}"
+ ItemTemplateSelector="{TemplateBinding ItemTemplateSelector}"
+ ItemContainerStyle="{TemplateBinding ItemContainerStyle}"
+ MaxHeight="{ThemeResource AutoSuggestListMaxHeight}"
+ Margin="{ThemeResource AutoSuggestListMargin}">
+ <ListView.ItemContainerTransitions>
+ <TransitionCollection />
+ </ListView.ItemContainerTransitions>
+ </ListView>
+ </Border>
+ </Popup>
+ </Grid>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
+
+ <Style TargetType="uwp:FormsTextBox" x:Key="AutoSuggestBoxTextBoxStyle">
+ <Setter Property="MinWidth" Value="{ThemeResource TextControlThemeMinWidth}" />
+ <Setter Property="MinHeight" Value="{ThemeResource TextControlThemeMinHeight}" />
+ <Setter Property="Foreground" Value="{ThemeResource SystemControlForegroundBaseHighBrush}" />
+ <Setter Property="ForegroundFocusBrush" Value="{ThemeResource SystemControlForegroundChromeBlackHighBrush}" />
+ <Setter Property="PlaceholderForegroundBrush" Value="{ThemeResource SystemControlPageTextBaseMediumBrush}" />
+ <Setter Property="PlaceholderForegroundFocusBrush" Value="{ThemeResource SystemControlPageTextChromeBlackMediumLowBrush}" />
+ <Setter Property="Background" Value="{ThemeResource SystemControlBackgroundAltHighBrush}" />
+ <Setter Property="BorderBrush" Value="{ThemeResource SystemControlForegroundChromeDisabledLowBrush}" />
+ <Setter Property="SelectionHighlightColor" Value="{ThemeResource SystemControlHighlightAccentBrush}" />
+ <Setter Property="BorderThickness" Value="{ThemeResource TextControlBorderThemeThickness}" />
+ <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" />
+ <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" />
+ <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Hidden" />
+ <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Hidden" />
+ <Setter Property="ScrollViewer.IsDeferredScrollingEnabled" Value="False" />
+ <Setter Property="Padding" Value="{ThemeResource TextControlThemePadding}"/>
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate TargetType="uwp:FormsTextBox">
+ <Grid>
+ <Grid.Resources>
+ <Style x:Name="DeleteButtonStyle" TargetType="Button">
+ <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.TargetName="BorderElement"
+ Storyboard.TargetProperty="Background">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightTransparentBrush}" />
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="GlyphElement"
+ Storyboard.TargetProperty="Foreground">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource FormsCancelBackgroundBrush}" />
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ <VisualState x:Name="Pressed">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderElement"
+ Storyboard.TargetProperty="Background">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAccentBrush}" />
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="GlyphElement"
+ Storyboard.TargetProperty="Foreground">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAltChromeWhiteBrush}" />
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ <VisualState x:Name="Disabled">
+ <Storyboard>
+ <DoubleAnimation Storyboard.TargetName="BorderElement"
+ Storyboard.TargetProperty="Opacity"
+ To="0"
+ Duration="0" />
+ </Storyboard>
+ </VisualState>
+ </VisualStateGroup>
+ </VisualStateManager.VisualStateGroups>
+ <Border x:Name="BorderElement"
+ BorderBrush="{ThemeResource TextBoxButtonBorderThemeBrush}"
+ BorderThickness="{TemplateBinding BorderThickness}"
+ Background="{ThemeResource FormsCancelBackgroundBrush}">
+ <TextBlock x:Name="GlyphElement"
+ Foreground="{ThemeResource FormsCancelForegroundBrush}"
+ VerticalAlignment="Center"
+ HorizontalAlignment="Center"
+ FontStyle="Normal"
+ FontSize="12"
+ Text="&#xE10A;"
+ FontFamily="{ThemeResource SymbolThemeFontFamily}"
+ AutomationProperties.AccessibilityView="Raw"/>
+ </Border>
+ </Grid>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
+ <Style x:Name="QueryButtonStyle" TargetType="Button">
+ <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.TargetName="BorderElement"
+ Storyboard.TargetProperty="Background">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightTransparentBrush}" />
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter"
+ Storyboard.TargetProperty="Foreground">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAltAccentBrush}" />
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ <VisualState x:Name="Pressed">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderElement"
+ Storyboard.TargetProperty="Background">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAccentBrush}" />
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter"
+ Storyboard.TargetProperty="Foreground">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAltChromeWhiteBrush}" />
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ <VisualState x:Name="Disabled">
+ <Storyboard>
+ <DoubleAnimation Storyboard.TargetName="BorderElement"
+ Storyboard.TargetProperty="Opacity"
+ To="0"
+ Duration="0" />
+ </Storyboard>
+ </VisualState>
+ </VisualStateGroup>
+ </VisualStateManager.VisualStateGroups>
+ <Border x:Name="BorderElement"
+ BorderBrush="{ThemeResource TextBoxButtonBorderThemeBrush}"
+ BorderThickness="{TemplateBinding BorderThickness}"
+ Background="{ThemeResource TextBoxButtonBackgroundThemeBrush}">
+ <ContentPresenter x:Name="ContentPresenter"
+ Content="{TemplateBinding Content}"
+ ContentTransitions="{TemplateBinding ContentTransitions}"
+ ContentTemplate="{TemplateBinding ContentTemplate}"
+ Margin="{TemplateBinding Padding}"
+ HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
+ VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
+ AutomationProperties.AccessibilityView="Raw"/>
+ </Border>
+ </Grid>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
+ </Grid.Resources>
+ <VisualStateManager.VisualStateGroups>
+ <VisualStateGroup x:Name="CommonStates">
+ <VisualState x:Name="Disabled">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HeaderContentPresenter"
+ Storyboard.TargetProperty="Foreground">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledBaseLowBrush}" />
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundElement"
+ Storyboard.TargetProperty="Background">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledTransparentBrush}" />
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderElement"
+ Storyboard.TargetProperty="Background">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlBackgroundBaseLowBrush}" />
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderElement"
+ Storyboard.TargetProperty="BorderBrush">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledBaseLowBrush}" />
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentElement"
+ Storyboard.TargetProperty="Foreground">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledChromeDisabledLowBrush}" />
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PlaceholderTextContentPresenter"
+ Storyboard.TargetProperty="Foreground">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledChromeDisabledLowBrush}" />
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ <VisualState x:Name="Normal" />
+ <VisualState x:Name="PointerOver">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderElement"
+ Storyboard.TargetProperty="BorderBrush">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightChromeAltLowBrush}" />
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundElement"
+ Storyboard.TargetProperty="Opacity">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlBackgroundHoverOpacity}" />
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ <VisualState x:Name="Focused">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PlaceholderTextContentPresenter"
+ Storyboard.TargetProperty="Foreground">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{Binding PlaceholderForegroundFocusBrush, RelativeSource={RelativeSource TemplatedParent}}" />
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundElement"
+ Storyboard.TargetProperty="Background">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlBackgroundChromeWhiteBrush}" />
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundElement"
+ Storyboard.TargetProperty="Opacity">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlBackgroundFocusedOpacity}" />
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderElement"
+ Storyboard.TargetProperty="BorderBrush">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAccentBrush}" />
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentElement"
+ Storyboard.TargetProperty="Foreground">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{Binding ForegroundFocusBrush, RelativeSource={RelativeSource TemplatedParent}}" />
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentElement"
+ Storyboard.TargetProperty="RequestedTheme">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="Light" />
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="QueryButton"
+ Storyboard.TargetProperty="Foreground">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlBackgroundChromeBlackMediumBrush}" />
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ </VisualStateGroup>
+ <VisualStateGroup x:Name="ButtonStates">
+ <VisualState x:Name="ButtonVisible">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DeleteButton"
+ Storyboard.TargetProperty="Visibility">
+ <DiscreteObjectKeyFrame KeyTime="0">
+ <DiscreteObjectKeyFrame.Value>
+ <Visibility>Visible</Visibility>
+ </DiscreteObjectKeyFrame.Value>
+ </DiscreteObjectKeyFrame>
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ <VisualState x:Name="ButtonCollapsed" />
+ </VisualStateGroup>
+ </VisualStateManager.VisualStateGroups>
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="*" />
+ <ColumnDefinition Width="Auto" />
+ <ColumnDefinition Width="Auto" />
+ </Grid.ColumnDefinitions>
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="*" />
+ </Grid.RowDefinitions>
+ <Border x:Name="BackgroundElement"
+ Grid.Row="1"
+ Background="{TemplateBinding Background}"
+ Margin="{TemplateBinding BorderThickness}"
+ Opacity="{ThemeResource TextControlBackgroundRestOpacity}"
+ Grid.ColumnSpan="3"
+ Grid.RowSpan="1"/>
+ <Border x:Name="BorderElement"
+ Grid.Row="1"
+ BorderBrush="{TemplateBinding BorderBrush}"
+ BorderThickness="{TemplateBinding BorderThickness}"
+ Grid.ColumnSpan="3"
+ Grid.RowSpan="1"/>
+ <ContentPresenter x:Name="HeaderContentPresenter"
+ x:DeferLoadStrategy="Lazy"
+ Visibility="Collapsed"
+ Grid.Row="0"
+ Foreground="{Binding PlaceholderForegroundBrush, RelativeSource={RelativeSource TemplatedParent}}"
+ Margin="0,0,0,8"
+ Grid.ColumnSpan="3"
+ Content="{TemplateBinding Header}"
+ ContentTemplate="{TemplateBinding HeaderTemplate}"
+ FontWeight="Normal"
+ TextWrapping="Wrap" />
+ <ScrollViewer x:Name="ContentElement"
+ Grid.Row="1"
+ HorizontalScrollMode="{TemplateBinding ScrollViewer.HorizontalScrollMode}"
+ HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
+ VerticalScrollMode="{TemplateBinding ScrollViewer.VerticalScrollMode}"
+ VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"
+ IsHorizontalRailEnabled="{TemplateBinding ScrollViewer.IsHorizontalRailEnabled}"
+ IsVerticalRailEnabled="{TemplateBinding ScrollViewer.IsVerticalRailEnabled}"
+ IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}"
+ Margin="{TemplateBinding BorderThickness}"
+ Padding="{TemplateBinding Padding}"
+ IsTabStop="False"
+ AutomationProperties.AccessibilityView="Raw"
+ ZoomMode="Disabled" />
+ <!-- Converting the TextAlignment set for the control's input text to a HorizontalAlignment
+ so the PlaceholderText's alignment will match the input text -->
+ <ContentControl x:Name="PlaceholderTextContentPresenter"
+ Grid.Row="1"
+ Foreground="{Binding PlaceholderForegroundBrush, RelativeSource={RelativeSource TemplatedParent}}"
+ Margin="{TemplateBinding BorderThickness}"
+ Padding="{TemplateBinding Padding}"
+ IsTabStop="False"
+ Grid.ColumnSpan="3"
+ Content="{TemplateBinding PlaceholderText}"
+ FontFamily="{TemplateBinding FontFamily}"
+ FontSize="{TemplateBinding FontSize}"
+ FontStyle="{TemplateBinding FontStyle}"
+ IsHitTestVisible="False"
+ HorizontalAlignment="{Binding TextAlignment,
+ RelativeSource={RelativeSource Mode=TemplatedParent},
+ Converter={StaticResource AlignmentConverter}}" />
+ <Button x:Name="DeleteButton"
+ Grid.Row="1"
+ Style="{StaticResource DeleteButtonStyle}"
+ BorderThickness="{TemplateBinding BorderThickness}"
+ Margin="{ThemeResource HelperButtonThemePadding}"
+ IsTabStop="False"
+ Grid.Column="1"
+ Visibility="Collapsed"
+ FontSize="{TemplateBinding FontSize}"
+ MinWidth="34"
+ VerticalAlignment="Stretch"/>
+ <Button x:Name="QueryButton"
+ Grid.Row="1"
+ Style="{StaticResource QueryButtonStyle}"
+ BorderThickness="{TemplateBinding BorderThickness}"
+ Margin="{ThemeResource HelperButtonThemePadding}"
+ IsTabStop="False"
+ Grid.Column="2"
+ FontSize="{TemplateBinding FontSize}"
+ MinWidth="34"
+ VerticalAlignment="Stretch"/>
+ </Grid>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
+</ResourceDictionary> \ No newline at end of file
diff --git a/Xamarin.Forms.Platform.UAP/SearchBarRenderer.cs b/Xamarin.Forms.Platform.UAP/SearchBarRenderer.cs
new file mode 100644
index 0000000..6ec13e1
--- /dev/null
+++ b/Xamarin.Forms.Platform.UAP/SearchBarRenderer.cs
@@ -0,0 +1,208 @@
+using System.ComponentModel;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
+using Windows.UI.Xaml.Media;
+
+namespace Xamarin.Forms.Platform.UWP
+{
+ public class SearchBarRenderer : ViewRenderer<SearchBar, AutoSuggestBox>
+ {
+ Brush _defaultPlaceholderColorBrush;
+ Brush _defaultPlaceholderColorFocusBrush;
+ Brush _defaultTextColorBrush;
+ Brush _defaultTextColorFocusBrush;
+
+ bool _fontApplied;
+
+ FormsTextBox _queryTextBox;
+
+ protected override void OnElementChanged(ElementChangedEventArgs<SearchBar> e)
+ {
+ if (e.NewElement != null)
+ {
+ if (Control == null)
+ {
+ SetNativeControl(new AutoSuggestBox { QueryIcon = new SymbolIcon(Symbol.Find) });
+ Control.QuerySubmitted += OnQuerySubmitted;
+ Control.TextChanged += OnTextChanged;
+ Control.Loaded += OnControlLoaded;
+ }
+
+ UpdateText();
+ UpdatePlaceholder();
+ UpdateCancelButtonColor();
+ UpdateAlignment();
+ UpdateFont();
+ UpdateTextColor();
+ UpdatePlaceholderColor();
+ }
+
+ base.OnElementChanged(e);
+ }
+
+ protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
+ {
+ base.OnElementPropertyChanged(sender, e);
+
+ if (e.PropertyName == SearchBar.TextProperty.PropertyName)
+ UpdateText();
+ else if (e.PropertyName == SearchBar.PlaceholderProperty.PropertyName)
+ UpdatePlaceholder();
+ else if (e.PropertyName == SearchBar.CancelButtonColorProperty.PropertyName)
+ UpdateCancelButtonColor();
+ else if (e.PropertyName == SearchBar.HorizontalTextAlignmentProperty.PropertyName)
+ UpdateAlignment();
+ else if (e.PropertyName == SearchBar.FontAttributesProperty.PropertyName)
+ UpdateFont();
+ else if (e.PropertyName == SearchBar.FontFamilyProperty.PropertyName)
+ UpdateFont();
+ else if (e.PropertyName == SearchBar.FontSizeProperty.PropertyName)
+ UpdateFont();
+ else if (e.PropertyName == SearchBar.TextColorProperty.PropertyName)
+ UpdateTextColor();
+ else if (e.PropertyName == SearchBar.PlaceholderColorProperty.PropertyName)
+ UpdatePlaceholderColor();
+ }
+
+ void OnControlLoaded(object sender, RoutedEventArgs routedEventArgs)
+ {
+ _queryTextBox = Control.GetFirstDescendant<FormsTextBox>();
+
+ UpdateAlignment();
+ UpdateTextColor();
+ UpdatePlaceholderColor();
+ }
+
+ void OnQuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs e)
+ {
+ Element.OnSearchButtonPressed();
+ }
+
+ void OnTextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs e)
+ {
+ if (e.Reason == AutoSuggestionBoxTextChangeReason.ProgrammaticChange)
+ return;
+
+ ((IElementController)Element).SetValueFromRenderer(SearchBar.TextProperty, sender.Text);
+ }
+
+ void UpdateAlignment()
+ {
+ if (_queryTextBox == null)
+ return;
+
+ _queryTextBox.TextAlignment = Element.HorizontalTextAlignment.ToNativeTextAlignment();
+ }
+
+ void UpdateCancelButtonColor()
+ {
+ var foregroundBrush = Windows.UI.Xaml.Application.Current.Resources["FormsCancelForegroundBrush"] as SolidColorBrush;
+ var backgroundBrush = Windows.UI.Xaml.Application.Current.Resources["FormsCancelBackgroundBrush"] as SolidColorBrush;
+
+ Color cancelColor = Element.CancelButtonColor;
+
+ if (cancelColor.IsDefault)
+ {
+ backgroundBrush.Color = (Windows.UI.Xaml.Application.Current.Resources["TextBoxButtonBackgroundThemeBrush"] as SolidColorBrush).Color;
+ foregroundBrush.Color = (Windows.UI.Xaml.Application.Current.Resources["SystemControlBackgroundChromeBlackMediumBrush"] as SolidColorBrush).Color;
+ }
+ else
+ {
+ Windows.UI.Color newColor = cancelColor.ToWindowsColor();
+ backgroundBrush.Color = newColor;
+ foregroundBrush.Color = newColor.GetIdealForegroundForBackgroundColor();
+ }
+ }
+
+ void UpdateFont()
+ {
+ if (Control == null)
+ return;
+
+ SearchBar searchBar = Element;
+
+ if (searchBar == null)
+ return;
+
+ bool searchBarIsDefault = searchBar.FontFamily == null && searchBar.FontSize == Device.GetNamedSize(NamedSize.Default, typeof(SearchBar), true) && searchBar.FontAttributes == FontAttributes.None;
+
+ if (searchBarIsDefault && !_fontApplied)
+ return;
+
+ if (searchBarIsDefault)
+ {
+ Control.ClearValue(Windows.UI.Xaml.Controls.Control.FontStyleProperty);
+ Control.ClearValue(Windows.UI.Xaml.Controls.Control.FontSizeProperty);
+ Control.ClearValue(Windows.UI.Xaml.Controls.Control.FontFamilyProperty);
+ Control.ClearValue(Windows.UI.Xaml.Controls.Control.FontWeightProperty);
+ Control.ClearValue(Windows.UI.Xaml.Controls.Control.FontStretchProperty);
+ }
+ else
+ Control.ApplyFont(searchBar);
+
+ _fontApplied = true;
+ }
+
+ void UpdatePlaceholder()
+ {
+ Control.PlaceholderText = Element.Placeholder ?? string.Empty;
+ }
+
+ void UpdatePlaceholderColor()
+ {
+ if (_queryTextBox == null)
+ return;
+
+ Color placeholderColor = Element.PlaceholderColor;
+
+ if (placeholderColor.IsDefault)
+ {
+ if (_defaultPlaceholderColorBrush == null)
+ return;
+
+ _queryTextBox.PlaceholderForegroundBrush = _defaultPlaceholderColorBrush;
+ _queryTextBox.PlaceholderForegroundBrush = _defaultPlaceholderColorFocusBrush;
+ }
+
+ if (_defaultPlaceholderColorBrush == null)
+ {
+ _defaultPlaceholderColorBrush = _queryTextBox.PlaceholderForegroundBrush;
+ _defaultPlaceholderColorFocusBrush = _queryTextBox.PlaceholderForegroundFocusBrush;
+ }
+
+ _queryTextBox.PlaceholderForegroundBrush = placeholderColor.ToBrush();
+ _queryTextBox.PlaceholderForegroundFocusBrush = placeholderColor.ToBrush();
+ }
+
+ void UpdateText()
+ {
+ Control.Text = Element.Text ?? string.Empty;
+ }
+
+ void UpdateTextColor()
+ {
+ if (_queryTextBox == null)
+ return;
+
+ Color textColor = Element.TextColor;
+
+ if (textColor.IsDefault)
+ {
+ if (_defaultTextColorBrush == null)
+ return;
+
+ _queryTextBox.Foreground = _defaultTextColorBrush;
+ _queryTextBox.ForegroundFocusBrush = _defaultTextColorFocusBrush;
+ }
+
+ if (_defaultTextColorBrush == null)
+ {
+ _defaultTextColorBrush = _queryTextBox.Foreground;
+ _defaultTextColorFocusBrush = _queryTextBox.ForegroundFocusBrush;
+ }
+
+ _queryTextBox.Foreground = textColor.ToBrush();
+ _queryTextBox.ForegroundFocusBrush = textColor.ToBrush();
+ }
+ }
+} \ No newline at end of file
diff --git a/Xamarin.Forms.Platform.UAP/StepperControl.cs b/Xamarin.Forms.Platform.UAP/StepperControl.cs
new file mode 100644
index 0000000..0de0931
--- /dev/null
+++ b/Xamarin.Forms.Platform.UAP/StepperControl.cs
@@ -0,0 +1,227 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
+using Windows.UI.Xaml.Media;
+
+namespace Xamarin.Forms.Platform.UWP
+{
+ public sealed class StepperControl : Control
+ {
+ public static readonly DependencyProperty ValueProperty = DependencyProperty.Register("Value", typeof(double), typeof(StepperControl), new PropertyMetadata(default(double), OnValueChanged));
+
+ public static readonly DependencyProperty MaximumProperty = DependencyProperty.Register("Maximum", typeof(double), typeof(StepperControl), new PropertyMetadata(default(double), OnMaxMinChanged));
+
+ public static readonly DependencyProperty MinimumProperty = DependencyProperty.Register("Minimum", typeof(double), typeof(StepperControl), new PropertyMetadata(default(double), OnMaxMinChanged));
+
+ public static readonly DependencyProperty IncrementProperty = DependencyProperty.Register("Increment", typeof(double), typeof(StepperControl),
+ new PropertyMetadata(default(double), OnIncrementChanged));
+
+ Windows.UI.Xaml.Controls.Button _plus;
+ Windows.UI.Xaml.Controls.Button _minus;
+ VisualStateCache _plusStateCache;
+ VisualStateCache _minusStateCache;
+
+ public StepperControl()
+ {
+ DefaultStyleKey = typeof(StepperControl);
+ }
+
+ public double Increment
+ {
+ get { return (double)GetValue(IncrementProperty); }
+ set { SetValue(IncrementProperty, value); }
+ }
+
+ public double Maximum
+ {
+ get { return (double)GetValue(MaximumProperty); }
+ set { SetValue(MaximumProperty, value); }
+ }
+
+ public double Minimum
+ {
+ get { return (double)GetValue(MinimumProperty); }
+ set { SetValue(MinimumProperty, value); }
+ }
+
+ public double Value
+ {
+ get { return (double)GetValue(ValueProperty); }
+ set { SetValue(ValueProperty, value); }
+ }
+
+ public event EventHandler ValueChanged;
+
+ protected override void OnApplyTemplate()
+ {
+ base.OnApplyTemplate();
+
+ _plus = GetTemplateChild("Plus") as Windows.UI.Xaml.Controls.Button;
+ if (_plus != null)
+ _plus.Click += OnPlusClicked;
+
+ _minus = GetTemplateChild("Minus") as Windows.UI.Xaml.Controls.Button;
+ if (_minus != null)
+ _minus.Click += OnMinusClicked;
+
+ UpdateEnabled(Value);
+ }
+
+ static void OnIncrementChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+ {
+ var stepper = (StepperControl)d;
+ stepper.UpdateEnabled(stepper.Value);
+ }
+
+ static void OnMaxMinChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+ {
+ var stepper = (StepperControl)d;
+ stepper.UpdateEnabled(stepper.Value);
+ }
+
+ void OnMinusClicked(object sender, RoutedEventArgs e)
+ {
+ UpdateValue(-Increment);
+ }
+
+ void OnPlusClicked(object sender, RoutedEventArgs e)
+ {
+ UpdateValue(+Increment);
+ }
+
+ static void OnValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+ {
+ var stepper = (StepperControl)d;
+ stepper.UpdateEnabled((double)e.NewValue);
+
+ EventHandler changed = stepper.ValueChanged;
+ if (changed != null)
+ changed(d, EventArgs.Empty);
+ }
+
+ VisualStateCache PseudoDisable(Control control)
+ {
+ if (VisualTreeHelper.GetChildrenCount(control) == 0)
+ control.ApplyTemplate();
+
+ VisualStateManager.GoToState(control, "Disabled", true);
+
+ var rootElement = (FrameworkElement)VisualTreeHelper.GetChild(control, 0);
+
+ var cache = new VisualStateCache();
+ IList<VisualStateGroup> groups = VisualStateManager.GetVisualStateGroups(rootElement);
+
+ VisualStateGroup common = null;
+ foreach (var group in groups)
+ {
+ if (group.Name == "CommonStates")
+ common = group;
+ else if (group.Name == "FocusStates")
+ cache.FocusStates = group;
+ else if (cache.FocusStates != null && common != null)
+ break;
+ }
+
+ if (cache.FocusStates != null)
+ groups.Remove(cache.FocusStates);
+
+ if (common != null)
+ {
+ foreach (VisualState state in common.States)
+ {
+ if (state.Name == "Normal")
+ cache.Normal = state;
+ else if (state.Name == "Pressed")
+ cache.Pressed = state;
+ else if (state.Name == "PointerOver")
+ cache.PointerOver = state;
+ }
+
+ if (cache.Normal != null)
+ common.States.Remove(cache.Normal);
+ if (cache.Pressed != null)
+ common.States.Remove(cache.Pressed);
+ if (cache.PointerOver != null)
+ common.States.Remove(cache.PointerOver);
+ }
+
+ return cache;
+ }
+
+ /*
+ The below serves as a way to disable the button visually, rather than using IsEnabled. It's a hack
+ but should remain stable as long as the user doesn't change the WinRT Button template too much.
+
+ The reason we're not using IsEnabled is that the buttons have a click radius that overlap about 40%
+ of the next button. This doesn't cause a problem until one button becomes disabled, then if you think
+ you're still hitting + (haven't noticed its disabled), you will actually hit -. This hack doesn't
+ completely solve the problem, but it drops the overlap to something like 20%. I haven't found the root
+ cause, so this will have to suffice for now.
+ */
+
+ void PsuedoEnable(Control control, ref VisualStateCache cache)
+ {
+ if (cache == null || VisualTreeHelper.GetChildrenCount(control) == 0)
+ return;
+
+ var rootElement = (FrameworkElement)VisualTreeHelper.GetChild(control, 0);
+
+ IList<VisualStateGroup> groups = VisualStateManager.GetVisualStateGroups(rootElement);
+
+ if (cache.FocusStates != null)
+ groups.Add(cache.FocusStates);
+
+ var commonStates = groups.FirstOrDefault(g => g.Name == "CommonStates");
+ if (commonStates == null)
+ return;
+
+ if (cache.Normal != null)
+ commonStates.States.Insert(0, cache.Normal); // defensive
+ if (cache.Pressed != null)
+ commonStates.States.Add(cache.Pressed);
+ if (cache.PointerOver != null)
+ commonStates.States.Add(cache.PointerOver);
+
+ VisualStateManager.GoToState(control, "Normal", true);
+
+ cache = null;
+ }
+
+ void UpdateEnabled(double value)
+ {
+ double increment = Increment;
+ if (_plus != null)
+ {
+ if (value + increment > Maximum)
+ _plusStateCache = PseudoDisable(_plus);
+ else
+ PsuedoEnable(_plus, ref _plusStateCache);
+ }
+
+ if (_minus != null)
+ {
+ if (value - increment < Minimum)
+ _minusStateCache = PseudoDisable(_minus);
+ else
+ PsuedoEnable(_minus, ref _minusStateCache);
+ }
+ }
+
+ void UpdateValue(double delta)
+ {
+ double newValue = Value + delta;
+ if (newValue > Maximum || newValue < Minimum)
+ return;
+
+ Value = newValue;
+ }
+
+ class VisualStateCache
+ {
+ public VisualStateGroup FocusStates;
+ public VisualState Normal, PointerOver, Pressed;
+ }
+ }
+} \ No newline at end of file
diff --git a/Xamarin.Forms.Platform.UAP/TabbedPageRenderer.cs b/Xamarin.Forms.Platform.UAP/TabbedPageRenderer.cs
new file mode 100644
index 0000000..6dfc1a4
--- /dev/null
+++ b/Xamarin.Forms.Platform.UAP/TabbedPageRenderer.cs
@@ -0,0 +1,264 @@
+using System;
+using System.Collections.Specialized;
+using System.ComponentModel;
+using System.Threading.Tasks;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Automation;
+using Windows.UI.Xaml.Controls;
+using Windows.UI.Xaml.Media;
+
+namespace Xamarin.Forms.Platform.UWP
+{
+ internal class TabbedPagePresenter : Windows.UI.Xaml.Controls.ContentPresenter
+ {
+ public TabbedPagePresenter()
+ {
+ Loaded += TabbedPagePresenter_Loaded;
+ Unloaded += TabbedPagePresenter_Unloaded;
+ SizeChanged += (s, e) =>
+ {
+ if (ActualWidth > 0 && ActualHeight > 0)
+ {
+ var tab = (Page)DataContext;
+ ((TabbedPage)tab.RealParent).ContainerArea = new Rectangle(0, 0, ActualWidth, ActualHeight);
+ }
+ };
+ }
+
+ void TabbedPagePresenter_Loaded(object sender, RoutedEventArgs e)
+ {
+ var tab = (Page)DataContext;
+ tab.SendAppearing();
+ }
+
+ void TabbedPagePresenter_Unloaded(object sender, RoutedEventArgs e)
+ {
+ var tab = (Page)DataContext;
+ tab.SendDisappearing();
+ }
+ }
+
+ public class TabbedPageRenderer : IVisualElementRenderer, ITitleProvider, IToolbarProvider
+ {
+ bool _disposed;
+ bool _showTitle;
+ VisualElementTracker<Page, Pivot> _tracker;
+
+ public Pivot Control { get; private set; }
+
+ public TabbedPage Element { get; private set; }
+
+ protected VisualElementTracker<Page, Pivot> Tracker
+ {
+ get { return _tracker; }
+ set
+ {
+ if (_tracker == value)
+ return;
+
+ if (_tracker != null)
+ _tracker.Dispose();
+
+ _tracker = value;
+ }
+ }
+
+ public void Dispose()
+ {
+ Dispose(true);
+ }
+
+ Brush ITitleProvider.BarBackgroundBrush
+ {
+ set { (Control as FormsPivot).ToolbarBackground = value; }
+ }
+
+ Brush ITitleProvider.BarForegroundBrush
+ {
+ set { (Control as FormsPivot).ToolbarForeground = value; }
+ }
+
+ bool ITitleProvider.ShowTitle
+ {
+ get { return _showTitle; }
+
+ set
+ {
+ if (_showTitle == value)
+ return;
+ _showTitle = value;
+
+ UpdateBarVisibility();
+ }
+ }
+
+ string ITitleProvider.Title
+ {
+ get { return (string)Control?.Title; }
+
+ set
+ {
+ if (Control != null && _showTitle)
+ Control.Title = value;
+ }
+ }
+
+ public Task<CommandBar> GetCommandBarAsync()
+ {
+ return (Control as IToolbarProvider)?.GetCommandBarAsync();
+ }
+
+ public FrameworkElement ContainerElement
+ {
+ get { return Control; }
+ }
+
+ VisualElement IVisualElementRenderer.Element
+ {
+ get { return Element; }
+ }
+
+ public event EventHandler<VisualElementChangedEventArgs> ElementChanged;
+
+ public SizeRequest GetDesiredSize(double widthConstraint, double heightConstraint)
+ {
+ var constraint = new Windows.Foundation.Size(widthConstraint, heightConstraint);
+
+ double oldWidth = Control.Width;
+ double oldHeight = Control.Height;
+
+ Control.Height = double.NaN;
+ Control.Width = double.NaN;
+
+ Control.Measure(constraint);
+ var result = new Size(Math.Ceiling(Control.DesiredSize.Width), Math.Ceiling(Control.DesiredSize.Height));
+
+ Control.Width = oldWidth;
+ Control.Height = oldHeight;
+
+ return new SizeRequest(result);
+ }
+
+ public void SetElement(VisualElement element)
+ {
+ if (element != null && !(element is TabbedPage))
+ throw new ArgumentException("Element must be a TabbedPage", "element");
+
+ TabbedPage oldElement = Element;
+ Element = (TabbedPage)element;
+
+ if (oldElement != null)
+ {
+ oldElement.PropertyChanged -= OnElementPropertyChanged;
+ ((INotifyCollectionChanged)oldElement.Children).CollectionChanged -= OnPagesChanged;
+ }
+
+ if (element != null)
+ {
+ if (Control == null)
+ {
+ Control = new FormsPivot { Style = (Windows.UI.Xaml.Style)Windows.UI.Xaml.Application.Current.Resources["TabbedPageStyle"] };
+
+ Control.SelectionChanged += OnSelectionChanged;
+
+ Tracker = new BackgroundTracker<Pivot>(Windows.UI.Xaml.Controls.Control.BackgroundProperty) { Element = (Page)element, Control = Control, Container = Control };
+
+ Control.Loaded += OnLoaded;
+ Control.Unloaded += OnUnloaded;
+ }
+
+ Control.DataContext = Element;
+ OnPagesChanged(Element.Children, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
+ UpdateCurrentPage();
+
+ ((INotifyCollectionChanged)Element.Children).CollectionChanged += OnPagesChanged;
+ element.PropertyChanged += OnElementPropertyChanged;
+
+ if (!string.IsNullOrEmpty(element.AutomationId))
+ Control.SetValue(AutomationProperties.AutomationIdProperty, element.AutomationId);
+ }
+
+ OnElementChanged(new VisualElementChangedEventArgs(oldElement, element));
+ }
+
+ protected virtual void Dispose(bool disposing)
+ {
+ if (!disposing || _disposed)
+ return;
+
+ _disposed = true;
+ Element?.SendDisappearing();
+ SetElement(null);
+ Tracker = null;
+ }
+
+ protected void OnElementChanged(VisualElementChangedEventArgs e)
+ {
+ EventHandler<VisualElementChangedEventArgs> changed = ElementChanged;
+ if (changed != null)
+ changed(this, e);
+ }
+
+ void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
+ {
+ if (e.PropertyName == "CurrentPage")
+ UpdateCurrentPage();
+ }
+
+ void OnLoaded(object sender, RoutedEventArgs args)
+ {
+ if (Element == null)
+ return;
+
+ Element.SendAppearing();
+ }
+
+ void OnPagesChanged(object sender, NotifyCollectionChangedEventArgs e)
+ {
+ e.Apply(Element.Children, Control.Items);
+
+ // Potential performance issue, UpdateLayout () is called for every page change
+ Control.UpdateLayout();
+ }
+
+ void OnSelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ if (Element == null)
+ return;
+
+ Page page = e.AddedItems.Count > 0 ? (Page)e.AddedItems[0] : null;
+ Page currentPage = Element.CurrentPage;
+ if (currentPage == page)
+ return;
+ currentPage?.SendDisappearing();
+ Element.CurrentPage = page;
+ page?.SendAppearing();
+ }
+
+ void OnUnloaded(object sender, RoutedEventArgs args)
+ {
+ if (Element == null)
+ return;
+
+ Element.SendDisappearing();
+ }
+
+ void UpdateBarVisibility()
+ {
+ (Control as FormsPivot).ToolbarVisibility = _showTitle ? Visibility.Visible : Visibility.Collapsed;
+ }
+
+ void UpdateCurrentPage()
+ {
+ Page page = Element.CurrentPage;
+
+ var nav = page as NavigationPage;
+ ((ITitleProvider)this).ShowTitle = nav != null;
+
+ if (page == null)
+ return;
+
+ Control.SelectedItem = page;
+ }
+ }
+} \ 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
new file mode 100644
index 0000000..4ed5242
--- /dev/null
+++ b/Xamarin.Forms.Platform.UAP/Xamarin.Forms.Platform.UAP.csproj
@@ -0,0 +1,450 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProjectGuid>{00D8D049-FFAA-4759-8FC9-1ECA30777F72}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>Xamarin.Forms.Platform.UAP</RootNamespace>
+ <AssemblyName>Xamarin.Forms.Platform.UAP</AssemblyName>
+ <DefaultLanguage>en-US</DefaultLanguage>
+ <TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
+ <TargetPlatformVersion>10.0.10240.0</TargetPlatformVersion>
+ <TargetPlatformMinVersion>10.0.10240.0</TargetPlatformMinVersion>
+ <MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
+ <FileAlignment>512</FileAlignment>
+ <ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <PlatformTarget>AnyCPU</PlatformTarget>
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <PlatformTarget>AnyCPU</PlatformTarget>
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
+ <PlatformTarget>ARM</PlatformTarget>
+ <DebugSymbols>true</DebugSymbols>
+ <OutputPath>bin\ARM\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
+ <NoWarn>;2008</NoWarn>
+ <DebugType>full</DebugType>
+ <PlatformTarget>ARM</PlatformTarget>
+ <UseVSHostingProcess>false</UseVSHostingProcess>
+ <ErrorReport>prompt</ErrorReport>
+ <Prefer32Bit>true</Prefer32Bit>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
+ <PlatformTarget>ARM</PlatformTarget>
+ <OutputPath>bin\ARM\Release\</OutputPath>
+ <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
+ <Optimize>true</Optimize>
+ <NoWarn>;2008</NoWarn>
+ <DebugType>pdbonly</DebugType>
+ <PlatformTarget>ARM</PlatformTarget>
+ <UseVSHostingProcess>false</UseVSHostingProcess>
+ <ErrorReport>prompt</ErrorReport>
+ <Prefer32Bit>true</Prefer32Bit>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
+ <PlatformTarget>x64</PlatformTarget>
+ <DebugSymbols>true</DebugSymbols>
+ <OutputPath>bin\x64\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
+ <NoWarn>;2008</NoWarn>
+ <DebugType>full</DebugType>
+ <PlatformTarget>x64</PlatformTarget>
+ <UseVSHostingProcess>false</UseVSHostingProcess>
+ <ErrorReport>prompt</ErrorReport>
+ <Prefer32Bit>true</Prefer32Bit>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
+ <PlatformTarget>x64</PlatformTarget>
+ <OutputPath>bin\x64\Release\</OutputPath>
+ <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
+ <Optimize>true</Optimize>
+ <NoWarn>;2008</NoWarn>
+ <DebugType>pdbonly</DebugType>
+ <PlatformTarget>x64</PlatformTarget>
+ <UseVSHostingProcess>false</UseVSHostingProcess>
+ <ErrorReport>prompt</ErrorReport>
+ <Prefer32Bit>true</Prefer32Bit>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
+ <PlatformTarget>x86</PlatformTarget>
+ <DebugSymbols>true</DebugSymbols>
+ <OutputPath>bin\x86\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
+ <NoWarn>;2008</NoWarn>
+ <DebugType>full</DebugType>
+ <PlatformTarget>x86</PlatformTarget>
+ <UseVSHostingProcess>false</UseVSHostingProcess>
+ <ErrorReport>prompt</ErrorReport>
+ <Prefer32Bit>true</Prefer32Bit>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
+ <PlatformTarget>x86</PlatformTarget>
+ <OutputPath>bin\x86\Release\</OutputPath>
+ <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
+ <Optimize>true</Optimize>
+ <NoWarn>;2008</NoWarn>
+ <DebugType>pdbonly</DebugType>
+ <PlatformTarget>x86</PlatformTarget>
+ <UseVSHostingProcess>false</UseVSHostingProcess>
+ <ErrorReport>prompt</ErrorReport>
+ <Prefer32Bit>true</Prefer32Bit>
+ </PropertyGroup>
+ <ItemGroup>
+ <!-- A reference to the entire .Net Framework and Windows SDK are automatically included -->
+ <None Include="project.json" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT.Phone\FormsPivot.cs">
+ <Link>FormsPivot.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\AlignmentExtensions.cs">
+ <Link>AlignmentExtensions.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\CarouselViewRenderer.cs">
+ <Link>CarouselViewRenderer.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\FormsTextBox.cs">
+ <Link>FormsTextBox.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\FormsComboBox.cs">
+ <Link>FormsComboBox.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\FormsDatePicker.cs">
+ <Link>FormsDatePicker.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\FormsTimePicker.cs">
+ <Link>FormsTimePicker.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\HorizontalTextAlignmentConverter.cs">
+ <Link>HorizontalTextAlignmentConverter.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\ITitleProvider.cs">
+ <Link>ITitleProvider.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\IToolbarProvider.cs">
+ <Link>IToolbarProvider.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\IWrapperAware.cs">
+ <Link>IWrapperAware.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\NativeViewWrapper.cs">
+ <Link>NativeViewWrapper.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\NativeViewWrapperRenderer.cs">
+ <Link>NativeViewWrapperRenderer.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\PlatformEffect.cs">
+ <Link>PlatformEffect.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\ViewExtensions.cs">
+ <Link>ViewExtensions.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\LayoutExtensions.cs">
+ <Link>LayoutExtensions.cs</Link>
+ </Compile>
+ <Compile Include="IToolBarForegroundBinder.cs" />
+ <Compile Include="SearchBarRenderer.cs" />
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\TextAlignmentToHorizontalAlignmentConverter.cs">
+ <Link>TextAlignmentToHorizontalAlignmentConverter.cs</Link>
+ </Compile>
+ <Compile Include="StepperControl.cs" />
+ <Compile Include="TabbedPageRenderer.cs" />
+ <Content Include="Properties\Xamarin.Forms.Platform.UAP.rd.xml" />
+ <Compile Include="..\Xamarin.Forms.Core\Properties\GlobalAssemblyInfo.cs">
+ <Link>Properties\GlobalAssemblyInfo.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT.Tablet\Forms.cs">
+ <Link>Forms.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT.Tablet\WindowsPage.cs">
+ <Link>WindowsPage.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT.Tablet\WindowsPlatform.cs">
+ <Link>WindowsPlatform.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT.Tablet\WindowsPlatformServices.cs">
+ <Link>WindowsPlatformServices.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT.Tablet\WindowsResourcesProvider.cs">
+ <Link>WindowsResourcesProvider.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\ActivityIndicatorRenderer.cs">
+ <Link>ActivityIndicatorRenderer.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\AsyncValue.cs">
+ <Link>AsyncValue.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\BackgroundTracker.cs">
+ <Link>BackgroundTracker.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\BoolToVisibilityConverter.cs">
+ <Link>BoolToVisibilityConverter.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\BoxViewRenderer.cs">
+ <Link>BoxViewRenderer.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\ButtonRenderer.cs">
+ <Link>ButtonRenderer.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\CarouselPageRenderer.cs">
+ <Link>CarouselPageRenderer.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\CaseConverter.cs">
+ <Link>CaseConverter.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\CellControl.cs">
+ <Link>CellControl.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\CollapseWhenEmptyConverter.cs">
+ <Link>CollapseWhenEmptyConverter.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\ColorConverter.cs">
+ <Link>ColorConverter.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\ConvertExtensions.cs">
+ <Link>ConvertExtensions.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\DatePickerRenderer.cs">
+ <Link>DatePickerRenderer.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\DefaultRenderer.cs">
+ <Link>DefaultRenderer.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\EditorRenderer.cs">
+ <Link>EditorRenderer.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\EntryCellTextBox.cs">
+ <Link>EntryCellTextBox.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\EntryRenderer.cs">
+ <Link>EntryRenderer.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\ExportRendererAttribute.cs">
+ <Link>ExportRendererAttribute.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\Extensions.cs">
+ <Link>Extensions.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\FileImageSourceHandler.cs">
+ <Link>FileImageSourceHandler.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\FileImageSourcePathConverter.cs">
+ <Link>FileImageSourcePathConverter.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\FontExtensions.cs">
+ <Link>FontExtensions.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\FormsButton.cs">
+ <Link>FormsButton.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\FrameRenderer.cs">
+ <Link>FrameRenderer.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\FrameworkElementExtensions.cs">
+ <Link>FrameworkElementExtensions.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\HeightConverter.cs">
+ <Link>HeightConverter.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\ICellRenderer.cs">
+ <Link>ICellRenderer.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\IImageSourceHandler.cs">
+ <Link>IImageSourceHandler.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\ImageConverter.cs">
+ <Link>ImageConverter.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\ImageLoaderSourceHandler.cs">
+ <Link>ImageLoaderSourceHandler.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\ImageRenderer.cs">
+ <Link>ImageRenderer.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\IVisualElementRenderer.cs">
+ <Link>IVisualElementRenderer.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\KeyboardConverter.cs">
+ <Link>KeyboardConverter.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\KeyboardExtensions.cs">
+ <Link>KeyboardExtensions.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\LabelRenderer.cs">
+ <Link>LabelRenderer.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\LayoutRenderer.cs">
+ <Link>LayoutRenderer.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\ListGroupHeaderPresenter.cs">
+ <Link>ListGroupHeaderPresenter.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\ListViewGroupStyleSelector.cs">
+ <Link>ListViewGroupStyleSelector.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\ListViewRenderer.cs">
+ <Link>ListViewRenderer.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\MasterBackgroundConverter.cs">
+ <Link>MasterBackgroundConverter.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\MenuItemCommand.cs">
+ <Link>MenuItemCommand.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\NavigationPageRenderer.cs">
+ <Link>NavigationPageRenderer.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\PageControl.xaml.cs">
+ <Link>PageControl.xaml.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\PageRenderer.cs">
+ <Link>PageRenderer.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\PageToRenderedElementConverter.cs">
+ <Link>PageToRenderedElementConverter.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\PickerRenderer.cs">
+ <Link>PickerRenderer.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\Platform.cs">
+ <Link>Platform.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\ProgressBarRenderer.cs">
+ <Link>ProgressBarRenderer.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\RendererFactory.cs">
+ <Link>RendererFactory.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\ScrollViewRenderer.cs">
+ <Link>ScrollViewRenderer.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\SliderRenderer.cs">
+ <Link>SliderRenderer.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\StepperRenderer.cs">
+ <Link>StepperRenderer.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\StreamImagesourceHandler.cs">
+ <Link>StreamImagesourceHandler.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\SwitchRenderer.cs">
+ <Link>SwitchRenderer.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\TableViewRenderer.cs">
+ <Link>TableViewRenderer.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\TaskExtensions.cs">
+ <Link>TaskExtensions.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\TextCellRenderer.cs">
+ <Link>TextCellRenderer.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\TimePickerRenderer.cs">
+ <Link>TimePickerRenderer.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\ViewRenderer.cs">
+ <Link>ViewRenderer.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\ViewToRendererConverter.cs">
+ <Link>ViewToRendererConverter.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\VisualElementChangedEventArgs.cs">
+ <Link>VisualElementChangedEventArgs.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\VisualElementExtensions.cs">
+ <Link>VisualElementExtensions.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\VisualElementPackager.cs">
+ <Link>VisualElementPackager.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\VisualElementRenderer.cs">
+ <Link>VisualElementRenderer.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\VisualElementTracker.cs">
+ <Link>VisualElementTracker.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\WebViewRenderer.cs">
+ <Link>WebViewRenderer.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\WindowsBasePage.cs">
+ <Link>WindowsBasePage.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\WindowsBasePlatformServices.cs">
+ <Link>WindowsBasePlatformServices.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\WindowsDeviceInfo.cs">
+ <Link>WindowsDeviceInfo.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\WindowsExpressionSearch.cs">
+ <Link>WindowsExpressionSearch.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\WindowsIsolatedStorage.cs">
+ <Link>WindowsIsolatedStorage.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\WindowsSerializer.cs">
+ <Link>WindowsSerializer.cs</Link>
+ </Compile>
+ <Compile Include="..\Xamarin.Forms.Platform.WinRT\WindowsTicker.cs">
+ <Link>WindowsTicker.cs</Link>
+ </Compile>
+ <Compile Include="FormsCommandBar.cs" />
+ <Compile Include="MasterDetailControl.cs" />
+ <Compile Include="MasterDetailPageRenderer.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <Page Include="FormsTextBoxStyle.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
+ <Page Include="PageControl.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
+ <Page Include="Resources.xaml">
+ <Generator>MSBuild:Compile</Generator>
+ <SubType>Designer</SubType>
+ </Page>
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\Xamarin.Forms.Core\Xamarin.Forms.Core.csproj">
+ <Project>{57b8b73d-c3b5-4c42-869e-7b2f17d354ac}</Project>
+ <Name>Xamarin.Forms.Core</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <SDKReference Include="WindowsMobile, Version=10.0.10240.0">
+ <Name>Windows Mobile Extensions for the UWP</Name>
+ </SDKReference>
+ </ItemGroup>
+ <PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' ">
+ <VisualStudioVersion>14.0</VisualStudioVersion>
+ </PropertyGroup>
+ <Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project> \ No newline at end of file
diff --git a/Xamarin.Forms.Platform.UAP/project.json b/Xamarin.Forms.Platform.UAP/project.json
new file mode 100644
index 0000000..c594939
--- /dev/null
+++ b/Xamarin.Forms.Platform.UAP/project.json
@@ -0,0 +1,16 @@
+{
+ "dependencies": {
+ "Microsoft.NETCore.UniversalWindowsPlatform": "5.0.0"
+ },
+ "frameworks": {
+ "uap10.0": {}
+ },
+ "runtimes": {
+ "win10-arm": {},
+ "win10-arm-aot": {},
+ "win10-x86": {},
+ "win10-x86-aot": {},
+ "win10-x64": {},
+ "win10-x64-aot": {}
+ }
+} \ No newline at end of file