diff --git a/ChangeLog.md b/ChangeLog.md index e77e1e7..30fc3ae 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -2,14 +2,21 @@ Change log history for Prism.Avalonia -## v8.1.97.1 +## v8.1.97.1 - 2022-12-08 -* Fixed: Automatically performs `AutoWireViewModel` +* NEW: Automatically performs `AutoWireViewModel` * No longer need to device `prism:ViewModelLocator.AutoWireViewModel="True"` in View * Updated DryIoc to v4.8.0 * Updated to Avalonia v0.10.18 +* Fixed unit tests +* Spelling corrections +* Added Sample, Notificiation Pop-up Service -## v8.1.97 +## v8.1.97 - 2022-07-14 -* Upgraded system to support Prism.Core v8.1.97 +* Upgraded to support Prism.Core v8.1.97 * See [[Upgrade-Prism-7.2-to-8.1.md]] for more details + +## v7.2.0.1430 + +* Upgraded to support Prism.Core v7.2.0.1430 diff --git a/build/AvaloniaDependency.props b/build/AvaloniaDependency.props index fa8e350..238fe64 100644 --- a/build/AvaloniaDependency.props +++ b/build/AvaloniaDependency.props @@ -3,14 +3,14 @@ xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - - - - - - - - + + + + + + + + diff --git a/build/Base.props b/build/Base.props index 132edfa..4a3b953 100644 --- a/build/Base.props +++ b/build/Base.props @@ -2,9 +2,9 @@ - 8.1.97.2 + 8.1.97.3-preview.11.4 https://github.com/AvaloniaCommunity/Prism.Avalonia - Copyright (c) 2022 Avalonia Community + Copyright (c) 2023 Avalonia Community MIT https://github.com/AvaloniaCommunity/Prism.Avalonia diff --git a/build/BuildTargets.props b/build/BuildTargets.props index 5ba64dc..1c000fb 100644 --- a/build/BuildTargets.props +++ b/build/BuildTargets.props @@ -3,7 +3,7 @@ xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - netstandard2.0;netstandard2.1;net5.0;net6.0 + netstandard2.0;netstandard2.1;net6.0 diff --git a/build/SampleApp.props b/build/SampleApp.props index b5e3c0c..0697eec 100644 --- a/build/SampleApp.props +++ b/build/SampleApp.props @@ -6,6 +6,7 @@ + diff --git a/samples/BootstrapperShellSample/App.xaml.cs b/samples/BootstrapperShellSample/App.xaml.cs index 3062249..06b29d9 100644 --- a/samples/BootstrapperShellSample/App.xaml.cs +++ b/samples/BootstrapperShellSample/App.xaml.cs @@ -2,7 +2,6 @@ using Avalonia; using Avalonia.Controls; using Avalonia.Diagnostics; -using Avalonia.Themes.Default; using Avalonia.Markup.Xaml; using CommonServiceLocator; using DryIoc; diff --git a/samples/ModulesSample/App.xaml.cs b/samples/ModulesSample/App.xaml.cs index dd8c214..91cf198 100644 --- a/samples/ModulesSample/App.xaml.cs +++ b/samples/ModulesSample/App.xaml.cs @@ -33,7 +33,7 @@ public static AppBuilder BuildAvaloniaApp() }) .With(new Win32PlatformOptions { - EnableMultitouch = true, + //// EnableMultitouch = true, // Not supported in Avalonia v11.0.0-preview4 AllowEglInitialization = true, }) .UseSkia() diff --git a/samples/SampleDialogApp/Program.cs b/samples/SampleDialogApp/Program.cs index ce668de..1eb3b63 100644 --- a/samples/SampleDialogApp/Program.cs +++ b/samples/SampleDialogApp/Program.cs @@ -16,7 +16,11 @@ public static AppBuilder BuildAvaloniaApp() => AppBuilder.Configure() .UsePlatformDetect() .With(new X11PlatformOptions { EnableMultiTouch = true, UseDBusMenu = true, }) - .With(new Win32PlatformOptions { EnableMultitouch = true, AllowEglInitialization = true, }) + .With(new Win32PlatformOptions + { + // EnableMultitouch = true, // Not supported in Avalonia v11.0.0-preview4 + AllowEglInitialization = true, + }) .UseSkia() .LogToTrace(); } diff --git a/samples/SampleMvvmApp/App.xaml.cs b/samples/SampleMvvmApp/App.xaml.cs index 9ce5137..89c6a6c 100644 --- a/samples/SampleMvvmApp/App.xaml.cs +++ b/samples/SampleMvvmApp/App.xaml.cs @@ -1,76 +1,90 @@ using System; using Avalonia; using Avalonia.Markup.Xaml; -using SampleMvvmApp.ViewModels; -using SampleMvvmApp.Views; using Prism.DryIoc; using Prism.Ioc; +using Prism.Modularity; using Prism.Regions; using SampleMvvmApp.Services; +using SampleMvvmApp.ViewModels; +using SampleMvvmApp.Views; + +namespace SampleMvvmApp; -namespace SampleMvvmApp +/// +/// Application entry point. +/// +/// The methods below are laid out in their order of operation to assist +/// you getting started with Prism.Avalonia. +/// +public class App : PrismApplication { - /// - /// Application entry point. - /// The methods in this file are layed out in their respective calling order - /// to help you learn the order of operation. - /// - public class App : PrismApplication + /// App entry point. + public App() { - /// App entry point. - public App() - { - Console.WriteLine("Constructor()"); - } + Console.WriteLine("Constructor()"); + } - // Note: - // Though, Prism.WPF v8.1 uses, `protected virtual void Initialize()` - // Avalonia's AppBuilderBase.cs calls, `.Setup() { ... Instance.Initialize(); ... }` - // Therefore, we need this as a `public override void` in PrismApplicationBase.cs - public override void Initialize() - { - Console.WriteLine("Initialize()"); - AvaloniaXamlLoader.Load(this); + // Note: + // Though, Prism.WPF v8.1 uses, `protected virtual void Initialize()` + // Avalonia's AppBuilderBase.cs calls, `.Setup() { ... Instance.Initialize(); ... }` + // Therefore, we need this as a `public override void` in PrismApplicationBase.cs + public override void Initialize() + { + Console.WriteLine("Initialize()"); + AvaloniaXamlLoader.Load(this); - // DON'T FORGET TO CALL THIS - base.Initialize(); - } + // Initializes Prism.Avalonia - DO NOT REMOVE + base.Initialize(); + } - /// Called after Initialize. - protected override void OnInitialized() - { - // Register Views to the Region it will appear in. Don't register them in the ViewModel. - var regionManager = Container.Resolve(); - regionManager.RegisterViewWithRegion(RegionNames.ContentRegion, typeof(DashboardView)); - regionManager.RegisterViewWithRegion(RegionNames.SidebarRegion, typeof(SidebarView)); + /// Register Services and Views. + /// + protected override void RegisterTypes(IContainerRegistry containerRegistry) + { + Console.WriteLine("RegisterTypes()"); - ////var logService = Container.Resolve(); - ////logService.Configure("swlog.config"); - } + // Services + containerRegistry.RegisterSingleton(); - protected override void RegisterTypes(IContainerRegistry containerRegistry) - { - Console.WriteLine("RegisterTypes()"); + // Views - Generic + //// containerRegistry.Register(); // Not required + //// containerRegistry.Register(); - // Services - containerRegistry.RegisterSingleton(); + // Views - Region Navigation + containerRegistry.RegisterForNavigation(); + containerRegistry.RegisterForNavigation(); + containerRegistry.RegisterForNavigation(); + } + + /// Register optional modules in the catalog. + /// Module Catalog. + protected override void ConfigureModuleCatalog(IModuleCatalog moduleCatalog) + { + base.ConfigureModuleCatalog(moduleCatalog); + } - // Views - Generic - containerRegistry.Register(); - containerRegistry.Register(); + /// User interface entry point, called after Register and ConfigureModules. + /// Startup View. + protected override IAvaloniaObject CreateShell() + { + Console.WriteLine("CreateShell()"); + return Container.Resolve(); + } + + /// Called after Initialize. + protected override void OnInitialized() + { + // Register Views to the Region it will appear in. Don't register them in the ViewModel. + var regionManager = Container.Resolve(); - // Views - Region Navigation - containerRegistry.RegisterForNavigation(); - containerRegistry.RegisterForNavigation(); - containerRegistry.RegisterForNavigation(); - } + // WARNING: Prism v11.0.0-prev4 + // - DataTemplates MUST define a DataType or else an XAML error will be thrown + // - Error: DataTemplate inside of DataTemplates must have a DataType set + regionManager.RegisterViewWithRegion(RegionNames.ContentRegion, typeof(DashboardView)); + regionManager.RegisterViewWithRegion(RegionNames.SidebarRegion, typeof(SidebarView)); - /// User interface entry point, called after Register and ConfigureModules. - /// Startup View. - protected override IAvaloniaObject CreateShell() - { - Console.WriteLine("CreateShell()"); - return Container.Resolve(); - } + ////var logService = Container.Resolve(); + ////logService.Configure("swlog.config"); } } diff --git a/samples/SampleMvvmApp/Program.cs b/samples/SampleMvvmApp/Program.cs index 3fd7a6a..a281812 100644 --- a/samples/SampleMvvmApp/Program.cs +++ b/samples/SampleMvvmApp/Program.cs @@ -2,30 +2,34 @@ using Avalonia; using Avalonia.Logging; -namespace SampleMvvmApp +namespace SampleMvvmApp; + +public class Program { - public class Program + public static AppBuilder BuildAvaloniaApp() { - public static AppBuilder BuildAvaloniaApp() - { - var builder = AppBuilder - .Configure() - .UsePlatformDetect() - .With(new X11PlatformOptions { EnableMultiTouch = true, UseDBusMenu = true, }) - .With(new Win32PlatformOptions { EnableMultitouch = true, AllowEglInitialization = true, }) - .UseSkia(); - // .UseReactiveUI(); + var builder = AppBuilder + .Configure() + .UsePlatformDetect() + .With(new X11PlatformOptions { EnableMultiTouch = true, UseDBusMenu = true, }) + .With(new Win32PlatformOptions + { + //// EnableMultitouch = true, // In Avalonia v11 this is always enabled + AllowEglInitialization = true, + }) + .UseSkia(); + // .UseReactiveUI(); #if DEBUG - builder.LogToTrace(LogEventLevel.Debug, LogArea.Property, LogArea.Layout, LogArea.Binding); + builder.LogToTrace(LogEventLevel.Debug, LogArea.Property, LogArea.Layout, LogArea.Binding); #endif - return builder; - } - - // 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. - [ExcludeFromCodeCoverage] - static void Main(string[] args) => BuildAvaloniaApp().StartWithClassicDesktopLifetime(args); + return builder; } + + // 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. + [ExcludeFromCodeCoverage] + static void Main(string[] args) => + BuildAvaloniaApp().StartWithClassicDesktopLifetime(args); } diff --git a/samples/SampleMvvmApp/Views/DashboardView.xaml b/samples/SampleMvvmApp/Views/DashboardView.xaml index c611ee8..c82c981 100644 --- a/samples/SampleMvvmApp/Views/DashboardView.xaml +++ b/samples/SampleMvvmApp/Views/DashboardView.xaml @@ -3,13 +3,13 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:prism="http://prismlibrary.com/" + xmlns:system="clr-namespace:System;assembly=mscorlib" + xmlns:vm="using:SampleMvvmApp.ViewModels" x:Class="SampleMvvmApp.Views.DashboardView" - d:DesignHeight="350" - d:DesignWidth="500" - mc:Ignorable="d"> - + x:CompileBindings="True" + x:DataType="vm:DashboardViewModel" + d:DesignHeight="350" d:DesignWidth="500" mc:Ignorable="d"> -