Add dependency to System.Reactive 4.4.1
This commit is contained in:
parent
facbeefbf6
commit
b14fa5d354
@ -1,7 +1,8 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>netcoreapp3.0</TargetFramework>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Update="**\*.xaml.cs">
|
||||
@ -12,8 +13,18 @@
|
||||
</AvaloniaResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Avalonia" Version="0.9.0" />
|
||||
<PackageReference Include="Avalonia.Desktop" Version="0.9.0" />
|
||||
<PackageReference Include="Avalonia" Version="0.9.7" />
|
||||
<PackageReference Include="Avalonia.Desktop" Version="0.9.7" />
|
||||
<PackageReference Include="Avalonia.ReactiveUI" Version="0.9.7" />
|
||||
<PackageReference Include="Microsoft.DotNet.ILCompiler" Version="1.0.0-alpha-*" />
|
||||
<PackageReference Include="System.Reactive" Version="4.4.1" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Update="avalonia.png" CopyToPublishDirectory="PreserveNewest">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="dotnet.png" CopyToPublishDirectory="PreserveNewest">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
@ -4,6 +4,12 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="AvaloniaCoreRTDemo.MainWindow"
|
||||
Width="640" Height="480"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
Title="AvaloniaCoreRTDemo">
|
||||
Welcome to Avalonia!
|
||||
<Grid ColumnDefinitions="*,*" RowDefinitions="Auto,Auto" Margin="32">
|
||||
<TextBlock Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" TextAlignment="Center" Margin="0,6">Welcome to Avalonia UI + CoreRT!</TextBlock>
|
||||
<Image Grid.Row="1" Grid.Column="0" Stretch="None" Source="{Binding DotNetImage}"></Image>
|
||||
<Image Grid.Row="1" Grid.Column="1" Stretch="None" Source="{Binding AvaloniaImage}"></Image>
|
||||
</Grid>
|
||||
</Window>
|
||||
|
@ -1,6 +1,11 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Controls.Shapes;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using Avalonia.Media.Imaging;
|
||||
using ReactiveUI;
|
||||
using System;
|
||||
using Path = System.IO.Path;
|
||||
|
||||
namespace AvaloniaCoreRTDemo
|
||||
{
|
||||
@ -9,6 +14,7 @@ namespace AvaloniaCoreRTDemo
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.DataContext = new ViewModel();
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
@ -16,4 +22,27 @@ namespace AvaloniaCoreRTDemo
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
}
|
||||
}
|
||||
|
||||
public class ViewModel: ReactiveObject
|
||||
{
|
||||
public ViewModel()
|
||||
{
|
||||
DotNetImage = new Bitmap(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "dotnet.png"));
|
||||
AvaloniaImage = new Bitmap(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "avalonia.png"));
|
||||
}
|
||||
|
||||
private IBitmap dotNetImage;
|
||||
public IBitmap DotNetImage
|
||||
{
|
||||
get { return dotNetImage; }
|
||||
set { this.RaiseAndSetIfChanged(ref this.dotNetImage, value); }
|
||||
}
|
||||
|
||||
private IBitmap avaloniaImage;
|
||||
public IBitmap AvaloniaImage
|
||||
{
|
||||
get { return avaloniaImage; }
|
||||
set { this.RaiseAndSetIfChanged(ref this.avaloniaImage, value); }
|
||||
}
|
||||
}
|
||||
}
|
BIN
avalonia.png
Normal file
BIN
avalonia.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.1 KiB |
BIN
dotnet.png
Normal file
BIN
dotnet.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
3043
packages.lock.json
Normal file
3043
packages.lock.json
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user