Skip to content

Commit be313b1

Browse files
authored
Merge pull request #179 from AvaloniaCommunity/feature/PrismAvalona-11.1
Upgrade NuGet packages to Avalonia v11.1.1
2 parents f9bd68a + f7f4b9a commit be313b1

22 files changed

+279
-346
lines changed

ChangeLog.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,23 @@
22

33
Change log history for Prism.Avalonia
44

5-
## v9.0.401-pre (20204-04-13)
5+
## v9.0.401.11110-pre (2024-08-03)
6+
7+
* Upgraded to Avalonia v11.1.1
8+
* Fixed ItemsControlRegionAdapter not attaching object due to previous binding
9+
10+
## v9.0.401.11074-pre (2024-07-26)
11+
12+
* Prism.Core v9.0.401-pre
13+
* Removed dependency on Avalonia.ReactiveUI
14+
* Updated documentation
15+
* Synced with latest develop
16+
17+
## v9.0.401.11000-pre (2024-04-28)
18+
19+
* Fixed Prism.Core targeting v9.0.401-pre
20+
21+
## v9.0.401.11074-pre (2024-04-13)
622

723
* Fixed typos
824
* DynamicallyAccessedMembers Attribute for linker hints
@@ -11,8 +27,9 @@ Change log history for Prism.Avalonia
1127
## v9.0.271-pre (2024-04-12)
1228

1329
* Upgraded Prism.Core to v9.0.271-pre
30+
* Using Prism.Container
1431
* Breaking Changes:
15-
* `Prism.Dialog`
32+
* `Prism.Dialog` [see PR #128](https://github.com/AvaloniaCommunity/Prism.Avalonia/pull/128)
1633
* `Prism.Region` -> `Prism.Navigation.Region`
1734

1835
## v8.1.97.11073 (2024-04-28)

Directory.Packages.props

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,22 @@
11
<Project>
2-
32
<!-- Prism -->
43
<ItemGroup>
54
<PackageVersion Include="Prism.Core" Version="9.0.401-pre" />
65
<PackageVersion Include="Prism.Container.Abstractions" Version="9.0.84-pre" />
76
<PackageVersion Include="Prism.Container.DryIoc" Version="9.0.84-pre" />
87
<PackageVersion Include="Prism.Container.Unity" Version="9.0.84-pre" />
98
</ItemGroup>
10-
119
<!-- Avalonia -->
1210
<ItemGroup>
13-
<PackageVersion Include="Avalonia" Version="11.0.7" />
14-
<PackageVersion Include="Avalonia.Desktop" Version="11.0.7" />
15-
<PackageVersion Include="Avalonia.Diagnostics" Version="11.0.7" />
16-
<PackageVersion Include="Avalonia.LinuxFramebuffer" Version="11.0.7" />
17-
<PackageVersion Include="Avalonia.Markup.Xaml.Loader" Version="11.0.7" />
11+
<PackageVersion Include="Avalonia" Version="11.1.1" />
12+
<PackageVersion Include="Avalonia.Desktop" Version="11.1.1" />
13+
<PackageVersion Include="Avalonia.Diagnostics" Version="11.1.1" />
14+
<PackageVersion Include="Avalonia.LinuxFramebuffer" Version="11.1.1" />
15+
<PackageVersion Include="Avalonia.Markup.Xaml.Loader" Version="11.1.1" />
1816
<PackageVersion Include="Avalonia.ReactiveUI" Version="11.0.7" />
19-
<PackageVersion Include="Avalonia.Themes.Simple" Version="11.0.7" />
20-
<PackageVersion Include="Avalonia.Themes.Fluent" Version="11.0.7" />
17+
<PackageVersion Include="Avalonia.Themes.Simple" Version="11.1.1" />
18+
<PackageVersion Include="Avalonia.Themes.Fluent" Version="11.1.1" />
2119
</ItemGroup>
22-
2320
<!-- 3rd-Party -->
2421
<ItemGroup>
2522
<PackageVersion Include="DryIoc.dll" Version="5.4.3" />
@@ -30,18 +27,16 @@
3027
<PackageVersion Include="Nerdbank.GitVersioning" Version="3.6.133" />
3128
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.1.1" />
3229
</ItemGroup>
33-
3430
<!-- Tests -->
3531
<ItemGroup>
3632
<!--<PackageVersion Include="MSTest.TestAdapter" Version="1.3.2" />
3733
<PackageVersion Include="MSTest.TestFramework" Version="1.3.2" />-->
38-
3934
<PackageVersion Include="coverlet.collector" Version="6.0.0" />
4035
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
4136
<PackageVersion Include="Moq" Version="4.20.70" />
4237
<PackageVersion Include="System.CodeDom" Version="6.0.0" />
4338
<PackageVersion Include="xunit" Version="2.6.6" />
44-
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.6"/>
39+
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.6" />
4540
<PackageVersion Include="Xunit.StaFact" Version="1.1.11" />
4641
</ItemGroup>
47-
</Project>
42+
</Project>

README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
> **Announcement!**
66
>
77
> * _Prism.Avalonia v9.0.401-pre just arrived!_
8-
> * _Prism.Avalonia v9.0.271-pre just arrived!_
8+
> * _Support for Avalonia v11.1.x has arrived!_
99
> * Follow the [Upgrading to Prism v9.0.x-pre](https://github.com/AvaloniaCommunity/Prism.Avalonia/wiki/Upgrading-to-Prism-v9.0) guide for breaking changes
1010
1111
**For more samples outside of this repo, check out:**
@@ -21,7 +21,7 @@ With Prism.Avalonia's logic and development approach being **similar** to that o
2121

2222
## Package Releases
2323

24-
Just like Prism.WPF or Prism.Maui, your project must reference both the Prism.Avalonia (_Core_) and Prism.DryIoc.Avalonia (_IoC container_) packages to work.
24+
Just like _Prism.WPF or Prism.Maui_, your project must reference both the **Prism.Avalonia** (_Core_) and **Prism.DryIoc.Avalonia** (_IoC container_) packages to work.
2525

2626
| Package | Stable | Preview
2727
|-|-|-|
@@ -34,9 +34,10 @@ Choose the NuGet package version that matches your Avalonia version.
3434

3535
Our [versioning schema](https://github.com/AvaloniaCommunity/Prism.Avalonia/wiki/Versioning-Schema) is based on the [SemVer](https://semver.org/) using the format `MAJOR.MINOR.PATCH.REVISION`. The `REVISION` segment indicates the Avalonia version support. For instance `v8.1.97.11073` equates to, Prism `v8.1.97`, Avalonia `v11.0.7`, _revision_ `3`.
3636

37-
| Prism Version | Avalonia Version | NuGet Package
37+
| Prism | Avalonia | Prism.Avalonia NuGet Package
3838
|-|-|-
39-
| v9.0.401-pre | **11.0.7** | v9.0.401.11000-pre ([Core](https://www.nuget.org/packages/Prism.Avalonia/9.0.401.11000-pre)) ([DryIoc](https://www.nuget.org/packages/Prism.DryIoc.Avalonia/9.0.401.11000-pre))
39+
| v9.0.401-pre | **11.1.1** | v9.0.401.11110-pre ([Core](https://www.nuget.org/packages/Prism.Avalonia/9.0.401.11110-pre)) ([DryIoc](https://www.nuget.org/packages/Prism.DryIoc.Avalonia/9.0.401.11110-pre))
40+
| v9.0.401-pre | **11.0.7** | v9.0.401.11074-pre ([Core](https://www.nuget.org/packages/Prism.Avalonia/9.0.401.11074-pre)) ([DryIoc](https://www.nuget.org/packages/Prism.DryIoc.Avalonia/9.0.401.11074-pre))
4041
| v9.0.271-pre | **11.0.7** | v9.0.271.11000-pre ([Core](https://www.nuget.org/packages/Prism.Avalonia/9.0.271.11000-pre)) ([DryIoc](https://www.nuget.org/packages/Prism.DryIoc.Avalonia/9.0.271.11000-pre))
4142
| v8.1.97 | **11.0.7** | v8.1.97.11073 ([Core](https://www.nuget.org/packages/Prism.Avalonia/8.1.97.11073)) ([DryIoc](https://www.nuget.org/packages/Prism.DryIoc.Avalonia/8.1.97.11073))
4243
| v8.1.97 | **0.10.21** | v8.1.97.1021 ([Core](https://www.nuget.org/packages/Prism.Avalonia/8.1.97.1021)) ([DryIoc](https://www.nuget.org/packages/Prism.DryIoc.Avalonia/8.1.97.1021))
@@ -62,7 +63,11 @@ Issues posted without a description may be closed immediately. Use the discussio
6263
Add the Prism.Avalonia and its DryIoc packages to your project:
6364

6465
```powershell
65-
# Avalonia v11
66+
# Latest Preview Release
67+
Install-Package Prism.Avalonia -Version 9.0.401.11110-pre
68+
Install-Package Prism.DryIoc.Avalonia -Version 9.0.401.11110-pre
69+
70+
# Avalonia v11 (GA)
6671
Install-Package Prism.Avalonia -Version 8.1.97.11073
6772
Install-Package Prism.DryIoc.Avalonia -Version 8.1.97.11073
6873

Upgrading-Prism.md

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,16 @@ This file documents the upgrade path from Prism v8.1.97 to v9.0-pre support. Soo
1919

2020
Each of the following will be tagged and merged into the branch `Prism-9x` before being merged with `develop` and `master` branches.
2121

22-
**Progress:**
23-
24-
* [/] 9.0.271-pre - Will be tagged and released
25-
* [ ] 9.0.401-pre - Will be tagged and released
26-
2722
### Release Comparison
2823

2924
As we all know, not everything is straight forward between these two XAML technologies. However, it's a good reminder to document the differences and 'got-yas'.
3025

31-
* [Prism v7.2.0.1422 to v8.0.0.1909](https://github.com/PrismLibrary/Prism/compare/v7.2.0.1422...v8.0.0.1909)
32-
* [Prism v7.2.0.1422 to v8.1.97](https://github.com/PrismLibrary/Prism/compare/v7.2.0.1422...v8.1.97)
33-
* [Prism v8.0.0.1909 to v8.1.97](https://github.com/PrismLibrary/Prism/compare/v8.0.0.1909...v8.1.97)
34-
* [DNF - 9.0.264-pre](https://github.com/PrismLibrary/Prism/compare/DNF...9.0.264-pre) - (_DNF = Dot Net Foundation_)
35-
* [9.0.264-pre - 9.0.274-pre](https://github.com/PrismLibrary/Prism/compare/9.0.264-pre...9.0.271-pre)
3626
* [9.0.274-pre - 9.0.401-pre](https://github.com/PrismLibrary/Prism/compare/9.0.271-pre...9.0.401-pre)
27+
* [9.0.264-pre - 9.0.274-pre](https://github.com/PrismLibrary/Prism/compare/9.0.264-pre...9.0.271-pre)
28+
* [DNF - 9.0.264-pre](https://github.com/PrismLibrary/Prism/compare/DNF...9.0.264-pre) - (_DNF = Dot Net Foundation_)
29+
* [Prism v8.0.0.1909 to v8.1.97](https://github.com/PrismLibrary/Prism/compare/v8.0.0.1909...v8.1.97)
30+
* [Prism v7.2.0.1422 to v8.1.97](https://github.com/PrismLibrary/Prism/compare/v7.2.0.1422...v8.1.97)
31+
* [Prism v7.2.0.1422 to v8.0.0.1909](https://github.com/PrismLibrary/Prism/compare/v7.2.0.1422...v8.0.0.1909)
3732

3833
### Changes
3934

@@ -529,7 +524,8 @@ public class ItemMetadata : AvaloniaObject
529524

530525
### Property
531526

532-
Note
527+
Note:
528+
533529
* Avalonia places WPF's `propertyType` as part of `TValue` in `<THost, TValue>`
534530
* The `THost` object type is what is used in the Get and Set methods.
535531

build/Base.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Project DefaultTargets="Build"
33
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
44
<PropertyGroup>
5-
<Version>9.0.401.11074-pre</Version>
5+
<Version>9.0.401.11110-pre</Version>
66
<PackageProjectUrl>https://github.com/AvaloniaCommunity/Prism.Avalonia</PackageProjectUrl>
77
<Copyright>Copyright (c) 2024 Xeno Innovations, Inc.</Copyright>
88
<PackageLicenseExpression>MIT</PackageLicenseExpression>

build/Nuget.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
77
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
88
<PackageReleaseNotes>
9+
* Upgraded to support Avalonia v11.1.1
910
* Upgraded to support Prism v9.0.401-pre
10-
* Upgraded to support Avalonia v11.0.7
11-
* Removed dependency on Avalonia.ReactiveUI
11+
* Fixed ItemsControlRegionAdapter not attaching object due to previous binding (Avalonia v11.x)
1212
</PackageReleaseNotes>
1313
</PropertyGroup>
1414

e2e/DummyModule1/DummyModule1.cs

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,53 @@
1-
// Temp disabled logging:
2-
// - Prism.Logging has been moved and `ILoggerFacade` is deprecated.Prism.Logging.Serilog is out of date.
3-
// - https://github.com/augustoproiete/prism-logging-serilog/issues/3
4-
using System.Threading;
1+
using System.Threading;
52
using DummyModule.View;
63
using ModulesSample.Infrastructure;
74
using Prism.Avalonia.Infrastructure.Events;
85
using Prism.Events;
96
using Prism.Ioc;
10-
////using Prism.Logging;
117
using Prism.Modularity;
128
using Prism.Navigation.Regions;
139

1410
namespace DummyModule
1511
{
1612
public class DummyModule1 : IModule
1713
{
18-
////private readonly ILoggerFacade _logger;
1914
private readonly IModuleTracker _moduleTracker;
15+
2016
private readonly IEventAggregator _eventAggregator;
2117
private readonly IRegionManager _regionManager;
2218

2319
public DummyModule1(IModuleTracker moduleTracker, IEventAggregator eventAggregator, IRegionManager regionManager)
24-
////public DummyModule1(ILoggerFacade logger, IModuleTracker moduleTracker, IEventAggregator eventAggregator, IRegionManager regionManager)
2520
{
26-
////_logger = logger;
2721
_moduleTracker = moduleTracker;
2822
_eventAggregator = eventAggregator;
2923
_regionManager = regionManager;
30-
}
3124

32-
private void DummyEventPublisher()
33-
{
34-
while (true)
35-
{
36-
Thread.Sleep(2500);
37-
_eventAggregator.GetEvent<DummyEvent>().Publish();
38-
}
25+
_moduleTracker.RecordModuleConstructed(ModuleNames.ModuleDummy1);
3926
}
4027

4128
public void RegisterTypes(IContainerRegistry containerRegistry)
4229
{
30+
_moduleTracker.RecordModuleLoaded(ModuleNames.ModuleDummy1);
4331
}
4432

4533
public void OnInitialized(IContainerProvider containerProvider)
4634
{
47-
Thread thread = new Thread(new ThreadStart(DummyEventPublisher));
35+
// Send Event messages for subscribers to react to
36+
Thread thread = new(new ThreadStart(DummyEventPublisher));
4837
thread.Start();
4938

5039
_regionManager.RegisterViewWithRegion(RegionNames.Region1, typeof(DummyModuleView));
5140
_moduleTracker.RecordModuleInitialized(ModuleNames.ModuleDummy1);
5241
}
42+
43+
/// <summary>Publish events to subscribers.</summary>
44+
private void DummyEventPublisher()
45+
{
46+
while (true)
47+
{
48+
Thread.Sleep(500);
49+
_eventAggregator.GetEvent<DummyEvent>().Publish();
50+
}
51+
}
5352
}
5453
}

e2e/DummyModule2/DumyModule2.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,19 @@ public DummyModule2(IModuleTracker moduleTracker, IRegionManager regionManager)
1515
{
1616
_moduleTracker = moduleTracker;
1717
_regionManager = regionManager;
18+
19+
_moduleTracker.RecordModuleConstructed(ModuleNames.ModuleDummy2);
1820
}
1921

2022
public void OnInitialized(IContainerProvider containerProvider)
2123
{
22-
_moduleTracker.RecordModuleInitialized(ModuleNames.ModuleDummy1);
24+
_moduleTracker.RecordModuleInitialized(ModuleNames.ModuleDummy2);
2325
_regionManager.RegisterViewWithRegion(RegionNames.Region2, typeof(DummyModuleView2));
2426
}
2527

2628
public void RegisterTypes(IContainerRegistry containerRegistry)
2729
{
30+
_moduleTracker.RecordModuleLoaded(ModuleNames.ModuleDummy2);
2831
}
2932
}
3033
}
Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
<UserControl xmlns="https://github.com/avaloniaui"
22
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
3-
xmlns:prism="clr-namespace:Prism.Navigation.Regions.Behaviors;assembly=Prism.Avalonia"
3+
xmlns:prism="http://prismlibrary.com/"
4+
xmlns:prismBehaviors="clr-namespace:Prism.Navigation.Regions.Behaviors;assembly=Prism.Avalonia"
45
xmlns:prismRegions="clr-namespace:Prism.Navigation.Regions;assembly=Prism.Avalonia"
5-
x:Class="DummyModule2.View.DummyModuleView2">
6-
<Grid>
7-
<TextBox Name="RegionViewTextBox"
8-
Text="DummyModule2 Region View"
9-
IsReadOnly="True" />
10-
11-
<ItemsControl prismRegions:RegionManager.RegionName="ListRegion"></ItemsControl>
6+
x:Class="DummyModule2.View.DummyModuleView2"
7+
prism:ViewModelLocator.AutoWireViewModel="True">
8+
<Grid RowDefinitions="Auto,150">
9+
<Label Content="DummyModule2 Region View"
10+
FontWeight="Bold"
11+
Name="RegionViewTextBox" />
12+
13+
<ScrollViewer Grid.Row="1">
14+
<ItemsControl prismRegions:RegionManager.RegionName="ListRegion" />
15+
</ScrollViewer>
1216
</Grid>
13-
</UserControl>
17+
</UserControl>

e2e/DummyModule2/Views/DummyModuleView2.axaml.cs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@ namespace DummyModule2.View
1010
public partial class DummyModuleView2 : UserControl
1111
{
1212
private readonly IEventAggregator _eventAggregator;
13-
private TextBox _regionViewTextBox;
13+
private readonly Label _regionViewTextBox;
14+
private int _counter = 0;
1415

1516
public DummyModuleView2()
1617
{
18+
// Placed here so Avalonia viewer doesn't freak out
19+
// Since we're not using an MVVM approach here
1720
}
1821

1922
public DummyModuleView2(IEventAggregator eventAggregator, IRegionManager regionManager)
@@ -22,18 +25,23 @@ public DummyModuleView2(IEventAggregator eventAggregator, IRegionManager regionM
2225

2326
InitializeComponent();
2427

25-
_regionViewTextBox = this.FindControl<TextBox>("RegionViewTextBox");
28+
_regionViewTextBox = this.FindControl<Label>("RegionViewTextBox");
29+
30+
// Note: 'keepSubscriberReferenceAlive' is set to true to avoid the WeakReferene
2631
eventAggregator.GetEvent<DummyEvent>().Subscribe(() =>
2732
{
2833
Dispatcher.UIThread.InvokeAsync(() =>
2934
{
35+
_counter++;
36+
3037
regionManager.AddToRegion(
3138
RegionNames.ListRegion,
32-
new TextBlock { Text = "EventAggregator DummyEvent triggered for DummyModule2" });
39+
new TextBlock { Text = $"EventAggregator DummyEvent triggered for DummyModule2: {_counter}" });
3340

34-
//_regionViewTextBox.Text += "\n EventAggregator DummyEvent triggered for DummyModule2 \r\n";
41+
_regionViewTextBox.Content = $"EventAggregator DummyEvent triggered for DummyModule2: {_counter}";
3542
});
36-
});
43+
},
44+
keepSubscriberReferenceAlive: true);
3745
}
3846
}
3947
}

0 commit comments

Comments
 (0)