Skip to content

Commit 7a1c780

Browse files
committed
misc: extract the common part.
1 parent c0a7196 commit 7a1c780

File tree

15 files changed

+43
-22
lines changed

15 files changed

+43
-22
lines changed

src/Client.Avalonia/App.axaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
<Application.Resources>
1515
<ResourceDictionary>
1616
<ResourceDictionary.MergedDictionaries>
17-
<ResourceInclude Source="avares://Client.Avalonia/Themes/Resources/_index.axaml" />
18-
<ResourceInclude Source="avares://Client.Avalonia/Themes/Controls/_index.axaml" />
17+
<ResourceInclude Source="avares://Common.Avalonia/Themes/Resources/_index.axaml" />
18+
<ResourceInclude Source="avares://Common.Avalonia/Themes/Controls/_index.axaml" />
1919
</ResourceDictionary.MergedDictionaries>
2020
</ResourceDictionary>
2121
</Application.Resources>

src/Client.Avalonia/App.axaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
using Avalonia.Controls.ApplicationLifetimes;
55
using Avalonia.Data.Core.Plugins;
66
using Avalonia.Markup.Xaml;
7-
using Client.Avalonia.Services;
87
using Client.Avalonia.ViewModels;
98
using Client.Avalonia.Views;
9+
using Common.Avalonia.Services;
1010
using Microsoft.Extensions.DependencyInjection;
1111

1212
namespace Client.Avalonia;

src/Client.Avalonia/Client.Avalonia.csproj

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,13 @@
2020
<IncludeAssets Condition="'$(Configuration)' != 'Debug'">None</IncludeAssets>
2121
<PrivateAssets Condition="'$(Configuration)' != 'Debug'">All</PrivateAssets>
2222
</PackageReference>
23-
<PackageReference Include="Avalonia.Svg" Version="11.2.0.2" />
23+
<PackageReference Include="Avalonia.Svg" Version="11.2.0.2"/>
2424
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.3.2"/>
25-
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.0" />
26-
<PackageReference Include="Semi.Avalonia" Version="11.2.1.1" />
25+
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.0"/>
26+
<PackageReference Include="Semi.Avalonia" Version="11.2.1.1"/>
27+
</ItemGroup>
28+
29+
<ItemGroup>
30+
<ProjectReference Include="..\Common.Avalonia\Common.Avalonia.csproj"/>
2731
</ItemGroup>
2832
</Project>

src/Client.Avalonia/ViewModels/MainViewViewModel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
using Avalonia.Controls;
33
using Avalonia.Controls.ApplicationLifetimes;
44
using Avalonia.Controls.Notifications;
5-
using Client.Avalonia.Models;
6-
using Client.Avalonia.Services;
5+
using Common.Avalonia.Models;
6+
using Common.Avalonia.Services;
77
using CommunityToolkit.Mvvm.ComponentModel;
88
using CommunityToolkit.Mvvm.Input;
99

src/Client.Avalonia/Views/MainView.axaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
55
xmlns:converters="clr-namespace:Avalonia.Controls.Converters;assembly=Avalonia.Controls"
66
xmlns:vm="clr-namespace:Client.Avalonia.ViewModels"
7-
xmlns:services="clr-namespace:Client.Avalonia.Services"
8-
xmlns:cvt="clr-namespace:Client.Avalonia.Converters"
7+
xmlns:services="clr-namespace:Common.Avalonia.Services;assembly=Common.Avalonia"
8+
xmlns:cvt="clr-namespace:Common.Avalonia.Converters;assembly=Common.Avalonia"
99
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
1010
x:Class="Client.Avalonia.Views.MainView"
1111
x:DataType="vm:MainViewViewModel">

src/Client/ClientSample.sln

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClientSample", "ClientSampl
77
EndProject
88
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Client.Avalonia", "..\Client.Avalonia\Client.Avalonia.csproj", "{217AA2C2-EC7C-40FC-B34C-A1FFCF006CFB}"
99
EndProject
10+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Avalonia", "..\Common.Avalonia\Common.Avalonia.csproj", "{6E557C80-481A-4AED-BB4F-D2ECEECDDFE7}"
11+
EndProject
1012
Global
1113
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1214
Debug|Any CPU = Debug|Any CPU
@@ -24,5 +26,9 @@ Global
2426
{217AA2C2-EC7C-40FC-B34C-A1FFCF006CFB}.Debug|Any CPU.Build.0 = Debug|Any CPU
2527
{217AA2C2-EC7C-40FC-B34C-A1FFCF006CFB}.Release|Any CPU.ActiveCfg = Release|Any CPU
2628
{217AA2C2-EC7C-40FC-B34C-A1FFCF006CFB}.Release|Any CPU.Build.0 = Release|Any CPU
29+
{6E557C80-481A-4AED-BB4F-D2ECEECDDFE7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
30+
{6E557C80-481A-4AED-BB4F-D2ECEECDDFE7}.Debug|Any CPU.Build.0 = Debug|Any CPU
31+
{6E557C80-481A-4AED-BB4F-D2ECEECDDFE7}.Release|Any CPU.ActiveCfg = Release|Any CPU
32+
{6E557C80-481A-4AED-BB4F-D2ECEECDDFE7}.Release|Any CPU.Build.0 = Release|Any CPU
2733
EndGlobalSection
2834
EndGlobal
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net8.0</TargetFramework>
5+
<ImplicitUsings>enable</ImplicitUsings>
6+
<Nullable>enable</Nullable>
7+
<AvaloniaVersion>11.2.2</AvaloniaVersion>
8+
</PropertyGroup>
9+
10+
<ItemGroup>
11+
<PackageReference Include="Avalonia" Version="$(AvaloniaVersion)"/>
12+
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.3.2"/>
13+
</ItemGroup>
14+
15+
</Project>

src/Client.Avalonia/Converters/EnumConverter.cs renamed to src/Common.Avalonia/Converters/EnumConverter.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
using System;
21
using System.ComponentModel;
32
using System.Reflection;
43
using Avalonia.Data.Converters;
54

6-
namespace Client.Avalonia.Converters;
5+
namespace Common.Avalonia.Converters;
76

87
public static class EnumConverter
98
{

src/Client.Avalonia/Models/DownloadStatistics.cs renamed to src/Common.Avalonia/Models/DownloadStatistics.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
using System;
21
using System.ComponentModel;
32
using CommunityToolkit.Mvvm.ComponentModel;
43

5-
namespace Client.Avalonia.Models;
4+
namespace Common.Avalonia.Models;
65

76
public partial class DownloadStatistics : ObservableObject
87
{

src/Client.Avalonia/Services/IDownloadService.cs renamed to src/Common.Avalonia/Services/IDownloadService.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
using System;
21
using System.ComponentModel;
3-
using Client.Avalonia.Models;
2+
using Common.Avalonia.Models;
43

5-
namespace Client.Avalonia.Services;
4+
namespace Common.Avalonia.Services;
65

76
public interface IDownloadService
87
{

0 commit comments

Comments
 (0)