fajiao
2 years ago
12 changed files with 87 additions and 64 deletions
Binary file not shown.
@ -0,0 +1,17 @@ |
|||
using Avalonia.Controls; |
|||
using Avalonia.Platform; |
|||
using System; |
|||
|
|||
namespace JiLinApp.Core.Avalonia; |
|||
|
|||
public class NativeHost : NativeControlHost |
|||
{ |
|||
public IntPtr Handle { get; set; } |
|||
|
|||
protected override IPlatformHandle CreateNativeControlCore(IPlatformHandle parent) |
|||
{ |
|||
IPlatformHandle? pfHandle = base.CreateNativeControlCore(parent); |
|||
Handle = pfHandle.Handle; |
|||
return pfHandle; |
|||
} |
|||
} |
@ -0,0 +1,7 @@ |
|||
using ReactiveUI; |
|||
|
|||
namespace JiLinApp.Core.Avalonia; |
|||
|
|||
public class ViewModelBase : ReactiveObject |
|||
{ |
|||
} |
@ -1,10 +1,10 @@ |
|||
<Window xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:vm="using:JiLinApp.ViewModels" |
|||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
|||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
|||
xmlns:vm="using:JiLinApp.Pages.Main" |
|||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" |
|||
x:Class="JiLinApp.Views.MainWindow" |
|||
x:Class="JiLinApp.Pages.Main.MainWindow" |
|||
x:DataType="vm:MainWindowViewModel" |
|||
Icon="/Assets/avalonia-logo.ico" |
|||
Title="JiLinApp"> |
@ -0,0 +1,11 @@ |
|||
using Avalonia.Controls; |
|||
|
|||
namespace JiLinApp.Pages.Main; |
|||
|
|||
public partial class MainWindow : Window |
|||
{ |
|||
public MainWindow() |
|||
{ |
|||
InitializeComponent(); |
|||
} |
|||
} |
@ -0,0 +1,8 @@ |
|||
using JiLinApp.Core.Avalonia; |
|||
|
|||
namespace JiLinApp.Pages.Main; |
|||
|
|||
public class MainWindowViewModel : ViewModelBase |
|||
{ |
|||
public string Greeting => "Welcome to Avalonia!"; |
|||
} |
@ -1,7 +0,0 @@ |
|||
namespace JiLinApp.ViewModels |
|||
{ |
|||
public class MainWindowViewModel : ViewModelBase |
|||
{ |
|||
public string Greeting => "Welcome to Avalonia!"; |
|||
} |
|||
} |
@ -1,8 +0,0 @@ |
|||
using ReactiveUI; |
|||
|
|||
namespace JiLinApp.ViewModels |
|||
{ |
|||
public class ViewModelBase : ReactiveObject |
|||
{ |
|||
} |
|||
} |
@ -1,12 +0,0 @@ |
|||
using Avalonia.Controls; |
|||
|
|||
namespace JiLinApp.Views |
|||
{ |
|||
public partial class MainWindow : Window |
|||
{ |
|||
public MainWindow() |
|||
{ |
|||
InitializeComponent(); |
|||
} |
|||
} |
|||
} |
Loading…
Reference in new issue