-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added CoreBoy.Avalonia project to provide cross-platform GUI for the …
…emulator
- Loading branch information
1 parent
6d35e05
commit b7b38f5
Showing
11 changed files
with
504 additions
and
2 deletions.
There are no files selected for viewing
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,8 @@ | ||
<Application xmlns="https://github.com/avaloniaui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
x:Class="CoreBoy.Avalonia.App"> | ||
<Application.Styles> | ||
<StyleInclude Source="avares://Avalonia.Themes.Default/DefaultTheme.xaml"/> | ||
<StyleInclude Source="avares://Avalonia.Themes.Default/Accents/BaseLight.xaml"/> | ||
</Application.Styles> | ||
</Application> |
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 Avalonia; | ||
using Avalonia.Controls.ApplicationLifetimes; | ||
using Avalonia.Markup.Xaml; | ||
|
||
namespace CoreBoy.Avalonia | ||
{ | ||
public class App : Application | ||
{ | ||
public override void Initialize() | ||
{ | ||
AvaloniaXamlLoader.Load(this); | ||
} | ||
|
||
public override void OnFrameworkInitializationCompleted() | ||
{ | ||
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) | ||
{ | ||
desktop.MainWindow = new MainWindow(); | ||
} | ||
|
||
base.OnFrameworkInitializationCompleted(); | ||
} | ||
} | ||
} |
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,27 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<OutputType>WinExe</OutputType> | ||
<TargetFramework>netcoreapp3.1</TargetFramework> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Update="**\*.xaml.cs"> | ||
<DependentUpon>%(Filename)</DependentUpon> | ||
</Compile> | ||
<AvaloniaResource Include="**\*.xaml"> | ||
<SubType>Designer</SubType> | ||
</AvaloniaResource> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<PackageReference Include="Avalonia" Version="0.9.9" /> | ||
<PackageReference Include="Avalonia.Desktop" Version="0.9.9" /> | ||
<PackageReference Include="Avalonia.ReactiveUI" Version="0.9.9" /> | ||
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.6"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
<PackageReference Include="ReactiveUI" Version="11.3.7" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\CoreBoy\CoreBoy.csproj" /> | ||
</ItemGroup> | ||
</Project> |
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,8 @@ | ||
// This file is used by Code Analysis to maintain SuppressMessage | ||
// attributes that are applied to this project. | ||
// Project-level suppressions either have no target or are given | ||
// a specific target and scoped to a namespace, type, member, etc. | ||
|
||
using System.Diagnostics.CodeAnalysis; | ||
|
||
[assembly: SuppressMessage("Usage", "CA2227:Collection properties should be read only", Justification = "Setter needed in order to dinamically construct the ViewModels in the MainWindow constructor", Scope = "member", Target = "~P:CoreBoy.Avalonia.MenuItemViewModel.Items")] |
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 @@ | ||
<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="CoreBoy.Avalonia.MainWindow" | ||
Title="CoreBoy" | ||
> | ||
<Grid Background="Gray"> | ||
|
||
<Grid.RowDefinitions> | ||
<RowDefinition MaxHeight="20"></RowDefinition> | ||
<RowDefinition></RowDefinition> | ||
</Grid.RowDefinitions> | ||
|
||
<DockPanel Background="White" Grid.Row="0"> | ||
<Menu DockPanel.Dock="Top" Items="{Binding MenuItems}"> | ||
|
||
<Menu.Styles> | ||
<Style Selector="MenuItem"> | ||
<Setter Property="Header" Value="{Binding Header}"/> | ||
<Setter Property="Items" Value="{Binding Items}"/> | ||
<Setter Property="Command" Value="{Binding Command}"/> | ||
<Setter Property="CommandParameter" Value="{Binding CommandParameter}"/> | ||
</Style> | ||
</Menu.Styles> | ||
|
||
</Menu> | ||
</DockPanel> | ||
|
||
<Image x:Name="ImageBox" Grid.Row ="1"> | ||
|
||
</Image> | ||
|
||
</Grid> | ||
</Window> |
Oops, something went wrong.