Skip to content

Commit

Permalink
Added in Avalonia.Diagnostics and tidied up csproj.
Browse files Browse the repository at this point in the history
  • Loading branch information
natekford committed Apr 6, 2024
1 parent 656fdf5 commit 8404093
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 57 deletions.
40 changes: 15 additions & 25 deletions src/SongProcessor.UI/SongProcessor.UI.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,27 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<!--Avalonia doesen't support TrimMode=link currently,but we are working on that https://github.com/AvaloniaUI/Avalonia/issues/6892 -->
<TrimMode>copyused</TrimMode>
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
<ApplicationIcon>cirno_at_computer_pTB_icon.ico</ApplicationIcon>
</PropertyGroup>

<ItemGroup>
<!--
This helps with theme dll-s trimming.
If you will publish your application in self-contained mode with p:PublishTrimmed=true and it will use Fluent theme Default theme will be trimmed from the output and vice versa.
https://github.com/AvaloniaUI/Avalonia/issues/5593
-->
<TrimmableAssembly Include="Avalonia.Themes.Fluent" />
<TrimmableAssembly Include="Avalonia.Themes.Default" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Avalonia" Version="11.0.10" />
<PackageReference Include="Avalonia.Desktop" Version="11.0.10" />
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.10" />
<PackageReference Include="Avalonia.ReactiveUI" Version="11.0.10" />
<PackageReference Include="Avalonia.Themes.Simple" Version="11.0.10" />
<PackageReference Include="DynamicData" Version="8.4.1" />
Expand All @@ -17,29 +32,4 @@
<ItemGroup>
<ProjectReference Include="..\SongProcessor\SongProcessor.csproj" />
</ItemGroup>

<ItemGroup>
<Compile Update="**\*.axaml.cs">
<DependentUpon>%(Filename)</DependentUpon>
</Compile>
<AvaloniaXaml Remove="**\*.axaml" />
<AvaloniaResource Include="**\*.axaml">
<SubType>Designer</SubType>
</AvaloniaResource>
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="Views\AddView.axaml">
<Generator>MSBuild:Compile</Generator>
</EmbeddedResource>
<EmbeddedResource Include="Views\EditView.axaml">
<Generator>MSBuild:Compile</Generator>
</EmbeddedResource>
<EmbeddedResource Include="Views\SongView.axaml">
<Generator>MSBuild:Compile</Generator>
</EmbeddedResource>
<EmbeddedResource Include="Views\MessageBox.axaml">
<Generator>MSBuild:Compile</Generator>
</EmbeddedResource>
</ItemGroup>
</Project>
2 changes: 0 additions & 2 deletions src/SongProcessor.UI/ViewModels/MainViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using Avalonia.Input.Platform;

using DynamicData.Binding;

using ReactiveUI;

using SongProcessor.FFmpeg;
Expand Down
8 changes: 2 additions & 6 deletions src/SongProcessor.UI/Views/AddView.axaml.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
using Avalonia.Markup.Xaml;
using Avalonia.ReactiveUI;
using Avalonia.ReactiveUI;

using SongProcessor.UI.ViewModels;

namespace SongProcessor.UI.Views;

public sealed class AddView : ReactiveUserControl<AddViewModel>
public partial class AddView : ReactiveUserControl<AddViewModel>
{
public AddView()
{
InitializeComponent();
}

private void InitializeComponent()
=> AvaloniaXamlLoader.Load(this);
}
8 changes: 2 additions & 6 deletions src/SongProcessor.UI/Views/EditView.axaml.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
using Avalonia.Markup.Xaml;
using Avalonia.ReactiveUI;
using Avalonia.ReactiveUI;

using SongProcessor.UI.ViewModels;

namespace SongProcessor.UI.Views;

public sealed class EditView : ReactiveUserControl<EditViewModel>
public partial class EditView : ReactiveUserControl<EditViewModel>
{
public EditView()
{
InitializeComponent();
}

private void InitializeComponent()
=> AvaloniaXamlLoader.Load(this);
}
8 changes: 2 additions & 6 deletions src/SongProcessor.UI/Views/MainWindow.axaml.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
using Avalonia.Markup.Xaml;
using Avalonia.ReactiveUI;
using Avalonia.ReactiveUI;

using SongProcessor.UI.ViewModels;

namespace SongProcessor.UI.Views;

public sealed class MainWindow : ReactiveWindow<MainViewModel>
public partial class MainWindow : ReactiveWindow<MainViewModel>
{
public MainWindow()
{
InitializeComponent();
}

private void InitializeComponent()
=> AvaloniaXamlLoader.Load(this);
}
6 changes: 1 addition & 5 deletions src/SongProcessor.UI/Views/MessageBox.axaml.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
using Avalonia.Controls;
using Avalonia.Markup.Xaml;

using SongProcessor.UI.ViewModels;

namespace SongProcessor.UI.Views;

public sealed class MessageBox : Window
public partial class MessageBox : Window
{
public MessageBox()
{
Expand All @@ -23,7 +22,4 @@ public static Task<T> ShowAsync<T>(
Focusable = true,
}.ShowDialog<T>(window);
}

private void InitializeComponent()
=> AvaloniaXamlLoader.Load(this);
}
9 changes: 2 additions & 7 deletions src/SongProcessor.UI/Views/SongView.axaml.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
using Avalonia.Controls;
using Avalonia.Input;
using Avalonia.Markup.Xaml;
using Avalonia.Input;
using Avalonia.ReactiveUI;

using SongProcessor.UI.ViewModels;

namespace SongProcessor.UI.Views;

public sealed class SongView : ReactiveUserControl<SongViewModel>
public partial class SongView : ReactiveUserControl<SongViewModel>
{
public SongView()
{
Expand All @@ -21,7 +19,4 @@ public void OnKeyDown(object sender, KeyEventArgs e)
ViewModel?.Load?.Execute();
}
}

private void InitializeComponent()
=> AvaloniaXamlLoader.Load(this);
}

0 comments on commit 8404093

Please sign in to comment.