From bf9bbb039ee3e4cf4ad37f7fcece43ce467cc59f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pedro?= Date: Thu, 16 Jul 2020 23:41:29 +0100 Subject: [PATCH] Updated Avalonia to 0.10.0-preview1. --- CSharpMath.Avalonia.Example/App.xaml | 4 +- .../CSharpMath.Avalonia.Example.csproj | 15 +--- CSharpMath.Avalonia.Example/MainView.xaml | 57 ++++++------- CSharpMath.Avalonia.Example/MainView.xaml.cs | 11 ++- CSharpMath.Avalonia.Example/SideBar.xaml | 84 ------------------- .../CSharpMath.Avalonia.csproj | 2 +- .../CSharpMath.Rendering.Tests.csproj | 2 +- CSharpMath.Xaml/Views.cs | 6 +- 8 files changed, 40 insertions(+), 141 deletions(-) delete mode 100644 CSharpMath.Avalonia.Example/SideBar.xaml diff --git a/CSharpMath.Avalonia.Example/App.xaml b/CSharpMath.Avalonia.Example/App.xaml index da74be9e..291e7c7a 100644 --- a/CSharpMath.Avalonia.Example/App.xaml +++ b/CSharpMath.Avalonia.Example/App.xaml @@ -4,10 +4,8 @@ - - + - diff --git a/CSharpMath.Avalonia.Example/CSharpMath.Avalonia.Example.csproj b/CSharpMath.Avalonia.Example/CSharpMath.Avalonia.Example.csproj index c07fd7f9..231aabdc 100644 --- a/CSharpMath.Avalonia.Example/CSharpMath.Avalonia.Example.csproj +++ b/CSharpMath.Avalonia.Example/CSharpMath.Avalonia.Example.csproj @@ -9,20 +9,9 @@ - + + - - - MathButtonPage.xaml - - - MathViewPage.xaml - - - TextViewPage.xaml - - - \ No newline at end of file diff --git a/CSharpMath.Avalonia.Example/MainView.xaml b/CSharpMath.Avalonia.Example/MainView.xaml index 84a0795e..400e86f6 100644 --- a/CSharpMath.Avalonia.Example/MainView.xaml +++ b/CSharpMath.Avalonia.Example/MainView.xaml @@ -6,35 +6,32 @@ Foreground="{DynamicResource ThemeForegroundBrush}" FontSize="{DynamicResource FontSizeNormal}"> - - - - - - - Light - Dark - - - - - - - - - - - - - - - - - + + + + + Light + Dark + + + + + + + + + + + + + + + diff --git a/CSharpMath.Avalonia.Example/MainView.xaml.cs b/CSharpMath.Avalonia.Example/MainView.xaml.cs index e36f75e9..c7bbdfbc 100644 --- a/CSharpMath.Avalonia.Example/MainView.xaml.cs +++ b/CSharpMath.Avalonia.Example/MainView.xaml.cs @@ -1,3 +1,4 @@ +using Avalonia; using Avalonia.Controls; using Avalonia.Markup.Xaml; using Avalonia.Markup.Xaml.Styling; @@ -7,21 +8,19 @@ public class MainView : UserControl { public MainView() { InitializeComponent(); - var light = AvaloniaXamlLoader.Parse(@""); - var dark = AvaloniaXamlLoader.Parse(@""); + var light = AvaloniaXamlLoader.Parse(@""); + var dark = AvaloniaXamlLoader.Parse(@""); var themes = this.Find("Themes"); themes.SelectionChanged += (sender, e) => { switch (themes.SelectedIndex) { case 0: - Styles[0] = light; + Application.Current.Styles[0] = light; break; case 1: - Styles[0] = dark; + Application.Current.Styles[0] = dark; break; } }; - - Styles.Add(light); } private void InitializeComponent() { diff --git a/CSharpMath.Avalonia.Example/SideBar.xaml b/CSharpMath.Avalonia.Example/SideBar.xaml deleted file mode 100644 index 8592bf16..00000000 --- a/CSharpMath.Avalonia.Example/SideBar.xaml +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - Tag - - - - - - - - - - - - - - \ No newline at end of file diff --git a/CSharpMath.Avalonia/CSharpMath.Avalonia.csproj b/CSharpMath.Avalonia/CSharpMath.Avalonia.csproj index d1d500d3..f972c905 100644 --- a/CSharpMath.Avalonia/CSharpMath.Avalonia.csproj +++ b/CSharpMath.Avalonia/CSharpMath.Avalonia.csproj @@ -10,7 +10,7 @@ - + diff --git a/CSharpMath.Rendering.Tests/CSharpMath.Rendering.Tests.csproj b/CSharpMath.Rendering.Tests/CSharpMath.Rendering.Tests.csproj index ffd0db32..94db3561 100644 --- a/CSharpMath.Rendering.Tests/CSharpMath.Rendering.Tests.csproj +++ b/CSharpMath.Rendering.Tests/CSharpMath.Rendering.Tests.csproj @@ -8,7 +8,7 @@ - + diff --git a/CSharpMath.Xaml/Views.cs b/CSharpMath.Xaml/Views.cs index 152fd3b3..60af8cbc 100644 --- a/CSharpMath.Xaml/Views.cs +++ b/CSharpMath.Xaml/Views.cs @@ -54,10 +54,10 @@ void PropertyChanged(TThis @this, object newValue) { public BaseView() { // Respect built-in styles Styles.Add(new global::Avalonia.Styling.Style(global::Avalonia.Styling.Selectors.Is>) { - Setters = new[] + Setters = { - new global::Avalonia.Styling.Setter(TextColorProperty, new global::Avalonia.Markup.Xaml.MarkupExtensions.DynamicResourceExtension("ThemeForegroundColor")), - new global::Avalonia.Styling.Setter(FontSizeProperty, new global::Avalonia.Markup.Xaml.MarkupExtensions.DynamicResourceExtension("FontSizeNormal")) + new global::Avalonia.Styling.Setter(TextColorProperty, new global::Avalonia.Markup.Xaml.MarkupExtensions.DynamicResourceExtension("SystemBaseHighColor")), + new global::Avalonia.Styling.Setter(FontSizeProperty, 14.0f) } }); }