Avalonia Boilerplate
This commit is contained in:
parent
a6d5a3eb72
commit
0d32e6a5c3
14 changed files with 117 additions and 23 deletions
|
|
@ -17,4 +17,4 @@
|
|||
<ProjectReference Include="..\InkForge.Common\InkForge.Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
</Project>
|
||||
|
|
@ -1,8 +1,9 @@
|
|||
using Avalonia;
|
||||
using Avalonia;
|
||||
using Avalonia.ReactiveUI;
|
||||
using Avalonia.Threading;
|
||||
|
||||
using InkForge.Common;
|
||||
using InkForge.Data;
|
||||
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
|
|
@ -23,6 +24,7 @@ static class Program
|
|||
=> AppBuilder.Configure<App>()
|
||||
.UsePlatformDetect()
|
||||
.UseReactiveUI()
|
||||
.WithInterFont()
|
||||
.LogToTrace();
|
||||
|
||||
private static void ConfigureServices(IServiceCollection services)
|
||||
|
|
@ -32,11 +34,7 @@ static class Program
|
|||
mutableResolver.InitializeSplat();
|
||||
mutableResolver.InitializeReactiveUI();
|
||||
|
||||
services.AddHttpClient();
|
||||
|
||||
// services.UseFactories();
|
||||
// services.AddViewModelFactory();
|
||||
// services.AddTransient<IViewFor<MainViewModel>, MainWindow>();
|
||||
services.AddInkForge();
|
||||
}
|
||||
|
||||
private static void OnSetup(this IServiceCollection services, AppBuilder appBuilder)
|
||||
|
|
|
|||
9
app/InkForge.Desktop/Views/MainWindow.axaml
Normal file
9
app/InkForge.Desktop/Views/MainWindow.axaml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<Window xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="InkForge.Desktop.Views.MainWindow"
|
||||
Title="InkForge">
|
||||
|
||||
</Window>
|
||||
13
app/InkForge.Desktop/Views/MainWindow.axaml.cs
Normal file
13
app/InkForge.Desktop/Views/MainWindow.axaml.cs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
using Avalonia.ReactiveUI;
|
||||
|
||||
using InkForge.Common.ViewModels;
|
||||
|
||||
namespace InkForge.Desktop.Views;
|
||||
|
||||
public partial class MainWindow : ReactiveWindow<AppViewModel>
|
||||
{
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue