Comments (7)
We've resolved this issue by copying the RoutedViewHost
source code and adding the following inside the WhenActivated
block
this.WhenActivated(disposables =>
{
....
Disposable.Create(() =>
{
Content = null;
})
.DisposeWith(disposables);
});
This resolves the root cause of the issue. The problem is that once the view is reactivated, the same content is recreated through view location. However, that view is already attached to the parent. This means whenever the routed view host deactivates, we also need to clear its content. Otherwise, we are risking double-attaching the same view and causing this exception.
from reactiveui.
Probably worth raising this up with the Avalonia team. See if you can get the fix in.
from reactiveui.
@glennawatson you are actually right. I've extended the sample I've attached to this bug report. And instead of using RoutedViewHost
when using bare TransitioningContentControl
through assigning the Content
property the same issue occurs. I will raise this Avalonia.
from reactiveui.
Closing this issue for the time being, for 2 reasons
- There's a workaround
- Most probably this should be fixed inside the
TransitioningContentControl
and not theRoutedViewHost
. For that, an issue is opened inside the Avalonia repo
from reactiveui.
Worth noting that AvaloniaUI own both the RoutedViewHost and the TransitioningContentControl
https://github.com/AvaloniaUI/Avalonia/blob/master/src/Avalonia.ReactiveUI/RoutedViewHost.cs
So bugs with that system aren't necessarily related directly with ReactiveUI.
from reactiveui.
@glennawatson thanks for the info, I actually didn't realize that. And the good news is the issue is already fixed in the latest CI beta release.
from reactiveui.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
from reactiveui.
Related Issues (20)
- [Bug]: ReactiveUI incompatible with .NET Assembly Load Contexts HOT 2
- [Bug]: On Maui initial NavigateAndReset pushes the same screen twice HOT 8
- Make generic IViewFor<TViewModel> implementation optional in favor of non-generic IViewFor HOT 15
- Add overloads for the command binders that accept IViewFor HOT 1
- [Bug]: got imcompatible message when using with .net 7 HOT 2
- [Bug]: Visual Studio hot reload broken HOT 21
- [Bug]: `ObservableAsPropertyHelper` emits property changed for lazy initial value after first-time reading and doesn't respect `DistinctUntilChanged` HOT 1
- [Bug]: WPF ReactiveCommand stays disabled after first execution HOT 9
- [Bug]: Mark ReactiveObject IObservable properties with DisplayAttribute for Winforms HOT 9
- ReactiveUI.WPF does not include .net 8.0 as a target: HOT 3
- [Bug]: Unable to use activation of views on Windows with MAUI HOT 2
- ViewModelViewHost: Better to Allow Developers Bypass the Default Fallback Behavior That Resovles View With No Contract HOT 2
- [Bug]: WireUpControls throws exception in net8.0-android HOT 8
- [Bug]: ViewModelViewHost does not set DataContext in WPF HOT 2
- [Bug]: WPF targeting issue for net6.0-windows HOT 4
- Dependency Dashboard
- [Bug]: iOS threading exception on command execution. HOT 4
- Bounce transition duration support HOT 3
- [Bug]: WinUI/WAS - ReactiveUI.WinUi nuget attempts to load the ReactiveUI.XamForms assembly when WhenActivated is called on a IActivatableViewModel HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from reactiveui.