Closed rmhw closed 7 months ago
I've worked around this by implementing a callback approach based on https://github.com/DamianSuess/Learn.PrismAvaloniaOutlookish/blob/f6234acf7596e3e2c8dfa0ec72b2ed35c4295cda/source/SampleApp.Common/TabControlAdapter.cs, which seems to be working at first glance.
@rmhw, from your implementation, could you provide an example for the Prism.Avalonia community? PR contributions are welcomed 👍
@DamianSuess Thanks for coming back to me. Sure, happy to make a PR - are there any contributor guidelines I should be aware of?
If you can add it to the Samples\SampleMvvmApp
that would be great!
In upcoming releases (+9.x), I'd like to bring more behavior
helpers as part of the main project. The reason this wasn't done sooner was due to concerns about having to support edge cases in other people's software.
Looking forward to your PR contribution, this will help teach others and be a nice asset to the project.
Thank you @rmhw
I ran into this problem just today using Prism.Avalonia 8.1.97.11000, any idea when the Release packages will be updated with the fixed ItemsControlRegionAdapter? Thank you all for your hard work on this great package!
Edit: I suppose their is really no hurry, it finally occurred to me that I just needed to remove the call to base.ConfigureRegionAdapterMappings so that I could successfully register the ItemsControlRegionAdapter from the sample! So far, so good! Thanks again!
Description
Registered views don't display in an ItemsControl region
Environment
Severity (1-5)
3
Steps To Reproduce
<ItemsControl prism:RegionManager.RegionName="TestRegion" />
regionManager.RegisterViewWithRegion("TestRegion", typeof(TestView1));
regionManager.RegisterViewWithRegion("TestRegion", typeof(TestView2));`Expected Behavior
TestView1 and TestView2 should be displayed in the ItemsControl.
Additional context
Having stepped through the code, the issue seems to come from ItemsControlRegionAdapter, where the following line sets ItemsSource to null.
regionTarget.ItemsSource = region.Views as Avalonia.Collections.AvaloniaList<object>;