From fd180cd1c1fd4a37dbe583280f26c136a4345096 Mon Sep 17 00:00:00 2001 From: Damian Suess Date: Fri, 24 Nov 2023 10:52:45 -0500 Subject: [PATCH 1/3] Upgraded to Prism.Avalonia v8.1.97.11000 and Avalonia v11.0.5 NOTE: Issues on startup * InnerException = "DataTemplate inside of DataTemplates must have a DataType set. Set DataType property or use ItemTemplate with single template instead." --- SampleApp.Services/SampleApp.Services.csproj | 7 ++++++- .../SampleApp.Common/SampleApp.Common.csproj | 12 ++++++----- source/SampleApp.Common/TabControlAdapter.cs | 12 ++++++----- source/SampleApp.Main/App.axaml | 20 ++++++++++--------- source/SampleApp.Main/App.axaml.cs | 6 +++--- .../Core/RegionAdapters/GridRegionAdapter.cs | 9 +++++---- .../RegionAdapters/StackPanelRegionAdapter.cs | 8 ++++---- source/SampleApp.Main/Program.cs | 4 ---- source/SampleApp.Main/SampleApp.csproj | 14 +++++++------ .../SampleApp.Modules.Calendar.csproj | 14 +++++++------ .../Views/CalendarView.axaml | 8 ++++---- .../SampleApp.Modules.Contacts.csproj | 14 +++++++------ .../SampleApp.Modules.Mail.csproj | 14 +++++++------ .../Views/MailFocusedView.axaml | 4 ++-- .../SampleApp.Modules.Message.csproj | 14 +++++++------ 15 files changed, 89 insertions(+), 71 deletions(-) diff --git a/SampleApp.Services/SampleApp.Services.csproj b/SampleApp.Services/SampleApp.Services.csproj index 23fe4a7..7ccab61 100644 --- a/SampleApp.Services/SampleApp.Services.csproj +++ b/SampleApp.Services/SampleApp.Services.csproj @@ -1,11 +1,16 @@ - net6.0 + net7.0 enable enable + 11.0 + + + + diff --git a/source/SampleApp.Common/SampleApp.Common.csproj b/source/SampleApp.Common/SampleApp.Common.csproj index 7dd0a84..a5d1b52 100644 --- a/source/SampleApp.Common/SampleApp.Common.csproj +++ b/source/SampleApp.Common/SampleApp.Common.csproj @@ -1,15 +1,17 @@ - net6.0 + net7.0 ..\..\output + 11.0 - - - - + + + + + diff --git a/source/SampleApp.Common/TabControlAdapter.cs b/source/SampleApp.Common/TabControlAdapter.cs index 02c9187..970fbb5 100644 --- a/source/SampleApp.Common/TabControlAdapter.cs +++ b/source/SampleApp.Common/TabControlAdapter.cs @@ -59,8 +59,9 @@ protected override void Adapt(IRegion region, TabControl regionTarget) { var items = regionTarget.Items.Cast().ToList(); items.Add(new TabItem { Header = item.Tag, Content = item }); - regionTarget.Items = items; // Avalonia v0.10.x - //// regionTarget.Items.Set(items); // Avalonia v11 + + //// regionTarget.Items = items; // Avalonia v0.10.x + regionTarget.ItemsSource = items; // Avalonia v11.0 } } else if (e.Action == NotifyCollectionChangedAction.Remove) @@ -68,12 +69,13 @@ protected override void Adapt(IRegion region, TabControl regionTarget) foreach (UserControl item in e.OldItems) { var tabToDelete = regionTarget.Items.OfType().FirstOrDefault(n => n.Content == item); - // regionTarget.Items.Remove(tabToDelete); // WPF + // regionTarget.Items.Remove(tabToDelete); // WPF var items = regionTarget.Items.Cast().ToList(); items.Remove(tabToDelete); - regionTarget.Items = items; - //// regionTarget.Items.Set(items); // Avalonia v11 + + //// regionTarget.Items = items; // Avalonia v0.10 + regionTarget.ItemsSource = items; // Avalonia v11 } } }; diff --git a/source/SampleApp.Main/App.axaml b/source/SampleApp.Main/App.axaml index fbc31a6..2db8925 100644 --- a/source/SampleApp.Main/App.axaml +++ b/source/SampleApp.Main/App.axaml @@ -1,11 +1,13 @@ - + - + - - + --> + + + + diff --git a/source/SampleApp.Main/App.axaml.cs b/source/SampleApp.Main/App.axaml.cs index d939603..b449967 100644 --- a/source/SampleApp.Main/App.axaml.cs +++ b/source/SampleApp.Main/App.axaml.cs @@ -1,4 +1,4 @@ -using Avalonia; +using Avalonia; using Avalonia.Controls; using Avalonia.Markup.Xaml; using Prism.Ioc; @@ -45,7 +45,7 @@ protected override void ConfigureRegionAdapterMappings(RegionAdapterMappings reg regionAdapterMappings.RegisterMapping(typeof(TabControl), Container.Resolve()); } - protected override IAvaloniaObject CreateShell() + protected override AvaloniaObject CreateShell() { return this.Container.Resolve(); } @@ -75,4 +75,4 @@ protected override void RegisterTypes(IContainerRegistry containerRegistry) containerRegistry.RegisterForNavigation(); containerRegistry.RegisterForNavigation(); } -} \ No newline at end of file +} diff --git a/source/SampleApp.Main/Core/RegionAdapters/GridRegionAdapter.cs b/source/SampleApp.Main/Core/RegionAdapters/GridRegionAdapter.cs index 4c80819..ba98fac 100644 --- a/source/SampleApp.Main/Core/RegionAdapters/GridRegionAdapter.cs +++ b/source/SampleApp.Main/Core/RegionAdapters/GridRegionAdapter.cs @@ -1,4 +1,4 @@ -using Avalonia.Controls; +using Avalonia.Controls; using Prism.Regions; namespace SampleApp.Main.Core.RegionAdapters @@ -16,14 +16,15 @@ protected override void Adapt(IRegion region, Grid regionTarget) { if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Add) { - foreach (IControl item in e.NewItems) + foreach (Control item in e.NewItems) { regionTarget.Children.Add(item); } } + if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Remove) { - foreach (IControl item in e.OldItems) + foreach (Control item in e.OldItems) { regionTarget.Children.Remove(item); } @@ -33,4 +34,4 @@ protected override void Adapt(IRegion region, Grid regionTarget) protected override IRegion CreateRegion() => new SingleActiveRegion() { }; } -} \ No newline at end of file +} diff --git a/source/SampleApp.Main/Core/RegionAdapters/StackPanelRegionAdapter.cs b/source/SampleApp.Main/Core/RegionAdapters/StackPanelRegionAdapter.cs index 6e5eb7c..1da8139 100644 --- a/source/SampleApp.Main/Core/RegionAdapters/StackPanelRegionAdapter.cs +++ b/source/SampleApp.Main/Core/RegionAdapters/StackPanelRegionAdapter.cs @@ -1,4 +1,4 @@ -using Avalonia.Controls; +using Avalonia.Controls; using Prism.Regions; namespace SampleApp.Main.Core.RegionAdapters @@ -16,7 +16,7 @@ protected override void Adapt(IRegion region, StackPanel regionTarget) { if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Add) { - foreach (IControl item in e.NewItems) + foreach (Control item in e.NewItems) { if (e.NewItems != null) regionTarget.Children.Add(item); @@ -25,7 +25,7 @@ protected override void Adapt(IRegion region, StackPanel regionTarget) if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Remove) { - foreach (IControl item in e.OldItems) + foreach (Control item in e.OldItems) { if (e.OldItems != null) regionTarget.Children.Remove(item); @@ -36,4 +36,4 @@ protected override void Adapt(IRegion region, StackPanel regionTarget) protected override IRegion CreateRegion() => new SingleActiveRegion() { }; } -} \ No newline at end of file +} diff --git a/source/SampleApp.Main/Program.cs b/source/SampleApp.Main/Program.cs index c291f08..3cd10a0 100644 --- a/source/SampleApp.Main/Program.cs +++ b/source/SampleApp.Main/Program.cs @@ -13,10 +13,6 @@ public static AppBuilder BuildAvaloniaApp() => AppBuilder EnableMultiTouch = false, UseDBusMenu = true }) - .With(new Win32PlatformOptions { - EnableMultitouch = true, - AllowEglInitialization = true - }) .UseSkia() .UseReactiveUI() .LogToTrace(); diff --git a/source/SampleApp.Main/SampleApp.csproj b/source/SampleApp.Main/SampleApp.csproj index 78444d2..605ddd1 100644 --- a/source/SampleApp.Main/SampleApp.csproj +++ b/source/SampleApp.Main/SampleApp.csproj @@ -1,19 +1,21 @@  WinExe - net6.0 + net7.0 enable + 11.0 - - - - - + + + + + + diff --git a/source/SampleApp.Modules.Calendar/SampleApp.Modules.Calendar.csproj b/source/SampleApp.Modules.Calendar/SampleApp.Modules.Calendar.csproj index 78c37d1..97d5b76 100644 --- a/source/SampleApp.Modules.Calendar/SampleApp.Modules.Calendar.csproj +++ b/source/SampleApp.Modules.Calendar/SampleApp.Modules.Calendar.csproj @@ -1,9 +1,10 @@ library - net6.0 + net7.0 enable ..\..\output + 11.0 @@ -15,11 +16,12 @@ - - - - - + + + + + + diff --git a/source/SampleApp.Modules.Calendar/Views/CalendarView.axaml b/source/SampleApp.Modules.Calendar/Views/CalendarView.axaml index 36398f2..4fb4dc3 100644 --- a/source/SampleApp.Modules.Calendar/Views/CalendarView.axaml +++ b/source/SampleApp.Modules.Calendar/Views/CalendarView.axaml @@ -1,4 +1,4 @@ - - - - + diff --git a/source/SampleApp.Modules.Contacts/SampleApp.Modules.Contacts.csproj b/source/SampleApp.Modules.Contacts/SampleApp.Modules.Contacts.csproj index 78c37d1..97d5b76 100644 --- a/source/SampleApp.Modules.Contacts/SampleApp.Modules.Contacts.csproj +++ b/source/SampleApp.Modules.Contacts/SampleApp.Modules.Contacts.csproj @@ -1,9 +1,10 @@ library - net6.0 + net7.0 enable ..\..\output + 11.0 @@ -15,11 +16,12 @@ - - - - - + + + + + + diff --git a/source/SampleApp.Modules.Mail/SampleApp.Modules.Mail.csproj b/source/SampleApp.Modules.Mail/SampleApp.Modules.Mail.csproj index b841a4d..5e986db 100644 --- a/source/SampleApp.Modules.Mail/SampleApp.Modules.Mail.csproj +++ b/source/SampleApp.Modules.Mail/SampleApp.Modules.Mail.csproj @@ -1,19 +1,21 @@ library - net6.0 + net7.0 enable ..\..\output + 11.0 - - - - - + + + + + + diff --git a/source/SampleApp.Modules.Mail/Views/MailFocusedView.axaml b/source/SampleApp.Modules.Mail/Views/MailFocusedView.axaml index e1569a8..38fd178 100644 --- a/source/SampleApp.Modules.Mail/Views/MailFocusedView.axaml +++ b/source/SampleApp.Modules.Mail/Views/MailFocusedView.axaml @@ -1,4 +1,4 @@ - diff --git a/source/SampleApp.Modules.Message/SampleApp.Modules.Message.csproj b/source/SampleApp.Modules.Message/SampleApp.Modules.Message.csproj index 78c37d1..97d5b76 100644 --- a/source/SampleApp.Modules.Message/SampleApp.Modules.Message.csproj +++ b/source/SampleApp.Modules.Message/SampleApp.Modules.Message.csproj @@ -1,9 +1,10 @@ library - net6.0 + net7.0 enable ..\..\output + 11.0 @@ -15,11 +16,12 @@ - - - - - + + + + + + From 045870674cdc16d65da1955ebd633729757ed914 Mon Sep 17 00:00:00 2001 From: Damian Suess Date: Fri, 24 Nov 2023 11:48:12 -0500 Subject: [PATCH 2/3] Unified NuGet versioning via Directory.Packages.props. Set Avalonia ver to match Prism.Avalonia --- Directory.Packages.props | 12 ++++++++++++ Outlookish.sln | 3 ++- SampleApp.Services/SampleApp.Services.csproj | 2 +- source/SampleApp.Common/SampleApp.Common.csproj | 9 ++++----- source/SampleApp.Main/Program.cs | 1 + source/SampleApp.Main/SampleApp.csproj | 14 +++++++------- .../SampleApp.Modules.Calendar.csproj | 12 ++++++------ .../SampleApp.Modules.Contacts.csproj | 12 ++++++------ .../SampleApp.Modules.Mail.csproj | 12 ++++++------ .../SampleApp.Modules.Message.csproj | 12 ++++++------ 10 files changed, 51 insertions(+), 38 deletions(-) create mode 100644 Directory.Packages.props diff --git a/Directory.Packages.props b/Directory.Packages.props new file mode 100644 index 0000000..4b46221 --- /dev/null +++ b/Directory.Packages.props @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/Outlookish.sln b/Outlookish.sln index 8622348..ee42685 100644 --- a/Outlookish.sln +++ b/Outlookish.sln @@ -21,10 +21,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution ProjectSection(SolutionItems) = preProject .editorconfig = .editorconfig CodeMaid.config = CodeMaid.config + Directory.Packages.props = Directory.Packages.props readme.md = readme.md EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleApp.Services", "SampleApp.Services\SampleApp.Services.csproj", "{1AFDDD2F-2AF5-4BF3-AE04-89A23B2991D3}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SampleApp.Services", "SampleApp.Services\SampleApp.Services.csproj", "{1AFDDD2F-2AF5-4BF3-AE04-89A23B2991D3}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/SampleApp.Services/SampleApp.Services.csproj b/SampleApp.Services/SampleApp.Services.csproj index 7ccab61..2e224a4 100644 --- a/SampleApp.Services/SampleApp.Services.csproj +++ b/SampleApp.Services/SampleApp.Services.csproj @@ -8,7 +8,7 @@ - + diff --git a/source/SampleApp.Common/SampleApp.Common.csproj b/source/SampleApp.Common/SampleApp.Common.csproj index a5d1b52..947921a 100644 --- a/source/SampleApp.Common/SampleApp.Common.csproj +++ b/source/SampleApp.Common/SampleApp.Common.csproj @@ -7,11 +7,10 @@ - - - - - + + + + diff --git a/source/SampleApp.Main/Program.cs b/source/SampleApp.Main/Program.cs index 3cd10a0..747ddf0 100644 --- a/source/SampleApp.Main/Program.cs +++ b/source/SampleApp.Main/Program.cs @@ -1,4 +1,5 @@ using Avalonia; +using Avalonia.Controls; using Avalonia.ReactiveUI; namespace SampleApp diff --git a/source/SampleApp.Main/SampleApp.csproj b/source/SampleApp.Main/SampleApp.csproj index 605ddd1..51715d0 100644 --- a/source/SampleApp.Main/SampleApp.csproj +++ b/source/SampleApp.Main/SampleApp.csproj @@ -10,13 +10,13 @@ - - - - - - - + + + + + + + diff --git a/source/SampleApp.Modules.Calendar/SampleApp.Modules.Calendar.csproj b/source/SampleApp.Modules.Calendar/SampleApp.Modules.Calendar.csproj index 97d5b76..219fc08 100644 --- a/source/SampleApp.Modules.Calendar/SampleApp.Modules.Calendar.csproj +++ b/source/SampleApp.Modules.Calendar/SampleApp.Modules.Calendar.csproj @@ -16,12 +16,12 @@ - - - - - - + + + + + + diff --git a/source/SampleApp.Modules.Contacts/SampleApp.Modules.Contacts.csproj b/source/SampleApp.Modules.Contacts/SampleApp.Modules.Contacts.csproj index 97d5b76..6393ef3 100644 --- a/source/SampleApp.Modules.Contacts/SampleApp.Modules.Contacts.csproj +++ b/source/SampleApp.Modules.Contacts/SampleApp.Modules.Contacts.csproj @@ -16,12 +16,12 @@ - - - - - - + + + + + + diff --git a/source/SampleApp.Modules.Mail/SampleApp.Modules.Mail.csproj b/source/SampleApp.Modules.Mail/SampleApp.Modules.Mail.csproj index 5e986db..b4def20 100644 --- a/source/SampleApp.Modules.Mail/SampleApp.Modules.Mail.csproj +++ b/source/SampleApp.Modules.Mail/SampleApp.Modules.Mail.csproj @@ -10,12 +10,12 @@ - - - - - - + + + + + + diff --git a/source/SampleApp.Modules.Message/SampleApp.Modules.Message.csproj b/source/SampleApp.Modules.Message/SampleApp.Modules.Message.csproj index 97d5b76..6393ef3 100644 --- a/source/SampleApp.Modules.Message/SampleApp.Modules.Message.csproj +++ b/source/SampleApp.Modules.Message/SampleApp.Modules.Message.csproj @@ -16,12 +16,12 @@ - - - - - - + + + + + + From 5e014cd54d2d181088afa717a9d0dd96be85586b Mon Sep 17 00:00:00 2001 From: Damian Suess Date: Fri, 24 Nov 2023 13:24:10 -0500 Subject: [PATCH 3/3] ReactiveUI --- source/SampleApp.Common/SampleApp.Common.csproj | 1 + .../SampleApp.Modules.Contacts.csproj | 2 +- source/SampleApp.Modules.Mail/SampleApp.Modules.Mail.csproj | 2 +- .../SampleApp.Modules.Message/SampleApp.Modules.Message.csproj | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/source/SampleApp.Common/SampleApp.Common.csproj b/source/SampleApp.Common/SampleApp.Common.csproj index 947921a..65ed6e0 100644 --- a/source/SampleApp.Common/SampleApp.Common.csproj +++ b/source/SampleApp.Common/SampleApp.Common.csproj @@ -8,6 +8,7 @@ + diff --git a/source/SampleApp.Modules.Contacts/SampleApp.Modules.Contacts.csproj b/source/SampleApp.Modules.Contacts/SampleApp.Modules.Contacts.csproj index 6393ef3..219fc08 100644 --- a/source/SampleApp.Modules.Contacts/SampleApp.Modules.Contacts.csproj +++ b/source/SampleApp.Modules.Contacts/SampleApp.Modules.Contacts.csproj @@ -19,7 +19,7 @@ - + diff --git a/source/SampleApp.Modules.Mail/SampleApp.Modules.Mail.csproj b/source/SampleApp.Modules.Mail/SampleApp.Modules.Mail.csproj index b4def20..8856028 100644 --- a/source/SampleApp.Modules.Mail/SampleApp.Modules.Mail.csproj +++ b/source/SampleApp.Modules.Mail/SampleApp.Modules.Mail.csproj @@ -13,7 +13,7 @@ - + diff --git a/source/SampleApp.Modules.Message/SampleApp.Modules.Message.csproj b/source/SampleApp.Modules.Message/SampleApp.Modules.Message.csproj index 6393ef3..219fc08 100644 --- a/source/SampleApp.Modules.Message/SampleApp.Modules.Message.csproj +++ b/source/SampleApp.Modules.Message/SampleApp.Modules.Message.csproj @@ -19,7 +19,7 @@ - +