-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge commit 'd1cf0d1ef926cdd5a03e5b4695ac43a8e5c85aab'
- Loading branch information
Showing
16 changed files
with
730 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<Project> | ||
<PropertyGroup> | ||
<Nullable>enable</Nullable> | ||
<AvaloniaVersion>11.1.0</AvaloniaVersion> | ||
</PropertyGroup> | ||
</Project> |
19 changes: 19 additions & 0 deletions
19
...arlekeayiRemnelakair/NearlekeayiRemnelakair.Desktop/NearlekeayiRemnelakair.Desktop.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<OutputType>WinExe</OutputType> | ||
<!--If you are willing to use Windows/MacOS native APIs you will need to create 3 projects. | ||
One for Windows with net8.0-windows TFM, one for MacOS with net8.0-macos and one with net8.0 TFM for Linux.--> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<Nullable>enable</Nullable> | ||
<BuiltInComInteropSupport>true</BuiltInComInteropSupport> | ||
<ApplicationManifest>app.manifest</ApplicationManifest> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Avalonia.Desktop" Version="$(AvaloniaVersion)" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\NearlekeayiRemnelakair\NearlekeayiRemnelakair.csproj" /> | ||
</ItemGroup> | ||
</Project> |
24 changes: 24 additions & 0 deletions
24
AvaloniaIDemo/NearlekeayiRemnelakair/NearlekeayiRemnelakair.Desktop/Program.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System; | ||
|
||
using Avalonia; | ||
using Avalonia.ReactiveUI; | ||
|
||
namespace NearlekeayiRemnelakair.Desktop; | ||
|
||
class Program | ||
{ | ||
// Initialization code. Don't use any Avalonia, third-party APIs or any | ||
// SynchronizationContext-reliant code before AppMain is called: things aren't initialized | ||
// yet and stuff might break. | ||
[STAThread] | ||
public static void Main(string[] args) => BuildAvaloniaApp() | ||
.StartWithClassicDesktopLifetime(args); | ||
|
||
// Avalonia configuration, don't remove; also used by visual designer. | ||
public static AppBuilder BuildAvaloniaApp() | ||
=> AppBuilder.Configure<App>() | ||
.UsePlatformDetect() | ||
.WithInterFont() | ||
.LogToTrace() | ||
.UseReactiveUI(); | ||
} |
18 changes: 18 additions & 0 deletions
18
AvaloniaIDemo/NearlekeayiRemnelakair/NearlekeayiRemnelakair.Desktop/app.manifest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1"> | ||
<!-- This manifest is used on Windows only. | ||
Don't remove it as it might cause problems with window transparency and embeded controls. | ||
For more details visit https://learn.microsoft.com/en-us/windows/win32/sbscs/application-manifests --> | ||
<assemblyIdentity version="1.0.0.0" name="AvaloniaTest.Desktop"/> | ||
|
||
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"> | ||
<application> | ||
<!-- A list of the Windows versions that this application has been tested on | ||
and is designed to work with. Uncomment the appropriate elements | ||
and Windows will automatically select the most compatible environment. --> | ||
|
||
<!-- Windows 10 --> | ||
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" /> | ||
</application> | ||
</compatibility> | ||
</assembly> |
30 changes: 30 additions & 0 deletions
30
AvaloniaIDemo/NearlekeayiRemnelakair/NearlekeayiRemnelakair.sln
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.10.35013.160 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NearlekeayiRemnelakair", "NearlekeayiRemnelakair\NearlekeayiRemnelakair.csproj", "{D9929D6C-B874-4952-BC38-AC239C9CFB8F}" | ||
EndProject | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NearlekeayiRemnelakair.Desktop", "NearlekeayiRemnelakair.Desktop\NearlekeayiRemnelakair.Desktop.csproj", "{7A8C8F4C-B919-4172-87AE-BEAF46F8F388}" | ||
EndProject | ||
Global | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {9F188193-CF5C-4E6D-AF7E-19043D88E0A9} | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{7A8C8F4C-B919-4172-87AE-BEAF46F8F388}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{7A8C8F4C-B919-4172-87AE-BEAF46F8F388}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{7A8C8F4C-B919-4172-87AE-BEAF46F8F388}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{7A8C8F4C-B919-4172-87AE-BEAF46F8F388}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{D9929D6C-B874-4952-BC38-AC239C9CFB8F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{D9929D6C-B874-4952-BC38-AC239C9CFB8F}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{D9929D6C-B874-4952-BC38-AC239C9CFB8F}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{D9929D6C-B874-4952-BC38-AC239C9CFB8F}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
EndGlobal |
10 changes: 10 additions & 0 deletions
10
AvaloniaIDemo/NearlekeayiRemnelakair/NearlekeayiRemnelakair/App.axaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<Application xmlns="https://github.com/avaloniaui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
x:Class="NearlekeayiRemnelakair.App" | ||
RequestedThemeVariant="Default"> | ||
<!-- "Default" ThemeVariant follows system theme variant. "Dark" or "Light" are other available options. --> | ||
|
||
<Application.Styles> | ||
<FluentTheme /> | ||
</Application.Styles> | ||
</Application> |
36 changes: 36 additions & 0 deletions
36
AvaloniaIDemo/NearlekeayiRemnelakair/NearlekeayiRemnelakair/App.axaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using Avalonia; | ||
using Avalonia.Controls.ApplicationLifetimes; | ||
using Avalonia.Markup.Xaml; | ||
|
||
using NearlekeayiRemnelakair.ViewModels; | ||
using NearlekeayiRemnelakair.Views; | ||
|
||
namespace NearlekeayiRemnelakair; | ||
|
||
public partial class App : Application | ||
{ | ||
public override void Initialize() | ||
{ | ||
AvaloniaXamlLoader.Load(this); | ||
} | ||
|
||
public override void OnFrameworkInitializationCompleted() | ||
{ | ||
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) | ||
{ | ||
desktop.MainWindow = new MainWindow | ||
{ | ||
DataContext = new MainViewModel() | ||
}; | ||
} | ||
else if (ApplicationLifetime is ISingleViewApplicationLifetime singleViewPlatform) | ||
{ | ||
singleViewPlatform.MainView = new MainView | ||
{ | ||
DataContext = new MainViewModel() | ||
}; | ||
} | ||
|
||
base.OnFrameworkInitializationCompleted(); | ||
} | ||
} |
Binary file added
BIN
+172 KB
AvaloniaIDemo/NearlekeayiRemnelakair/NearlekeayiRemnelakair/Assets/avalonia-logo.ico
Binary file not shown.
21 changes: 21 additions & 0 deletions
21
AvaloniaIDemo/NearlekeayiRemnelakair/NearlekeayiRemnelakair/NearlekeayiRemnelakair.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<Nullable>enable</Nullable> | ||
<LangVersion>latest</LangVersion> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<AvaloniaResource Include="Assets\**" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Avalonia" Version="$(AvaloniaVersion)" /> | ||
<PackageReference Include="Avalonia.Skia" Version="11.1.0" /> | ||
<PackageReference Include="Avalonia.Themes.Fluent" Version="$(AvaloniaVersion)" /> | ||
<PackageReference Include="Avalonia.Fonts.Inter" Version="$(AvaloniaVersion)" /> | ||
<PackageReference Include="Avalonia.ReactiveUI" Version="$(AvaloniaVersion)" /> | ||
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.--> | ||
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="$(AvaloniaVersion)" /> | ||
</ItemGroup> | ||
</Project> |
6 changes: 6 additions & 0 deletions
6
AvaloniaIDemo/NearlekeayiRemnelakair/NearlekeayiRemnelakair/ViewModels/MainViewModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace NearlekeayiRemnelakair.ViewModels; | ||
|
||
public class MainViewModel : ViewModelBase | ||
{ | ||
public string Greeting => "Welcome to Avalonia!"; | ||
} |
7 changes: 7 additions & 0 deletions
7
AvaloniaIDemo/NearlekeayiRemnelakair/NearlekeayiRemnelakair/ViewModels/ViewModelBase.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
using ReactiveUI; | ||
|
||
namespace NearlekeayiRemnelakair.ViewModels; | ||
|
||
public class ViewModelBase : ReactiveObject | ||
{ | ||
} |
20 changes: 20 additions & 0 deletions
20
AvaloniaIDemo/NearlekeayiRemnelakair/NearlekeayiRemnelakair/Views/MainView.axaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<UserControl 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" | ||
xmlns:vm="clr-namespace:NearlekeayiRemnelakair.ViewModels" | ||
xmlns:views="clr-namespace:NearlekeayiRemnelakair.Views" | ||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" | ||
x:Class="NearlekeayiRemnelakair.Views.MainView" | ||
x:DataType="vm:MainViewModel"> | ||
<Design.DataContext> | ||
<!-- This only sets the DataContext for the previewer in an IDE, | ||
to set the actual DataContext for runtime, set the DataContext property in code (look at App.axaml.cs) --> | ||
<vm:MainViewModel /> | ||
</Design.DataContext> | ||
|
||
<Grid> | ||
<TextBlock Text="{Binding Greeting}" HorizontalAlignment="Center" VerticalAlignment="Center"/> | ||
<views:Foo/> | ||
</Grid> | ||
</UserControl> |
56 changes: 56 additions & 0 deletions
56
AvaloniaIDemo/NearlekeayiRemnelakair/NearlekeayiRemnelakair/Views/MainView.axaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
using Avalonia; | ||
using Avalonia.Controls; | ||
using Avalonia.Media; | ||
using Avalonia.Platform; | ||
using Avalonia.Rendering.SceneGraph; | ||
using Avalonia.Skia; | ||
|
||
namespace NearlekeayiRemnelakair.Views; | ||
|
||
public partial class MainView : UserControl | ||
{ | ||
public MainView() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} | ||
|
||
class Foo : Control | ||
{ | ||
public override void Render(DrawingContext context) | ||
{ | ||
context.Custom(new C()); | ||
base.Render(context); | ||
} | ||
} | ||
|
||
class C : ICustomDrawOperation | ||
{ | ||
public void Dispose() | ||
{ | ||
|
||
} | ||
|
||
public bool Equals(ICustomDrawOperation? other) | ||
{ | ||
return ReferenceEquals(this, other); | ||
} | ||
|
||
public bool HitTest(Point p) | ||
{ | ||
return false; | ||
} | ||
|
||
public void Render(ImmediateDrawingContext context) | ||
{ | ||
var leaseFeature = context.TryGetFeature<ISkiaSharpApiLeaseFeature>(); | ||
if (leaseFeature != null) | ||
{ | ||
var skiaSharpApiLease = leaseFeature.Lease(); | ||
var skSurface = skiaSharpApiLease.SkSurface; | ||
var canvas = skiaSharpApiLease.SkCanvas; | ||
} | ||
} | ||
|
||
public Rect Bounds { get; set; } | ||
} |
12 changes: 12 additions & 0 deletions
12
AvaloniaIDemo/NearlekeayiRemnelakair/NearlekeayiRemnelakair/Views/MainWindow.axaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<Window xmlns="https://github.com/avaloniaui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:vm="using:NearlekeayiRemnelakair.ViewModels" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:views="clr-namespace:NearlekeayiRemnelakair.Views" | ||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" | ||
x:Class="NearlekeayiRemnelakair.Views.MainWindow" | ||
Icon="/Assets/avalonia-logo.ico" | ||
Title="NearlekeayiRemnelakair"> | ||
<views:MainView /> | ||
</Window> |
11 changes: 11 additions & 0 deletions
11
AvaloniaIDemo/NearlekeayiRemnelakair/NearlekeayiRemnelakair/Views/MainWindow.axaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using Avalonia.Controls; | ||
|
||
namespace NearlekeayiRemnelakair.Views; | ||
|
||
public partial class MainWindow : Window | ||
{ | ||
public MainWindow() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} |