Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Avalonia Build, update packages #736

Merged
merged 3 commits into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ dotnet_diagnostic.SA1006.severity = error
dotnet_diagnostic.SA1007.severity = error
dotnet_diagnostic.SA1008.severity = error
dotnet_diagnostic.SA1009.severity = error
dotnet_diagnostic.SA1010.severity = error
dotnet_diagnostic.SA1010.severity = none
dotnet_diagnostic.SA1011.severity = error
dotnet_diagnostic.SA1012.severity = error
dotnet_diagnostic.SA1013.severity = error
Expand Down
9 changes: 4 additions & 5 deletions Sample/SextantSample.Avalonia/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
using MsBox.Avalonia;
using Sextant;
using Sextant.Avalonia;
using SextantSample.Avalonia.Views;
Expand Down Expand Up @@ -32,11 +33,9 @@ public override void OnFrameworkInitializationCompleted()
.GetService<IViewStackService>()
.PushPage(new HomeViewModel());

Interactions.ErrorMessage.RegisterHandler(context =>
MessageBox.Avalonia
.MessageBoxManager
.GetMessageBoxStandardWindow("Notification", context.Input.ToString())
.Show());
Interactions.ErrorMessage.RegisterHandler(async context =>
await MessageBoxManager.GetMessageBoxStandard("Notification", context.Input.ToString())
.ShowAsync());

new Window { Content = Locator.Current.GetNavigationView() }.Show();
base.OnFrameworkInitializationCompleted();
Expand Down
46 changes: 25 additions & 21 deletions Sample/SextantSample.Avalonia/SextantSample.Avalonia.csproj
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Citrus.Avalonia" Version="2.1.1" />
<PackageReference Include="MessageBox.Avalonia" Version="3.1.5.1" />
</ItemGroup>
<ItemGroup>
<Compile Update="**\*.xaml.cs">
<DependentUpon>%(Filename)</DependentUpon>
</Compile>
<EmbeddedResource Include="**\*.xaml">
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SextantSample.Core\SextantSample.ViewModels.csproj" />
<ProjectReference Include="..\..\src\Sextant.Avalonia\Sextant.Avalonia.csproj" />
</ItemGroup>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<LangVersion>preview</LangVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Citrus.Avalonia" Version="2.1.1" />
<PackageReference Include="MessageBox.Avalonia" Version="3.1.5.1" />
</ItemGroup>

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

<ItemGroup>
<ProjectReference Include="..\SextantSample.Core\SextantSample.ViewModels.csproj" />
<ProjectReference Include="..\..\src\Sextant.Avalonia\Sextant.Avalonia.csproj" />
</ItemGroup>
</Project>
10 changes: 2 additions & 8 deletions Sample/SextantSample.Core/FirstModalNavigationViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
using System;
using Sextant;
using Sextant;

namespace SextantSample.ViewModels
{
public class FirstModalNavigationViewModel : ViewModelBase
public class FirstModalNavigationViewModel(IViewStackService viewStackService) : ViewModelBase(viewStackService)
{
public FirstModalNavigationViewModel(IViewStackService viewStackService)
: base(viewStackService)
{

}
public override string Id => nameof(FirstModalNavigationViewModel);
}
}
2 changes: 1 addition & 1 deletion Sample/SextantSample.Core/Interactions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ namespace SextantSample.ViewModels
{
public static class Interactions
{
public static readonly Interaction<Exception, bool> ErrorMessage = new Interaction<Exception, bool>();
public static readonly Interaction<Exception, bool> ErrorMessage = new();
}
}
1 change: 1 addition & 0 deletions Sample/SextantSample.Core/SextantSample.ViewModels.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net6.0;net7.0;net8.0</TargetFrameworks>
<Platforms>AnyCPU;x64</Platforms>
<LangVersion>preview</LangVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="31" />
<application android:allowBackup="true" android:icon="@mipmap/appicon" android:roundIcon="@mipmap/appicon_round" android:supportsRtl="true"></application>
<application android:allowBackup="true" android:supportsRtl="true"></application>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
</manifest>
15 changes: 8 additions & 7 deletions Sample/SextantSample.Maui/SextantSample.Maui.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,11 @@

<ItemGroup>
<!-- App Icon -->
<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" />

<!-- Splash Screen -->
<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#512BD4" BaseSize="128,128" />

<!-- Images -->
<MauiImage Include="Resources\Images\*" />
<MauiImage Update="Resources\Images\dotnet_bot.svg" BaseSize="168,208" />

<!-- Custom Fonts -->
<MauiFont Include="Resources\Fonts\*" />
Expand All @@ -58,6 +55,10 @@
<MauiFont Remove="Resources\Fonts\OpenSans-Semibold.ttf" />
</ItemGroup>

<ItemGroup>
<MauiImage Remove="Resources\Images\dotnet_bot.svg" />
</ItemGroup>

<ItemGroup>
<None Remove="Resources\AppIcon\appicon.svg" />
<None Remove="Resources\AppIcon\appiconfg.svg" />
Expand All @@ -68,13 +69,13 @@
</ItemGroup>

<ItemGroup>
<BundleResource Include="Resources\AppIcon\appicon.svg" />
<BundleResource Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" />
<BundleResource Include="Resources\AppIcon\appiconfg.svg" />
<BundleResource Include="Resources\Fonts\OpenSans-Regular.ttf" />
<BundleResource Include="Resources\Fonts\OpenSans-Semibold.ttf" />
<BundleResource Include="Resources\Images\dotnet_bot.svg" />
<BundleResource Include="Resources\Images\dotnet_bot.svg" BaseSize="168,208" />
<BundleResource Include="Resources\Raw\AboutAssets.txt" />
<BundleResource Include="Resources\Splash\splash.svg" />
<BundleResource Include="Resources\Splash\splash.svg" Color="#512BD4" BaseSize="128,128" />
</ItemGroup>

<ItemGroup>
Expand Down Expand Up @@ -106,7 +107,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
</ItemGroup>

</Project>
19 changes: 11 additions & 8 deletions Sample/SextantSample.WPF/MainWindow.xaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<wpf:FormsApplicationPage x:Class="SextantSample.WPF.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
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:wpf="clr-namespace:Xamarin.Forms.Platform.WPF;assembly=Xamarin.Forms.Platform.WPF"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800" />
<wpf:FormsApplicationPage
x:Class="SextantSample.WPF.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
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:wpf="clr-namespace:Xamarin.Forms.Platform.WPF;assembly=Xamarin.Forms.Platform.WPF"
Title="MainWindow"
Width="800"
Height="450"
mc:Ignorable="d" />
6 changes: 3 additions & 3 deletions Sample/SextantSample.WPF/SextantSample.WPF.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net5.0-windows</TargetFramework>
<TargetFramework>net8.0-windows</TargetFramework>
<UseWPF>true</UseWPF>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ReactiveUI.WPF" Version="13.0.38" />
<PackageReference Include="Xamarin.Forms.Platform.WPF" Version="4.8.0.1821" />
<PackageReference Include="ReactiveUI.WPF" Version="19.*" />
<PackageReference Include="Xamarin.Forms.Platform.WPF" Version="5.0.0.2622" />
</ItemGroup>

<ItemGroup>
Expand Down
16 changes: 13 additions & 3 deletions Sample/SextantSample.sln
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sextant.XamForms", "..\src\
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SextantSample.ViewModels", "SextantSample.Core\SextantSample.ViewModels.csproj", "{5818A5AF-3FF6-4E68-80FC-604D4AEF156C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SextantSample.WPF", "SextantSample.WPF\SextantSample.WPF.csproj", "{B3804254-BA2D-4ECF-9A71-8685843A546F}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SextantSample.WPF", "SextantSample.WPF\SextantSample.WPF.csproj", "{B3804254-BA2D-4ECF-9A71-8685843A546F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SextantSample.Maui", "SextantSample.Maui\SextantSample.Maui.csproj", "{7CABE10D-4CDE-4012-9385-6E49EE2E492F}"
EndProject
Expand Down Expand Up @@ -293,38 +293,48 @@ Global
{5818A5AF-3FF6-4E68-80FC-604D4AEF156C}.Sample Release|iPhone.Build.0 = Release|Any CPU
{5818A5AF-3FF6-4E68-80FC-604D4AEF156C}.Sample Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{5818A5AF-3FF6-4E68-80FC-604D4AEF156C}.Sample Release|iPhoneSimulator.Build.0 = Release|Any CPU
{5818A5AF-3FF6-4E68-80FC-604D4AEF156C}.Sample Release|x64.ActiveCfg = Release|x64
{5818A5AF-3FF6-4E68-80FC-604D4AEF156C}.Sample Release|x64.Build.0 = Release|x64
{B3804254-BA2D-4ECF-9A71-8685843A546F}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.Ad-Hoc|x64.ActiveCfg = Release|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.Ad-Hoc|x64.Build.0 = Release|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.AppStore|Any CPU.Build.0 = Debug|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.AppStore|iPhone.ActiveCfg = Debug|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.AppStore|iPhone.Build.0 = Debug|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.AppStore|x64.ActiveCfg = Release|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.AppStore|x64.Build.0 = Release|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.Debug|iPhone.Build.0 = Debug|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.Debug|x64.ActiveCfg = Debug|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.Debug|x64.Build.0 = Debug|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.Release|Any CPU.Build.0 = Release|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.Release|iPhone.ActiveCfg = Release|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.Release|iPhone.Build.0 = Release|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.Release|x64.ActiveCfg = Release|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.Release|x64.Build.0 = Release|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.Sample Release|Any CPU.ActiveCfg = Release|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.Sample Release|Any CPU.Build.0 = Release|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.Sample Release|iPhone.ActiveCfg = Release|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.Sample Release|iPhone.Build.0 = Release|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.Sample Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.Sample Release|iPhoneSimulator.Build.0 = Release|Any CPU
{5818A5AF-3FF6-4E68-80FC-604D4AEF156C}.Sample Release|x64.ActiveCfg = Release|x64
{5818A5AF-3FF6-4E68-80FC-604D4AEF156C}.Sample Release|x64.Build.0 = Release|x64
{B3804254-BA2D-4ECF-9A71-8685843A546F}.Sample Release|x64.ActiveCfg = Release|Any CPU
{B3804254-BA2D-4ECF-9A71-8685843A546F}.Sample Release|x64.Build.0 = Release|Any CPU
{7CABE10D-4CDE-4012-9385-6E49EE2E492F}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU
{7CABE10D-4CDE-4012-9385-6E49EE2E492F}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU
{7CABE10D-4CDE-4012-9385-6E49EE2E492F}.Ad-Hoc|Any CPU.Deploy.0 = Debug|Any CPU
Expand Down
3 changes: 1 addition & 2 deletions Sample/SextantSample/SextantSample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<Platforms>AnyCPU;x64</Platforms>
<LangVersion>preview</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Collections.Immutable" Version="8.0.0" />
<PackageReference Include="Pharmacist.MsBuild" Version="2.*" PrivateAssets="all" />
<PackageReference Include="Pharmacist.Common" Version="2.*" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Remove="MainPage.xaml" />
Expand Down
4 changes: 2 additions & 2 deletions src/Benchmarks/Sextant.Benchmarks.csproj
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<IsPackable>false</IsPackable>
<TargetFrameworks>net461;netcoreapp2.0</TargetFrameworks>
<TargetFrameworks>net462;net8.0</TargetFrameworks>
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<DebugSymbols>true</DebugSymbols>
<OutputType>Exe</OutputType>
<Nullable>enable</Nullable>
<NoWarn>;1591;1701;1702;1705;CA1822</NoWarn>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="*" />
<PackageReference Include="System.Reactive" Version="4.*" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Sextant\Sextant.csproj" />
Expand Down
10 changes: 5 additions & 5 deletions src/Directory.build.props
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@

<ItemGroup Condition="$(IsTestProject)">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.6.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.5" />
<PackageReference Include="xunit" Version="2.6.6" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.6" />
<PackageReference Include="Xunit.StaFact" Version="1.1.11" />
<PackageReference Include="Xamarin.Forms.Mocks" Version="4.7.0.1" />
<PackageReference Include="DiffEngine" Version="13.0.2" />
<PackageReference Include="DiffEngine" Version="15.1.1" />
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="ReactiveUI.Testing" Version="19.*" />
<PackageReference Include="Verify.Xunit" Version="22.8.0" />
<PackageReference Include="Verify.Xunit" Version="23.0.0" />
<PackageReference Include="PublicApiGenerator" Version="11.1.0" />
<PackageReference Include="NSubstitute" Version="5.1.0" />
<PackageReference Include="coverlet.msbuild" Version="6.0.0">
Expand All @@ -63,7 +63,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="stylecop.analyzers" Version="1.2.0-beta.507" PrivateAssets="all" />
<PackageReference Include="Roslynator.Analyzers" Version="4.7.0" PrivateAssets="All" />
<PackageReference Include="Roslynator.Analyzers" Version="4.9.0" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
Expand Down
9 changes: 4 additions & 5 deletions src/Sextant.Avalonia/DependencyResolverMixins.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,11 @@ public static IView GetNavigationView(
string? contract = null)
{
var view = dependencyResolver.GetService<IView>(contract ?? "NavigationView");
if (view is null)
return view switch
{
throw new InvalidOperationException("NavigationView not registered.");
}

return view;
null => throw new InvalidOperationException("NavigationView not registered."),
_ => view
};
}
}
}
4 changes: 2 additions & 2 deletions src/Sextant.Avalonia/Navigation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
using System.Reactive.Linq;

using Avalonia.Animation;
using Avalonia.ReactiveUI;
using Avalonia.Controls;

using DynamicData.Aggregation;
using DynamicData.Binding;
Expand Down Expand Up @@ -62,7 +62,7 @@ public Navigation()
/// <summary>
/// Gets the control responsible for rendering the current view.
/// </summary>
public TransitioningContentControl Control { get; } = new TransitioningContentControl();
public TransitioningContentControl Control { get; } = new();

/// <summary>
/// Toggles the animations.
Expand Down
Loading
Loading