Questions tagged [reactiveui]
ReactiveUI is a MVVM framework that integrates with the Reactive Extensions
1,060
questions
0
votes
0
answers
20
views
ReactiveUI.XamForms ViewModel not initialized
I'm trying to bind View elements to a ViewModel, but for some reasons the ViewModel is not initialized when the form loaded. The code is based on the Visual Studio 2022 "Mobile App (Xamarin....
0
votes
2
answers
30
views
Show dialog from ViewModel in ReactiveUI Avalonia (MVVM)
I have Window, inheriting from ReactWindow, and it's connected to its Viewmodel .
Everything is working as expected (binding, clicking stuff, hitting commands). So it's working. (code is below)
When ...
-1
votes
0
answers
53
views
What kind of code is OK to have inside a Subscribe method?
In the context of reactive programming with System.Reactive.
I haven't found a good guide what kind of logic can be included inside Subscribe method. However, I've read that it's not a good idea to ...
0
votes
1
answer
40
views
Data from view model not binding to view - Xamarin Forms, Reactive UI
Welcome, I'm trying to bind array of strings to collection view item source, but it seems like my view model can't pass data, or isn't activated at all. I'm stuck at this moment. I tried to search on ...
0
votes
1
answer
16
views
In ReactiveUI the same code behaves differently depending on how observable is subscribed
The code:
StartOperation = ReactiveCommand.CreateFromObservable(() => Observable.Start(() =>
{
SelectedOperation.State = OperationState.ACTIVE....
1
vote
1
answer
43
views
MaterialDesignInXaml ComboBox - Clear button issue
I'm building WPF application using MaterialDesignInXaml together with ReactiveUI. I have the following XAML code:
<ItemsControl ItemsSource="{Binding Filters}">
<ItemsControl....
0
votes
0
answers
15
views
Reactive Use ValidationRule with SourceList
I'm using ReactiveUI.Validation and SourceList from DynamicData, 2 components designed for Reactive.
I'm trying to validate Source which is a SourceList (instead of an ObservableCollection). The ...
0
votes
1
answer
97
views
Reactive UI / Blazor: Why is a View that inherits from ReactiveInjectableComponentBase<T> rendered twice?
When I inherit a View from ReactiveInjectableComponentBase<T> the body of the View will be "rendered" twice. I noticed this because a @foreach loop was executed twice on activation of ...
0
votes
1
answer
53
views
ObserableCollection not triggering Change when Items are added/removed from list
I have a problem with ReactiveUI ObservableCollection. I am trying to update the UI based on a list that changes in a ReactiveObject, but for some reason my list change is not triggered and I am not ...
2
votes
1
answer
46
views
Update ReadOnlyObservableCollection created with DynamicData based on item's property
I have next class:
public class StateObject
{
public bool IsEnabled { get; set; }
public string Value { get; set; }
}
Later in code I have some source of object of this kind as an Observable, ...
0
votes
1
answer
36
views
ReactiveUI nested Command IsExecuting does not change until window closes
For demonstration, I have a window MainWindow with a button that open a dialog Dialog when clicked. The dialog has a button Hello. When the Hello button is clicked, a command will execute, which wait ...
2
votes
1
answer
134
views
ReactiveUi: How can I replace the default IViewLocator when using AutoFac?
High!
I am trying to replace the default IViewLocator of ReactiveUi/Splat in WPF. I am using AutoFac as container.
My goal is very simple: ReactiveUi/Splat should use my custom implementation of ...
1
vote
1
answer
39
views
Update TextBoxes bound to properties backed by the same local variable
In an App using ReactiveUI, I have two properties backed by the same local variable. Then the properties are used to bind to two textboxes where one showing the value and the other showing the value ...
0
votes
1
answer
161
views
How to connect model and view model property using ReactiveUI
I am using MVVM with ReactiveUI. I have a property in the model that I want to display and be able to edit in the UI. Is there any simple way to do this using ReativeUI? The following properties ...
1
vote
1
answer
188
views
Reactive UI - Tracking Changed Properties
Consider the below code. I'm trying to track the property changed event of the Student object in the view model. The Student class implements the INotifyPropertyChanged interface. The changed property ...
1
vote
1
answer
58
views
ReactiveUI + WPF: ListBox items are displayed with correct view except when inside a custom UserControl
I have some view
public class MyItem : ReactiveUserControl<MyItemViewModel> {...
with some corresponding xaml and the below call sets up the viewmodel to view registration for me
Locator....
0
votes
1
answer
98
views
Async data loading with ReactiveUI and GUI.cs
I'm new to the reactive world so i'm struggling a little bit here x)
Here is my question:
How can i fetch async data, then bind them to a label ?
In my MainView.cs, i have a label:
Label usernameLabel ...
0
votes
1
answer
125
views
Attempting to access ViewModel property on ReactiveUserControl<MyViewModel> - raises Operation is not valid due to the current state of the object
I am attempting to bind a command between a View and associated ViewModel via the code-behind file of the view:
public partial class MyView : ReactiveUserControl<MyViewModel>
{
public MyView(...
0
votes
2
answers
58
views
Why can I use .Select on an observable that is not a list?
The Select extension from System.Reactive.Linq is documented as :
Projects each element of an observable sequence into a new form with the specified source and selector.
This behavior sounds only ...
0
votes
1
answer
42
views
ReactiveUI - how to manage ReactiveCommand exceptions?
I have simple user control with a ViewModel and a ReactiveCommand CheckForUpdates which runs in background and may throw. This command is explicitly executed in ViewModel's WhenActivated method. All I ...
0
votes
2
answers
46
views
Observable.FromAsync what is IScheduler argument for?
I was trying to execute that Reactive + ReactiveUI Code
Observable.FromAsync(async () => //async code that must run on UI Thread, RxApp.MainThreadScheduler);
But that doesn't get executed on ...
0
votes
1
answer
45
views
IActivatableViewModel is activated before the View, so UnhandledInteractionException is thrown in VM activation
I have a ViewModel, that uses an Interaction for each item from a queue that exists independent from both View and ViewModel. Processing is started in this.WhenActivated block, and it relies on ...
0
votes
1
answer
60
views
Use Dynamic Data as WPF's CompositeCollection alternative in AvaloniaUI
I want to use Dynamic Data as WPF's CompositeCollection alternative in an AvaloniaUI project.
Here is some code to expose the issue :
public class MainWindowViewModel : ViewModelBase
{
private ...
0
votes
1
answer
45
views
Reset ReactiveUI ObservableAsPropertyHelper Value
I am building a simple DateTime calculator using a ReactiveUI ReactiveObject viewmodel.
It has a calculate command that calculates a value and correctly updates the result backed by an ...
0
votes
0
answers
44
views
Material Design UX Best Practice: Should a dialog "Accept" button only get enabled upon changes to a model
As far as user-experience goes, particularly when working within the material design language specification, if a save/cancel dialog is presented to the user that is intended to modify a "model&...
0
votes
0
answers
173
views
Issue while using ReactiveUi routing while more than one view points to one view model
I'm having an issue on my windows application (.NET / WPF) with trying to direct 2 of my Views to use the same ViewModel while using ReactiveUI with routing and MVVM. Application did work just fine ...
1
vote
0
answers
55
views
ReactiveUI WPF ApplicationCommands not working
I have a WPF App with ReactiveUI where I use for keyboard shortcuts the following code
In my XAML file
<KeyBinding x:Name="OpenFileKeyBinding" Modifiers="Ctrl" Key="O"&...
0
votes
1
answer
154
views
ReactiveUI/Splat Dependency Registration Pattern
I'm looking at ReactiveUI Dependency Injection and there's something that is bugging me.
Normally I would register classes like this
Locator.Register<IToaster, Toaster>();
With Splat, it asks ...
0
votes
2
answers
96
views
Subscribe only to tail property in a chain of properties
I have a view model which has a property A. Property A is of a type which has a property B. Now I want to subscribe in my view model's constructor to any direct change of property B. By "direct&...
1
vote
1
answer
53
views
Should multiple .WhenAny(...).ToPropertyEx(...) calls overwrite one another?
I have an object with two WhenAnyValues:
this.WhenAnyValue(x => x.SomeInt)
.Select(x => "Bar" + x)
.ToPropertyEx(this, x => x.SomeString);
this.WhenAnyValue(...
0
votes
1
answer
155
views
Avalonia ReactiveUI RoutedViewHost not creating embedding appropriate view
I was following this tutorial, which I do see is based on the .net core 2.1 framework, but adapted for the .net 5 avalonia.mvvm template. I followed the code line for line with the exception of the ...
0
votes
1
answer
46
views
What is the best approach to create a Visual Studio-like Start Window using ReactiveUI?
I want to make a Start / Welcome / Solution selection window which has similar functionalities to the one used in VS19 / VS22, but I'm not sure how to do it exactly.
For more context, my current ...
0
votes
1
answer
339
views
Avalonia notification causes the application to crash
I'm testing Avalonia notifications (C#, Windows 10, Visual Studio Community 2019). The following code crashes whenever I push the button and change the property 'Greeting'.
I suppose the problem is ...
3
votes
1
answer
163
views
ReactiveUI ViewModel memory leak
I am having really weird issues with memory leak and I cannot find source after long hours of testing, debugging and trial/error attempts.
The source of memory leak is reloading object base on push ...
0
votes
1
answer
135
views
WPF ReactiveUI binding Listbox.ItemsSource to ReadOnlyObservableCollection not working
In my WPF+ReactiveUI+DynamicData project I can't make binding of ListBox.ItemsSource to ReadOnlyObservableCollection working.
I successfully populate data from by backend service to my ViewModel
...
0
votes
1
answer
214
views
ReactiveUI Fody [Reactive] attribute not working in Xamarin Forms
I've tried following the documentation for ReactiveUI.Fody.
https://github.com/kswoll/ReactiveUI.Fody
Added the FodyWeavers.xml the generated file to the shared project.
<Weavers xmlns:xsi="...
0
votes
0
answers
130
views
Akavache throwing System.MissingMethodException: Only when Xamarin.Forms Android app is built on VS2022
I have an app made with Xamarin Forms, that uses Akavache to cache data.
The app works well on iOS and Android in debug mode when I make a build with VS2019
But when I installed VS2022 and decided to ...
2
votes
1
answer
93
views
Proper way to bind and validate non-string values in ReactiveUI?
We are confused about how we should bind and validate int and other non-string properties in ReactiveUI. When we do this, we get unhandled exceptions and cases where invalid values do not prevent the ...
0
votes
0
answers
55
views
How to get coordinates of each item in ItemsControl with UniformGrid panel relative to main window in WPF
Here is the sample code for displaying some collection of FrameworkElement within ItemsControl in WPF view.
TargetControlView.xaml
<Grid>
<ItemsControl x:Name="AvailableShapes"&...
0
votes
0
answers
61
views
how to use ReactiveUI.Events.Winforms?
recentyly im want to use ReactiveUI.
but the official's samples was too rudimentary.
there's no any code about ReactiveUI.Fody and ReactiveUI.Events.Winforms.
I found the doc for ReactiveUI.Fody.
But ...
0
votes
0
answers
46
views
WPF ReactiveUI Consuming Async Method
I am trying to find the appropriate solution in ReactiveUI for the following view-model.
private A _selectedA;
private DateTime _startDateTime;
private DateTime _endDateTime;
public ...
0
votes
2
answers
101
views
How to implement IViewFor<T> in addition to inheriting from ReactiveUserControl<T>?
Is it possible to implement IViewFor<MainViewModel> in addition to inheriting from ReactiveUserControl<Job>?
My attempt leads to an error
InvalidCastException 'Unable to cast object of ...
0
votes
1
answer
176
views
Copy Clone with mvvm
I need to create a wpf application with 2 buttons in a homework. one of the buttons is "copy" and the other is "clone". When i press the copy button, it should copy the information ...
0
votes
0
answers
37
views
ReactiveUI.NET - Using Interaction<T, Unit> from ViewModel to Inform User of Ongoing Work
I'm currently developing a ReactiveUI MVVM .Net (WinForms, but that doesn't necessarily matter) application and am leveraging ReactiveUI.net to reap all the benefits of properly separated concerns ...
0
votes
1
answer
58
views
Rx .NET skip value changes by some scenario
I'm having trouble implementing a certain scenario with Rx. I have some code:
enum Status { NotConnected, Connecting, Connected }
class Provider
{
public Status State { get => m_state; set =&...
0
votes
1
answer
108
views
Why cannot a Reactive object in reactiveUI be serilized in Newtonsoft.Json
When I tried to serialize a ReactiveObject from ReactiveUI, I found out that it is serialized to null data in the JSON text.
public string Get()
{
return JsonConvert.SerializeObject(Value,...
0
votes
1
answer
87
views
Reactiveui, Conflict between System.Reactive and System.Reactive.Core
I am using reactiveui 10.5.7 in my wpf project .net framework 4.6.1.
i am trying to use the reactiveui.validation 2.1.1 package, but after i installed the package i get a TypeLoadException that the ...
0
votes
1
answer
133
views
ReactiveUI MVVM update property from event handler
Im building a small MVVM application using the DDD principles.
In my ViewModel I have to update some properties whenever an event is fired.
Although my ViewModel updates the properties, these changes ...
-1
votes
2
answers
253
views
How to use multiple commands with parameters in a WPF UserControl using ReactiveUI
I want to create a simple wpf user control which has 2 commands, each with a single CommandParameter which is set by a DependencyProperty in the XAML.
However the value of the property bound to the ...
1
vote
1
answer
89
views
Is there any way to create a "push" IObservable?
ReactiveUI has a bunch of different ways to create IObservables from existing sources, such as another IObservable, an IEnumerable, an event, etc, but as near as I can tell it doesn't have any way to ...