You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the constructor of my view model I have primitive types and complex types, when I use this.WhenAnyValue with a primitive type, the subscribe method works as expected, notification fire. However if I attempt to us this.WhenAnyValue with a complex type, it doesn’t appear to work.
In the code below, the SelectedElement is a complex type where one of its properties is SourceEventDomainModelModelGuid of type Guid
SelectedSourceProduct is of Type Guid
// This does not work when binding to a complex type
this.WhenAnyValue(x => x.SelectedElement)
.Skip(1)
.ObserveOn(RxApp.MainThreadScheduler)
.Select(productModelGuid => productModelGuid.SourceEventDomainModelModelGuid)
.WhereNotNull()
.Where(x => x != Guid.Empty)
.Subscribe(async x => await LoadServices(x),
ex => toastNotificationService.AddNotification(
new ToastNotificationItem($"Selected Element {ex.Message}", ToastNotificationSeverity.Error)));
// This works when binding to primitive types.
this.WhenAnyValue(x => x.SelectedSourceProduct)
.Skip(1)
.WhereNotNull()
.ObserveOn(RxApp.MainThreadScheduler)
.Where(x => x != Guid.Empty)
.Subscribe(async x => await LoadServices(x),
ex => toastNotificationService.AddNotification(
new ToastNotificationItem(ex.Message, ToastNotificationSeverity.Error)));
What am I missing? Why can't I get a reaction when a property of the Selected Element changes?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello all,
I am building a Blazor WASM application.
In the constructor of my view model I have primitive types and complex types, when I use
this.WhenAnyValue
with a primitive type, the subscribe method works as expected, notification fire. However if I attempt to usthis.WhenAnyValue
with a complex type, it doesn’t appear to work.In the code below, the SelectedElement is a complex type where one of its properties is SourceEventDomainModelModelGuid of type Guid
SelectedSourceProduct is of Type Guid
What am I missing? Why can't I get a reaction when a property of the Selected Element changes?
Beta Was this translation helpful? Give feedback.
All reactions