Browse Source

Merge pull request #4411 from maxkatz6/fixes/fix-missed-resources

Fixes/fix missed resources
danwalmsley 5 years ago
parent
commit
57eafe2933

+ 4 - 4
samples/ControlCatalog/App.xaml

@@ -4,14 +4,14 @@
   <Application.Styles>        
     <StyleInclude Source="avares://Avalonia.Controls.DataGrid/Themes/Default.xaml"/>
     <Style Selector="TextBlock.h1">
-      <Setter Property="FontSize" Value="{DynamicResource FontSizeLarge}"/>
-      <Setter Property="FontWeight" Value="Medium"/>
+      <Setter Property="FontSize" Value="16" />
+      <Setter Property="FontWeight" Value="Medium" />
     </Style>
     <Style Selector="TextBlock.h2">
-      <Setter Property="FontSize" Value="{DynamicResource FontSizeNormal}"/>
+      <Setter Property="FontSize" Value="14" />
     </Style>
     <Style Selector="TextBlock.h3">
-      <Setter Property="FontSize" Value="{DynamicResource FontSizeSmall}"/>
+      <Setter Property="FontSize" Value="10" />
     </Style>
     <StyleInclude Source="/SideBar.xaml"/>
   </Application.Styles>

+ 2 - 2
samples/ControlCatalog/App.xaml.cs

@@ -67,9 +67,9 @@ namespace ControlCatalog
 
         public override void Initialize()
         {
-            AvaloniaXamlLoader.Load(this);
-
             Styles.Insert(0, FluentDark);
+
+            AvaloniaXamlLoader.Load(this);
         }
 
         public override void OnFrameworkInitializationCompleted()

+ 1 - 3
samples/ControlCatalog/MainView.xaml

@@ -1,9 +1,7 @@
 <UserControl xmlns="https://github.com/avaloniaui"
         xmlns:pages="clr-namespace:ControlCatalog.Pages"
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-        x:Class="ControlCatalog.MainView"
-        Foreground="{DynamicResource ThemeForegroundBrush}"
-        FontSize="{DynamicResource FontSizeNormal}">
+        x:Class="ControlCatalog.MainView">
   <Grid>
     <Grid.Styles>
         <Style Selector="TextBlock.h2">

+ 12 - 2
samples/ControlCatalog/MainWindow.xaml.cs

@@ -63,8 +63,18 @@ namespace ControlCatalog
             // TODO: iOS does not support dynamically loading assemblies
             // so we must refer to this resource DLL statically. For
             // now I am doing that here. But we need a better solution!!
-            var theme = new Avalonia.Themes.Default.DefaultTheme();
-            theme.TryGetResource("Button", out _);
+            // Note, theme swiching probably will not work in runtime for iOS.
+            if (Application.Current.Styles.Contains(App.FluentDark)
+                || Application.Current.Styles.Contains(App.FluentLight))
+            {
+                var theme = new Avalonia.Themes.Fluent.FluentTheme();
+                theme.TryGetResource("Button", out _);
+            }
+            else
+            {
+                var theme = new Avalonia.Themes.Default.DefaultTheme();
+                theme.TryGetResource("Button", out _);
+            }
             AvaloniaXamlLoader.Load(this);
         }
     }

+ 4 - 0
samples/ControlCatalog/Pages/ButtonPage.xaml

@@ -20,6 +20,10 @@
               <Style.Resources>
                 <SolidColorBrush x:Key="ThemeBorderMidBrush">Red</SolidColorBrush>
                 <SolidColorBrush x:Key="ThemeControlHighBrush">DarkRed</SolidColorBrush>
+                <SolidColorBrush x:Key="ButtonBorderBrush">Red</SolidColorBrush>
+                <SolidColorBrush x:Key="ButtonBackground">DarkRed</SolidColorBrush>
+                <SolidColorBrush x:Key="ButtonBackgroundPointerOver">Red</SolidColorBrush>
+                <SolidColorBrush x:Key="ButtonBackgroundPressed">OrangeRed</SolidColorBrush>
               </Style.Resources>
             </Style>
           </Button.Styles>          

+ 1 - 1
samples/ControlCatalog/Pages/ItemsRepeaterPage.xaml

@@ -43,7 +43,7 @@
       <Button x:Name="scrollToLast">Scroll to Last</Button>
       <Button x:Name="scrollToRandom">Scroll to Random</Button>
     </StackPanel>
-    <Border BorderThickness="1" BorderBrush="{DynamicResource ThemeBorderMidBrush}" Margin="0 0 0 16">
+    <Border BorderThickness="1" BorderBrush="{DynamicResource SystemControlHighlightBaseMediumLowBrush}" Margin="0 0 0 16">
       <ScrollViewer Name="scroller"
                     HorizontalScrollBarVisibility="Auto"
                     VerticalScrollBarVisibility="Auto">

+ 7 - 6
samples/ControlCatalog/Pages/ScreenPage.cs

@@ -29,7 +29,8 @@ namespace ControlCatalog.Pages
             var screens = w.Screens.All;
             var scaling = ((IRenderRoot)w).RenderScaling;
 
-            Pen p = new Pen(Brushes.Black);
+            var drawBrush = Brushes.Green;
+            Pen p = new Pen(drawBrush);
             if (screens != null)
                 foreach (Screen screen in screens)
                 {
@@ -53,19 +54,19 @@ namespace ControlCatalog.Pages
                     };
 
                     text.Text = $"Bounds: {screen.Bounds.Width}:{screen.Bounds.Height}";
-                    context.DrawText(Brushes.Black, boundsRect.Position.WithY(boundsRect.Size.Height), text);
+                    context.DrawText(drawBrush, boundsRect.Position.WithY(boundsRect.Size.Height), text);
                     
                     text.Text = $"WorkArea: {screen.WorkingArea.Width}:{screen.WorkingArea.Height}";
-                    context.DrawText(Brushes.Black, boundsRect.Position.WithY(boundsRect.Size.Height + 20), text);
+                    context.DrawText(drawBrush, boundsRect.Position.WithY(boundsRect.Size.Height + 20), text);
 
                     text.Text = $"Scaling: {screen.PixelDensity * 100}%";
-                    context.DrawText(Brushes.Black, boundsRect.Position.WithY(boundsRect.Size.Height + 40), text);
+                    context.DrawText(drawBrush, boundsRect.Position.WithY(boundsRect.Size.Height + 40), text);
                     
                     text.Text = $"Primary: {screen.Primary}";
-                    context.DrawText(Brushes.Black, boundsRect.Position.WithY(boundsRect.Size.Height + 60), text);
+                    context.DrawText(drawBrush, boundsRect.Position.WithY(boundsRect.Size.Height + 60), text);
                     
                     text.Text = $"Current: {screen.Equals(w.Screens.ScreenFromBounds(new PixelRect(w.Position, PixelSize.FromSize(w.Bounds.Size, scaling))))}";
-                    context.DrawText(Brushes.Black, boundsRect.Position.WithY(boundsRect.Size.Height + 80), text);
+                    context.DrawText(drawBrush, boundsRect.Position.WithY(boundsRect.Size.Height + 80), text);
                 }
 
             context.DrawRectangle(p, new Rect(w.Position.X / 10f + Math.Abs(_leftMost), w.Position.Y / 10, w.Bounds.Width / 10, w.Bounds.Height / 10));

+ 2 - 2
samples/ControlCatalog/Pages/TextBlockPage.xaml

@@ -12,7 +12,7 @@
       <StackPanel.Styles>
         <Style Selector="Border">
           <Setter Property="BorderThickness" Value="1"/>
-          <Setter Property="BorderBrush" Value="{DynamicResource ThemeBorderMidBrush}"/>
+          <Setter Property="BorderBrush" Value="{DynamicResource SystemControlHighlightBaseMediumLowBrush}"/>
           <Setter Property="Padding" Value="2"/>
         </Style>
       </StackPanel.Styles>
@@ -49,7 +49,7 @@
       <StackPanel.Styles>
         <Style Selector="Border">
           <Setter Property="BorderThickness" Value="1"/>
-          <Setter Property="BorderBrush" Value="{DynamicResource ThemeBorderMidBrush}"/>
+          <Setter Property="BorderBrush" Value="{DynamicResource SystemControlHighlightBaseMediumLowBrush}"/>
           <Setter Property="Padding" Value="2"/>
         </Style>
       </StackPanel.Styles>

+ 2 - 2
src/Avalonia.Dialogs/ManagedFileChooser.xaml

@@ -66,7 +66,7 @@
             </StackPanel>
         </DockPanel>
 
-        <DropDown DockPanel.Dock="Bottom" 
+        <ComboBox DockPanel.Dock="Bottom" 
                   IsVisible="{Binding ShowFilters}" 
                   Items="{Binding Filters}"
                   SelectedItem="{Binding SelectedFilter}"
@@ -76,7 +76,7 @@
 
         <ListBox Margin="0 0 5 5" BorderBrush="Transparent" x:Name="QuickLinks" Items="{Binding QuickLinks}"
                  SelectedIndex="{Binding QuickLinksSelectedIndex}"
-                 DockPanel.Dock="Left" Background="{DynamicResource ThemeControlMidBrush}" Focusable="False">
+                 DockPanel.Dock="Left" Focusable="False">
             <ListBox.ItemTemplate>
                 <DataTemplate>
                     <StackPanel Spacing="4" Orientation="Horizontal" Background="Transparent">

+ 2 - 0
src/Avalonia.Themes.Default/Accents/BaseDark.xaml

@@ -58,6 +58,8 @@
         <SolidColorBrush x:Key="NotificationCardWarningBackgroundBrush" Color="#FDB328" Opacity="0.75"/>
         <SolidColorBrush x:Key="NotificationCardErrorBackgroundBrush" Color="#BD202C" Opacity="0.75"/>
 
+        <SolidColorBrush x:Key="ThemeControlTransparentBrush" Color="Transparent" />
+      
         <Thickness x:Key="ThemeBorderThickness">1,1,1,1</Thickness>
         <sys:Double x:Key="ThemeDisabledOpacity">0.5</sys:Double>
 

+ 2 - 0
src/Avalonia.Themes.Default/Accents/BaseLight.xaml

@@ -61,6 +61,8 @@
         <SolidColorBrush x:Key="NotificationCardWarningBackgroundBrush" Color="#FDB328" Opacity="0.75"/>
         <SolidColorBrush x:Key="NotificationCardErrorBackgroundBrush" Color="#BD202C" Opacity="0.75"/>
 
+        <SolidColorBrush x:Key="ThemeControlTransparentBrush" Color="Transparent" />
+
         <Thickness x:Key="ThemeBorderThickness">1</Thickness>
         <sys:Double x:Key="ThemeDisabledOpacity">0.5</sys:Double>
 

+ 1 - 1
src/Avalonia.Themes.Default/TabItem.xaml

@@ -2,7 +2,7 @@
     <Style Selector="TabItem">
         <Setter Property="Background" Value="Transparent"/>
         <Setter Property="FontSize" Value="{DynamicResource FontSizeLarge}"/>
-        <Setter Property="Foreground" Value="{DynamicResource ThemeForegroundLightBrush}"/>
+        <Setter Property="Foreground" Value="{DynamicResource ThemeForegroundLowBrush}"/>
         <Setter Property="HorizontalContentAlignment" Value="Left"/>
         <Setter Property="Padding" Value="8"/>
         <Setter Property="Template">

+ 34 - 13
src/Avalonia.Themes.Default/ToggleSwitch.xaml

@@ -6,8 +6,40 @@
     <GridLength x:Key="ToggleSwitchPreContentMargin">6</GridLength>
     <GridLength x:Key="ToggleSwitchPostContentMargin">6</GridLength>
     <x:Double x:Key="ToggleSwitchThemeMinWidth">154</x:Double>
-    <x:Double x:Key="KnobOnPosition">20</x:Double>
-    <x:Double x:Key="KnobOffPosition">0</x:Double>
+    <Thickness x:Key="ToggleSwitchOnStrokeThickness">0</Thickness>
+    <Thickness x:Key="ToggleSwitchOuterBorderStrokeThickness">1</Thickness>
+    <SolidColorBrush x:Key="ToggleSwitchContentForeground" Color="{DynamicResource ThemeForegroundColor}" />
+    <SolidColorBrush x:Key="ToggleSwitchContentForegroundDisabled" Color="{DynamicResource ThemeForegroundLowColor}" />
+    <SolidColorBrush x:Key="ToggleSwitchHeaderForeground" Color="{DynamicResource ThemeForegroundColor}" />
+    <SolidColorBrush x:Key="ToggleSwitchHeaderForegroundDisabled" Color="{DynamicResource ThemeForegroundLowColor}" />
+    <SolidColorBrush x:Key="ToggleSwitchContainerBackground" Color="{DynamicResource ThemeControlTransparentColor}" />
+    <SolidColorBrush x:Key="ToggleSwitchContainerBackgroundPointerOver" Color="{DynamicResource ThemeControlTransparentColor}" />
+    <SolidColorBrush x:Key="ToggleSwitchContainerBackgroundPressed" Color="{DynamicResource ThemeControlTransparentColor}" />
+    <SolidColorBrush x:Key="ToggleSwitchContainerBackgroundDisabled" Color="{DynamicResource ThemeControlTransparentColor}" />
+    <SolidColorBrush x:Key="ToggleSwitchFillOff" Color="{DynamicResource ThemeControlTransparentColor}" />
+    <SolidColorBrush x:Key="ToggleSwitchFillOffPointerOver" Color="{DynamicResource ThemeControlTransparentColor}" />
+    <SolidColorBrush x:Key="ToggleSwitchFillOffPressed" Color="{DynamicResource ThemeControlMidHighColor}" />
+    <SolidColorBrush x:Key="ToggleSwitchFillOffDisabled" Color="{DynamicResource ThemeControlTransparentColor}" />
+    <SolidColorBrush x:Key="ToggleSwitchStrokeOff" Color="{DynamicResource ThemeBorderMidColor}" />
+    <SolidColorBrush x:Key="ToggleSwitchStrokeOffPointerOver" Color="{DynamicResource ThemeBorderHighColor}" />
+    <SolidColorBrush x:Key="ToggleSwitchStrokeOffPressed" Color="{DynamicResource ThemeBorderHighColor}" />
+    <SolidColorBrush x:Key="ToggleSwitchStrokeOffDisabled" Color="{DynamicResource ThemeForegroundLowColor}" />
+    <SolidColorBrush x:Key="ToggleSwitchFillOn" Color="{DynamicResource ThemeAccentColor}" />
+    <SolidColorBrush x:Key="ToggleSwitchFillOnPointerOver" Color="{DynamicResource ThemeAccentColor2}" />
+    <SolidColorBrush x:Key="ToggleSwitchFillOnPressed" Color="{DynamicResource ThemeAccentColor3}" />
+    <SolidColorBrush x:Key="ToggleSwitchFillOnDisabled" Color="{DynamicResource ThemeForegroundLowColor}" />
+    <SolidColorBrush x:Key="ToggleSwitchStrokeOn" Color="{DynamicResource ThemeAccentColor}" />
+    <SolidColorBrush x:Key="ToggleSwitchStrokeOnPointerOver" Color="{DynamicResource ThemeAccentColor2}" />
+    <SolidColorBrush x:Key="ToggleSwitchStrokeOnPressed" Color="{DynamicResource ThemeAccentColor3}" />
+    <SolidColorBrush x:Key="ToggleSwitchStrokeOnDisabled" Color="{DynamicResource ThemeForegroundLowColor}" />
+    <SolidColorBrush x:Key="ToggleSwitchKnobFillOff" Color="{DynamicResource ThemeBorderMidColor}" />
+    <SolidColorBrush x:Key="ToggleSwitchKnobFillOffPointerOver" Color="{DynamicResource ThemeBorderHighColor}" />
+    <SolidColorBrush x:Key="ToggleSwitchKnobFillOffPressed" Color="{DynamicResource ThemeBorderHighColor}" />
+    <SolidColorBrush x:Key="ToggleSwitchKnobFillOffDisabled" Color="{DynamicResource ThemeForegroundLowColor}" />
+    <SolidColorBrush x:Key="ToggleSwitchKnobFillOn" Color="{DynamicResource HighlightForegroundColor}" />
+    <SolidColorBrush x:Key="ToggleSwitchKnobFillOnPointerOver" Color="{DynamicResource HighlightForegroundColor}" />
+    <SolidColorBrush x:Key="ToggleSwitchKnobFillOnPressed" Color="{DynamicResource HighlightForegroundColor}" />
+    <SolidColorBrush x:Key="ToggleSwitchKnobFillOnDisabled" Color="{DynamicResource HighlightForegroundColor}" />
   </Styles.Resources>
   <Design.PreviewWith>
     <StackPanel Margin="20" Width="250" Spacing="24" >
@@ -148,16 +180,13 @@
 
   <Style Selector="ToggleSwitch /template/ Ellipse#SwitchKnobOn">
     <Setter Property="Fill" Value="{DynamicResource ToggleSwitchKnobFillOn}"/>
-    <Setter Property="Stroke" Value="{DynamicResource ToggleSwitchKnobStrokeOn}"/>
   </Style>
 
   <Style Selector="ToggleSwitch /template/ Ellipse#SwitchKnobOff">
     <Setter Property="Fill" Value="{DynamicResource ToggleSwitchKnobFillOff}"/>
-    <Setter Property="Stroke" Value="{DynamicResource ToggleSwitchKnobStrokeOff}"/>
   </Style>
 
   <Style Selector="ToggleSwitch /template/ Grid#MovingKnobs">
-    <Setter Property="Canvas.Left" Value="{DynamicResource KnobOffPosition}"/>
     <Setter Property="Transitions">
       <Transitions>
         <DoubleTransition Property="Canvas.Left" Duration="0:0:0.2" Easing="CubicEaseOut"/>
@@ -235,10 +264,6 @@
   </Style>
 
   <!-- CheckedState -->
-  <Style Selector="ToggleSwitch:checked /template/ Grid#MovingKnobs">
-    <Setter Property="Canvas.Left" Value="{DynamicResource KnobOnPosition}"/>
-  </Style>
-
   <Style Selector="ToggleSwitch:checked /template/ Border#OuterBorder">
     <Setter Property="Opacity" Value="0"/>
   </Style>
@@ -264,10 +289,6 @@
   </Style>
 
   <!--UncheckedState -->
-  <Style Selector="ToggleSwitch:unchecked /template/ Grid#MovingKnobs">
-    <Setter Property="Canvas.Left" Value="{DynamicResource KnobOffPosition}"/>
-  </Style>
-
   <Style Selector="ToggleSwitch:unchecked /template/ Border#OuterBorder">
     <Setter Property="Opacity" Value="1"/>
   </Style>

+ 6 - 6
src/Avalonia.Themes.Fluent/Accents/Base.xaml

@@ -6,12 +6,12 @@
     <!-- SystemColor Color Resources (Reflect OS High Contrast Settings) -->
     <Color x:Key="SystemColorButtonFaceColor">#FFF0F0F0</Color>
     <Color x:Key="SystemColorButtonTextColor">#FF000000</Color>
-    <Color x:Key="SystemColorGrayText">#FF6D6D6D</Color>
-    <Color x:Key="SystemColorHighlight">#FF3399FF</Color>
-    <Color x:Key="SystemColorHighlightText">#FFFFFFFF</Color>
-    <Color x:Key="SystemColorHotlight">#FF0066CC</Color>
-    <Color x:Key="SystemColorWindow">#FFFFFFFF</Color>
-    <Color x:Key="SystemColorWindowText">#FF000000</Color>
+    <Color x:Key="SystemColorGrayTextColor">#FF6D6D6D</Color>
+    <Color x:Key="SystemColorHighlightColor">#FF3399FF</Color>
+    <Color x:Key="SystemColorHighlightTextColor">#FFFFFFFF</Color>
+    <Color x:Key="SystemColorHotlightColor">#FF0066CC</Color>
+    <Color x:Key="SystemColorWindowColor">#FFFFFFFF</Color>
+    <Color x:Key="SystemColorWindowTextColor">#FF000000</Color>
     <FontFamily x:Key="ContentControlThemeFontFamily">avares://Avalonia.Themes.Fluent/Assets#Roboto</FontFamily>
     <sys:Double x:Key="ControlContentThemeFontSize">14</sys:Double>
 

+ 9 - 0
src/Avalonia.Themes.Fluent/Accents/FluentControlResourcesDark.xaml

@@ -437,6 +437,15 @@
     <StaticResource x:Key="CalendarViewCalendarItemRevealBorderBrush" ResourceKey="SystemControlTransparentRevealBorderBrush" />
     <StaticResource x:Key="CalendarViewNavigationButtonBorderBrushPointerOver" ResourceKey="SystemControlHighlightTransparentBrush" />
     <StaticResource x:Key="CalendarViewNavigationButtonBorderBrush" ResourceKey="SystemControlTransparentBrush" />
+    
+    <!--Resources for NotificationCard.xaml -->
+    <SolidColorBrush x:Key="NotificationCardBackgroundBrush" Color="#444444" Opacity="0.75"/>
+    <SolidColorBrush x:Key="NotificationCardProgressBackgroundBrush" Color="#9A9A9A" />
+    <SolidColorBrush x:Key="NotificationCardInformationBackgroundBrush" Color="#007ACC" Opacity="0.75"/>
+    <SolidColorBrush x:Key="NotificationCardSuccessBackgroundBrush" Color="#1F9E45" Opacity="0.75"/>
+    <SolidColorBrush x:Key="NotificationCardWarningBackgroundBrush" Color="#FDB328" Opacity="0.75"/>
+    <SolidColorBrush x:Key="NotificationCardErrorBackgroundBrush" Color="#BD202C" Opacity="0.75"/>
+    
     <!-- Resources for RadioButton.xaml -->
     <x:Double x:Key="RadioButtonBorderThemeThickness">1</x:Double>
     <StaticResource x:Key="RadioButtonForeground" ResourceKey="SystemControlForegroundBaseHighBrush" />

+ 1 - 2
src/Avalonia.Themes.Fluent/AutoCompleteBox.xaml

@@ -52,13 +52,12 @@
             <Border Name="PART_SuggestionsContainer"
                     Padding="{DynamicResource AutoCompleteListMargin}"
                     BorderThickness="{DynamicResource AutoCompleteListBorderThemeThickness}"
-                    BorderBrush="{DynamicResource AutoSuggestBoxSuggestionsListBorderBrush}"
+                    BorderBrush="{DynamicResource AutoCompleteBoxSuggestionsListBorderBrush}"
                     Background="{DynamicResource AutoCompleteBoxSuggestionsListBackground}"
                     CornerRadius="{DynamicResource OverlayCornerRadius}">
               <ListBox Name="PART_SelectingItemsControl"
                        BorderThickness="0"
                        Background="Transparent"
-                       Foreground="{DynamicResource AutoCompleteBoxSuggestionsListForeground}"
                        ItemTemplate="{TemplateBinding ItemTemplate}"
                        Margin="{DynamicResource AutoCompleteListPadding}" />
             </Border>

+ 6 - 2
src/Avalonia.Themes.Fluent/ButtonSpinner.xaml

@@ -8,7 +8,11 @@
       <StackPanel Spacing="20">
         <ButtonSpinner ButtonSpinnerLocation="Right"
                        Content="Right disabled inline spinner"
-                       AllowSpin="False" />
+                       AllowSpin="False">
+          <DataValidationErrors.Error>
+            <sys:Exception />
+          </DataValidationErrors.Error>
+        </ButtonSpinner>
         <ButtonSpinner ButtonSpinnerLocation="Left"
                        Content="Left spinner" />
         <ButtonSpinner ShowButtonSpinner="False"
@@ -133,7 +137,7 @@
 
   <!--  Error state  -->
   <Style Selector="ButtonSpinner:error">
-    <Setter Property="BorderBrush" Value="{DynamicResource ErrorBrush}" />
+    <Setter Property="BorderBrush" Value="{DynamicResource SystemErrorTextColor}" />
   </Style>
 
 </Styles>

+ 1 - 1
src/Avalonia.Themes.Fluent/CalendarButton.xaml

@@ -67,7 +67,7 @@
 
   <!-- Adjusted :selected to look like :today from DayItem -->
   <Style Selector="CalendarButton:selected /template/ Border#Root">
-    <Setter Property="Background" Value="{DynamicResource SystemAccentBrush}"/>
+    <Setter Property="Background" Value="{DynamicResource SystemAccentColor}"/>
   </Style>
   <Style Selector="CalendarButton:selected /template/ Border#Border">
     <Setter Property="BorderBrush" Value="{DynamicResource CalendarViewSelectedBorderBrush}"/>

+ 5 - 1
src/Avalonia.Themes.Fluent/CalendarDatePicker.xaml

@@ -13,6 +13,10 @@
       <CalendarDatePicker/>
     </Border>
   </Design.PreviewWith>
+
+  <Styles.Resources>
+    <sys:Double x:Key="CalendarDatePickerCurrentDayFontSize">12</sys:Double>
+  </Styles.Resources>
   
   <Style Selector="CalendarDatePicker">
 
@@ -70,7 +74,7 @@
                                Grid.Row="1"
                                Grid.ColumnSpan="4"
                                Grid.RowSpan="3"
-                               FontSize="{DynamicResource FontSizeSmall}"
+                               FontSize="{StaticResource CalendarDatePickerCurrentDayFontSize}"
                                Text="{Binding Source={x:Static sys:DateTime.Today}, Path=Day}"/>
 
                     <Ellipse HorizontalAlignment="Center" VerticalAlignment="Center" Fill="{DynamicResource SystemControlBackgroundChromeBlackHighBrush}" StrokeThickness="0" Grid.ColumnSpan="4" Width="3" Height="3"/>

+ 14 - 4
src/Avalonia.Themes.Fluent/DataValidationErrors.xaml

@@ -1,5 +1,16 @@
 <Style xmlns="https://github.com/avaloniaui" 
-       Selector="DataValidationErrors">
+       Selector="DataValidationErrors"
+       xmlns:sys="clr-namespace:System;assembly=netstandard">
+  <Design.PreviewWith>
+    <Border Padding="20"> 
+      <TextBox Text="Sample">
+        <DataValidationErrors.Error>
+          <sys:Exception/> 
+        </DataValidationErrors.Error>
+      </TextBox>
+    </Border>
+  </Design.PreviewWith>
+    
   <Setter Property="Template">
     <ControlTemplate>
       <DockPanel LastChildFill="True">
@@ -24,14 +35,13 @@
               Background="Transparent">
         <Canvas.Styles>
           <Style Selector="ToolTip">
-            <Setter Property="Background" Value="{DynamicResource ErrorLowBrush}"/>
-            <Setter Property="BorderBrush" Value="{DynamicResource ErrorBrush}"/>
+            <Setter Property="BorderBrush" Value="{DynamicResource SystemControlErrorTextForegroundBrush}"/>
           </Style>
         </Canvas.Styles>
         <ToolTip.Tip>
           <ItemsControl Items="{Binding}"/>
         </ToolTip.Tip>
-        <Path Data="M14,7 A7,7 0 0,0 0,7 M0,7 A7,7 0 1,0 14,7 M7,3l0,5 M7,9l0,2" Stroke="{DynamicResource ErrorBrush}" StrokeThickness="2"/>
+        <Path Data="M14,7 A7,7 0 0,0 0,7 M0,7 A7,7 0 1,0 14,7 M7,3l0,5 M7,9l0,2" Stroke="{DynamicResource SystemControlErrorTextForegroundBrush}" StrokeThickness="2"/>
       </Canvas>
     </DataTemplate>
   </Setter>

+ 0 - 4
src/Avalonia.Themes.Fluent/MenuItem.xaml

@@ -50,7 +50,6 @@
 
   <Style Selector="MenuItem">
     <Setter Property="Background" Value="{DynamicResource MenuFlyoutItemBackground}" />
-    <Setter Property="BorderBrush" Value="{DynamicResource MenuFlyoutItemRevealBorderBrush}" />
     <Setter Property="Foreground" Value="{DynamicResource MenuFlyoutItemForeground}" />
     <Setter Property="Padding" Value="{DynamicResource MenuFlyoutItemThemePadding}" />
     <Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" />
@@ -212,7 +211,6 @@
 
   <Style Selector="MenuItem:selected /template/ Border#PART_LayoutRoot">
     <Setter Property="Background" Value="{DynamicResource MenuFlyoutItemBackgroundPointerOver}" />
-    <Setter Property="BorderBrush" Value="{DynamicResource MenuFlyoutItemBorderBrushPointerOver}" />
   </Style>
   <Style Selector="MenuItem:selected /template/ TextBlock#PART_InputGestureText">
     <Setter Property="Foreground" Value="{DynamicResource MenuFlyoutItemKeyboardAcceleratorTextForegroundPointerOver}" />
@@ -224,7 +222,6 @@
   <!--  Listen for PART_LayoutRoot:pointerover, so it will not be triggered when subitem is pressed  -->
   <Style Selector="MenuItem:pressed /template/ Border#PART_LayoutRoot:pointerover">
     <Setter Property="Background" Value="{DynamicResource MenuFlyoutItemBackgroundPressed}" />
-    <Setter Property="BorderBrush" Value="{DynamicResource MenuFlyoutItemBorderBrushPressed}" />
   </Style>
   <Style Selector="MenuItem:pressed /template/ Border#PART_LayoutRoot:pointerover TextBlock#PART_InputGestureText">
     <Setter Property="Foreground" Value="{DynamicResource MenuFlyoutItemKeyboardAcceleratorTextForegroundPressed}" />
@@ -235,7 +232,6 @@
 
   <Style Selector="MenuItem:disabled">
     <Setter Property="Background" Value="{DynamicResource MenuFlyoutItemBackgroundDisabled}" />
-    <Setter Property="BorderBrush" Value="{DynamicResource MenuFlyoutItemBorderBrushDisabled}" />
   </Style>
   <Style Selector="MenuItem:disabled /template/ TextBlock#PART_InputGestureText">
     <Setter Property="Foreground" Value="{DynamicResource MenuFlyoutItemKeyboardAcceleratorTextForegroundDisabled}" />

+ 11 - 2
src/Avalonia.Themes.Fluent/TextBox.xaml

@@ -1,4 +1,13 @@
 <Styles xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
+  <Design.PreviewWith>
+    <Border Padding="20">
+      <TextBox Text="Sample"
+               FontSize="20"
+               Width="100"
+               TextAlignment="Center"/>
+    </Border>
+  </Design.PreviewWith>
+  
   <Styles.Resources>
     <Thickness x:Key="TextBoxTopHeaderMargin">0,0,0,4</Thickness>
   </Styles.Resources>
@@ -42,7 +51,7 @@
               <DockPanel>
                 <TextBlock Name="floatingWatermark"
                            Foreground="{DynamicResource SystemAccentColor}"
-                           FontSize="{DynamicResource FontSizeSmall}"
+                           FontSize="{TemplateBinding FontSize}"
                            Text="{TemplateBinding Watermark}"
                            DockPanel.Dock="Top">
                   <TextBlock.IsVisible>
@@ -140,7 +149,7 @@
 
 
   <Style Selector="TextBox:error /template/ Border#border">
-    <Setter Property="BorderBrush" Value="{DynamicResource ErrorBrush}"/>
+    <Setter Property="BorderBrush" Value="{DynamicResource SystemControlErrorTextForegroundBrush}"/>
   </Style>
 
   <Style Selector="TextBox /template/ DockPanel">

+ 0 - 4
src/Avalonia.Themes.Fluent/ToggleSwitch.xaml

@@ -6,8 +6,6 @@
     <GridLength x:Key="ToggleSwitchPreContentMargin">6</GridLength>
     <GridLength x:Key="ToggleSwitchPostContentMargin">6</GridLength>
     <x:Double x:Key="ToggleSwitchThemeMinWidth">154</x:Double>
-    <x:Double x:Key="KnobOnPosition">20</x:Double>
-    <x:Double x:Key="KnobOffPosition">0</x:Double>
   </Styles.Resources>
   <Design.PreviewWith>
     <StackPanel Margin="20" Width="250" Spacing="24" >
@@ -148,12 +146,10 @@
 
   <Style Selector="ToggleSwitch /template/ Ellipse#SwitchKnobOn">
     <Setter Property="Fill" Value="{DynamicResource ToggleSwitchKnobFillOn}"/>
-    <Setter Property="Stroke" Value="{DynamicResource ToggleSwitchKnobStrokeOn}"/>
   </Style>
 
   <Style Selector="ToggleSwitch /template/ Ellipse#SwitchKnobOff">
     <Setter Property="Fill" Value="{DynamicResource ToggleSwitchKnobFillOff}"/>
-    <Setter Property="Stroke" Value="{DynamicResource ToggleSwitchKnobStrokeOff}"/>
   </Style>
 
   <Style Selector="ToggleSwitch:not(:dragging) /template/ Grid#MovingKnobs">