Skip to content

Commit bf9bbb0

Browse files
committed
Updated Avalonia to 0.10.0-preview1.
1 parent a3a8920 commit bf9bbb0

File tree

8 files changed

+40
-141
lines changed

8 files changed

+40
-141
lines changed

CSharpMath.Avalonia.Example/App.xaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@
44

55
<Application.Styles>
66

7-
<StyleInclude Source="avares://Avalonia.Themes.Default/DefaultTheme.xaml"/>
8-
<StyleInclude Source="avares://Avalonia.Themes.Default/Accents/BaseLight.xaml"/>
7+
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Accents/FluentLight.xaml"/>
98

10-
<StyleInclude Source="/SideBar.xaml"/>
119
<StyleInclude Source="/Styles.xaml"/>
1210

1311
</Application.Styles>

CSharpMath.Avalonia.Example/CSharpMath.Avalonia.Example.csproj

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,9 @@
99
<Compile Update="**\*.xaml.cs" DependentUpon="%(Filename)" />
1010
<AvaloniaResource Include="**\*.xaml" />
1111
<EmbeddedResource Include="..\Icon.png" Link="Icon.png" />
12-
<PackageReference Include="Avalonia.Desktop" Version="0.9.6" />
12+
<PackageReference Include="Avalonia.Desktop" Version="0.10.0-preview1" />
13+
<PackageReference Include="Avalonia.Diagnostics" Version="0.10.0-preview1" />
1314
<ProjectReference Include="..\CSharpMath.Avalonia\CSharpMath.Avalonia.csproj" />
1415
</ItemGroup>
1516

16-
<ItemGroup>
17-
<Compile Update="Pages\MathButtonPage.xaml.cs">
18-
<DependentUpon>MathButtonPage.xaml</DependentUpon>
19-
</Compile>
20-
<Compile Update="Pages\MathViewPage.xaml.cs">
21-
<DependentUpon>MathViewPage.xaml</DependentUpon>
22-
</Compile>
23-
<Compile Update="Pages\TextViewPage.xaml.cs">
24-
<DependentUpon>TextViewPage.xaml</DependentUpon>
25-
</Compile>
26-
</ItemGroup>
27-
2817
</Project>

CSharpMath.Avalonia.Example/MainView.xaml

Lines changed: 27 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,32 @@
66
Foreground="{DynamicResource ThemeForegroundBrush}"
77
FontSize="{DynamicResource FontSizeNormal}">
88

9-
<TabControl x:Name="Sidebar"
10-
Classes="sidebar">
11-
12-
<TabControl.Tag>
13-
14-
<ComboBox x:Name="Themes"
15-
DockPanel.Dock="Bottom"
16-
SelectedIndex="0"
17-
Width="100"
18-
Margin="8">
19-
20-
<ComboBoxItem>Light</ComboBoxItem>
21-
<ComboBoxItem>Dark</ComboBoxItem>
22-
23-
</ComboBox>
24-
25-
</TabControl.Tag>
26-
27-
<TabItem Header="MathView">
28-
<pages:MathViewPage/>
29-
</TabItem>
30-
31-
<TabItem Header="TextView">
32-
<pages:TextViewPage/>
33-
</TabItem>
34-
<TabItem Header="MathButton">
35-
<pages:MathButtonPage/>
36-
</TabItem>
37-
38-
</TabControl>
9+
<DockPanel>
10+
11+
12+
<ComboBox x:Name="Themes"
13+
DockPanel.Dock="Bottom"
14+
HorizontalAlignment="Right"
15+
SelectedIndex="0"
16+
Width="100"
17+
Margin="8">
18+
<ComboBoxItem>Light</ComboBoxItem>
19+
<ComboBoxItem>Dark</ComboBoxItem>
20+
</ComboBox>
21+
22+
<TabControl x:Name="Sidebar"
23+
Padding="16">
24+
<TabItem Header="MathView">
25+
<pages:MathViewPage/>
26+
</TabItem>
27+
<TabItem Header="TextView">
28+
<pages:TextViewPage/>
29+
</TabItem>
30+
<TabItem Header="MathButton">
31+
<pages:MathButtonPage/>
32+
</TabItem>
33+
</TabControl>
34+
35+
</DockPanel>
3936

4037
</UserControl>

CSharpMath.Avalonia.Example/MainView.xaml.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using Avalonia;
12
using Avalonia.Controls;
23
using Avalonia.Markup.Xaml;
34
using Avalonia.Markup.Xaml.Styling;
@@ -7,21 +8,19 @@ public class MainView : UserControl {
78
public MainView() {
89
InitializeComponent();
910

10-
var light = AvaloniaXamlLoader.Parse<StyleInclude>(@"<StyleInclude xmlns='https://github.com/avaloniaui' Source='avares://Avalonia.Themes.Default/Accents/BaseLight.xaml'/>");
11-
var dark = AvaloniaXamlLoader.Parse<StyleInclude>(@"<StyleInclude xmlns='https://github.com/avaloniaui' Source='avares://Avalonia.Themes.Default/Accents/BaseDark.xaml'/>");
11+
var light = AvaloniaXamlLoader.Parse<StyleInclude>(@"<StyleInclude xmlns='https://github.com/avaloniaui' Source='avares://Avalonia.Themes.Fluent/Accents/FluentLight.xaml'/>");
12+
var dark = AvaloniaXamlLoader.Parse<StyleInclude>(@"<StyleInclude xmlns='https://github.com/avaloniaui' Source='avares://Avalonia.Themes.Fluent/Accents/FluentDark.xaml'/>");
1213
var themes = this.Find<ComboBox>("Themes");
1314
themes.SelectionChanged += (sender, e) => {
1415
switch (themes.SelectedIndex) {
1516
case 0:
16-
Styles[0] = light;
17+
Application.Current.Styles[0] = light;
1718
break;
1819
case 1:
19-
Styles[0] = dark;
20+
Application.Current.Styles[0] = dark;
2021
break;
2122
}
2223
};
23-
24-
Styles.Add(light);
2524
}
2625

2726
private void InitializeComponent() {

CSharpMath.Avalonia.Example/SideBar.xaml

Lines changed: 0 additions & 84 deletions
This file was deleted.

CSharpMath.Avalonia/CSharpMath.Avalonia.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<ItemGroup>
1111
<Compile Update="**\*.xaml.cs" DependentUpon="%(Filename)" />
1212
<AvaloniaResource Include="**\*.xaml" />
13-
<PackageReference Include="Avalonia" Version="0.9.6" />
13+
<PackageReference Include="Avalonia" Version="0.10.0-preview1" />
1414
<ProjectReference Include="..\CSharpMath.Rendering\CSharpMath.Rendering.csproj" />
1515
</ItemGroup>
1616

CSharpMath.Rendering.Tests/CSharpMath.Rendering.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<Compile Include="..\CSharpMath.CoreTests\_Helpers\ApproximateAssertions.cs" Link="ApproximateAssertions.cs" />
99
<ProjectReference Include="..\CSharpMath.Avalonia\CSharpMath.Avalonia.csproj" />
1010
<ProjectReference Include="..\CSharpMath.SkiaSharp\CSharpMath.SkiaSharp.csproj" />
11-
<PackageReference Include="Avalonia.Skia" Version="0.9.4" />
11+
<PackageReference Include="Avalonia.Skia" Version="0.10.0-preview1" />
1212
<PackageReference Include="xunit" Version="2.4.1" />
1313
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
1414
<PackageReference Include="Xunit.SkippableFact" Version="1.4.8" />

CSharpMath.Xaml/Views.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ void PropertyChanged(TThis @this, object newValue) {
5454
public BaseView() {
5555
// Respect built-in styles
5656
Styles.Add(new global::Avalonia.Styling.Style(global::Avalonia.Styling.Selectors.Is<BaseView<TPainter, TContent>>) {
57-
Setters = new[]
57+
Setters =
5858
{
59-
new global::Avalonia.Styling.Setter(TextColorProperty, new global::Avalonia.Markup.Xaml.MarkupExtensions.DynamicResourceExtension("ThemeForegroundColor")),
60-
new global::Avalonia.Styling.Setter(FontSizeProperty, new global::Avalonia.Markup.Xaml.MarkupExtensions.DynamicResourceExtension("FontSizeNormal"))
59+
new global::Avalonia.Styling.Setter(TextColorProperty, new global::Avalonia.Markup.Xaml.MarkupExtensions.DynamicResourceExtension("SystemBaseHighColor")),
60+
new global::Avalonia.Styling.Setter(FontSizeProperty, 14.0f)
6161
}
6262
});
6363
}

0 commit comments

Comments
 (0)