Fix Background color for xamarin platforms

This commit is contained in:
Maxime Dion 2019-05-26 08:18:50 -04:00
commit 397c8a4071
2 changed files with 284 additions and 226 deletions

View file

@ -1,5 +1,4 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:xamarin="http://uno.ui/xamarin"
xmlns:android="http://uno.ui/android"
xmlns:ios="http://uno.ui/ios"
@ -193,6 +192,8 @@
<Color x:Key="AccentHoverColor">#FF0077D7</Color>
<Color x:Key="XamarinBackgroundColor">#FFEBEBEB</Color>
<SolidColorBrush x:Key="AccentPressBackgroundColorBrush"
Color="{StaticResource AccentPressColor}" />
@ -229,6 +230,9 @@
<SolidColorBrush x:Key="AppControlPageTextBaseMediumHighBrush"
Color="{StaticResource SystemBaseMediumHighColor}" />
<SolidColorBrush x:Key="XamarinBackgroundBrush"
Color="{StaticResource XamarinBackgroundColor}" />
<win:RevealBackgroundBrush x:Key="AppControlHoverButtonFaceBrush"
Color="#17000000" />
@ -575,15 +579,68 @@
BasedOn="{StaticResource SymbolOperatorButtonStyle}"
TargetType="Controls:CalculatorButton">
<Setter Property="HoverBackground"
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Controls:CalculatorButton">
<Grid x:Name="RootGrid"
Background="{TemplateBinding Background}">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualStateGroup.Transitions>
<VisualTransition GeneratedDuration="0" />
<VisualTransition From="Normal"
GeneratedDuration="0:0:0.1"
To="KeyBoardEntry" />
</VisualStateGroup.Transitions>
<VisualState x:Name="Normal" />
<win:VisualState x:Name="PointerOver">
<VisualState.Setters>
<Setter Target="RootGrid.(RevealBrush.State)"
Value="PointerOver" />
<Setter Target="RootGrid.Background"
Value="{StaticResource AccentHoverBackgroundColorBrush}" />
<Setter Property="HoverForeground"
<Setter Target="ContentPresenter.(ContentPresenter.Foreground)"
Value="{ThemeResource AccentHoverForegroundColorBrush}" />
<Setter Property="PressBackground"
</VisualState.Setters>
</win:VisualState>
<VisualState x:Name="Pressed">
<VisualState.Setters>
<Setter Target="RootGrid.(RevealBrush.State)"
Value="Pressed" />
<Setter Target="RootGrid.Background"
Value="{StaticResource AccentPressBackgroundColorBrush}" />
<Setter Property="PressForeground"
<Setter Target="ContentPresenter.(ContentPresenter.Foreground)"
Value="{ThemeResource AccentHoverForegroundColorBrush}" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Disabled">
<VisualState.Setters>
<Setter Target="ContentPresenter.Foreground"
Value="{ThemeResource SystemControlDisabledBaseLowBrush}" />
<Setter Target="ContentPresenter.BorderThickness"
Value="0" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="KeyBoardEntry" />
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<ContentPresenter x:Name="ContentPresenter"
Margin="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
VerticalAlignment="{TemplateBinding VerticalAlignment}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
BorderBrush="{ThemeResource AppControlForegroundTransparentRevealBorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
AutomationProperties.AccessibilityView="Raw"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
ContentTransitions="{TemplateBinding ContentTransitions}" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- RESULTS -->

View file

@ -12,8 +12,9 @@
x:Name="pageRoot"
Background="{ThemeResource AppChromeAcrylicHostBackdropMediumLowBrush}"
Loaded="OnPageLoaded"
xmlns:xamarin="http://uno.ui/xamarin"
xmlns:android="http://nventive.com/android"
mc:Ignorable="android">
mc:Ignorable="android xamarin">
<!--
xmlns:automation="using:WindowsCalculator.Common.Automation"
-->
@ -63,7 +64,7 @@
</Page.Resources>
<Grid toolkit:VisibleBoundsPadding.PaddingMask="All"
android:Background="White">
xamarin:Background="{StaticResource XamarinBackgroundBrush}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<!--
@ -128,7 +129,7 @@
-->
<local:TitleBar x:Name="CustomTitleBar"
Grid.Row="0"
Visibility="Collapsed"/>
Visibility="Collapsed" />
<!--UNO TODO
-->