Questions tagged [reactiveui]

ReactiveUI is a MVVM framework that integrates with the Reactive Extensions

ReactiveUI is a framework for the .Net platform built on top of for any mobile or desktop platform.

Supports , , , , , and .

1093 questions
3
votes
1 answer

Data from api to ObservableCache with DynamicData with periodically update

For example I have api to get list of Items: Task> GetItemsAsync(); I want to work with Items with ObservableCache. So, I created IItemsService: IObservableCache Items { get; } with an…
3
votes
1 answer

What is the purpose of ReactiveUI's IViewFor (and its implementing types) in WPF?

I am in the process of learning ReactiveUI and so far I love it but I now realise that the framework encompasses XAML (i.e. the view layer) as well, offering things like ReactiveUserControl and ReactiveView. Why do I need, or want these?…
bokibeg
  • 2,081
  • 16
  • 23
3
votes
1 answer

How to determine "canExecute" from the CommandParameter with ReactiveUI?

I can create a command like this which checks for some property of my view model if it can execute: AddNewSectionCommand = ReactiveCommand .CreateFromTask(() => AddNewSectionAsync(NewSectionTitle), this.WhenAny(x =>…
rabejens
  • 7,594
  • 11
  • 56
  • 104
3
votes
0 answers

Get rid of Xamarin's "...you may need to supply runtime policy" warning

In my Xamarin Mac project, I am seeing the following warning multiple times. I tried clearing the nuget cache, but it did not help me. Why is it shown and what is required to get it fixed?
Anoop Vaidya
  • 46,283
  • 15
  • 111
  • 140
3
votes
0 answers

ReactiveRecyclerViewAdapter not reacting to changes

I'm trying to use ReactiveRecyclerViewAdapter to update my RecyclerView based on the SourceList on my ViewModel, but there's not much documentation around this, but I should not be the only person struggling with this. ViewModel: public class…
3
votes
2 answers

ReactiveUI sync ReactiveCommand invocation cause System.InvalidOperationException

I try to bind simple synchronous command with ReactiveUI. public ICommand ClickCommand { get; set; } public bool IsClicked; public MainViewModel() { ClickCommand = ReactiveCommand.Create(OnClick); } private void OnClick() { //just example…
Gotcha
  • 45
  • 1
  • 4
3
votes
1 answer

How exactly do I show a view using reactiveui?

In my WPF application I need to get View based on MyViewModel and show it using ReactiveUI and can't figure out how to do it. So long all got is this lines: Locator.CurrentMutable.Register(() => new MyView(), typeof(IViewFor)); …
InfernumDeus
  • 1,185
  • 1
  • 11
  • 33
3
votes
1 answer

Deserializing object that inherits from ReactiveObject from Json does not work

I am trying to deserialize some json into some simple objects that inherit from Reactive UI's ReactiveObject class. For some reason the properties will never get filled there. Using a POCO instead works without any problems. class Program { …
metacircle
  • 2,438
  • 4
  • 25
  • 39
3
votes
3 answers

Should I always dispose subscriptions of observables?

Should I always dispose observables when the ViewModel automatically goes out of scope and no reference to other classes is maintained? A little example: public class TestViewModel : ReactiveObject { public TestViewModel() { MyList =…
senz
  • 879
  • 10
  • 25
3
votes
0 answers

Binding to ReactiveUserControl.ViewModel does not set the ViewModel

I created ReactiveUserControl. It works well with ViewModelViewHost and so on. I figured that I could use it on it's own in XAML like this: but it does not work -…
Krzysztof Skowronek
  • 2,796
  • 1
  • 13
  • 29
3
votes
1 answer

ReactiveUI Xamarin iOS routing

I started experimenting with Reactive UI in Xamarin iOS and i'm confused to how I should handle routing. Let's take the typical 'LoginViewModel' which has something like: public class LoginViewModel : ReactiveObject { private readonly…
RVandersteen
  • 2,067
  • 2
  • 25
  • 46
3
votes
0 answers

How to create a range of Observable and complete when condition is true

The below code will run for all sequences, I want the Observable to stop raising events after the condition is true. private IObservable EnsureIndexWithCounter(string index) { return Observable.Range(0, 5) …
George Taskos
  • 8,324
  • 18
  • 82
  • 147
3
votes
2 answers

Prevent double click using ReactiveUI

I'm struggling to prevent double click on a button using ReactiveUI with Xamarin Forms. Let's say we have a command like this: NextCommand = ReactiveCommand.CreateFromTask(async () => await HostScreen.Router.NavigateAndReset.Execute(new…
3
votes
2 answers

How to use Reactive UI to trigger a different action following a button click vs button press (hold)

I'm trying to implement a UI control where the user can click a button to have a thing move by a little, or hold the button down and have the thing move while the button is held down. Let's say I have Task StartMove(), Task StopMove()…
gakera
  • 3,589
  • 4
  • 30
  • 36
3
votes
2 answers

Controlling (start/stop) IObservable through ToggleSwitch using ReactiveUI

I am trying to hook a stream (IObservable) to be controlled through ToggleSwitch in a UWP project. The expectation is that I start the streaming when the switch is in On state and stop when it is in Off state. So the thought is to 1. Create two…
resp78
  • 1,414
  • 16
  • 37