reactiveui

RX: 'ObservableAsProperty' bound properties are not automatically updated on gui

余生长醉 提交于 2020-01-16 14:34:03
问题 I have a Client MyClient which provides new stati via an IObservable . As described in the documentation (https://reactiveui.net/docs/handbook/view-models/boilerplate-code) I made a private property of type ObservableAsProperty to get the output of my IObservable . But know my GUI is not updated automatically on changes. public partial class MainWindow : ReactiveWindow<AppViewModel> { public MainWindow() { InitializeComponent(); ViewModel = App.Container.GetInstance<AppViewModel>(); this

How to Bind data to a Custom ListView with Xamarin Android with Reactive UI

风流意气都作罢 提交于 2020-01-14 02:16:25
问题 I am using Xamarin Android with Reactive UI and Not using Xamarin Forms. I have a Custom ListView(I have defined it's layout as xaml). I have no idea how to bind this control into a observableCollection in ViewModel using OneWayBind method in the activity class. I wrote it as, this.OneWayBind(ViewModel, x => x.OutletListing, x => x.List).DisposeWith(SubscriptionDisposables); But gives, System.ArgumentException: Can't convert System.Collections.ObjectModel.ObservableCollection1 to Android

Should I always dispose subscriptions of observables?

我的梦境 提交于 2020-01-06 06:01:07
问题 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 = new ReactiveList<string>(); MyList.ChangeTrackingEnabled = true; //Do I have to dispose/unsubscribe this? MyList.ItemChanged.Subscribe(_ => ...); //Or this? this.WhenAnyValue(x => x.MyList).Subscribe(_ => ...); } ReactiveList<string> _myList; public ReactiveList

Meteor template not updating using click event

旧城冷巷雨未停 提交于 2020-01-04 11:57:05
问题 I'm trying to make a reactive menu using meteor session (to persist the view the user was).. but it is not working, the Session.get('currentView') get changed (teste in chrome console), but the page don't render again. .html <div class="col-1-1 menu" style="height: 42px;"> <ul> <li><a class="dashButton" href="#"># Dashboard</a></li> <li><a class="myJobsButton"href="#">Jobs</a></li> <li><a class="helpPageButton"href="#">Help</a></li> </ul> <br style="clear:left"/> </div> {{#if currentViewIs

How to catch exception from ReactiveCommand?

老子叫甜甜 提交于 2020-01-04 07:43:13
问题 I know how to handle exceptions thrown by async tasks called by ReactiveCommand<T> but how do I handle an exception that is thrown before the task is returned? In the following example ThrowAndHandle command will throw an exception from the async task when executed and the exception will be handled. The command ThrowButFailToHandle demonstrates that I can not use ThrownExceptions to handle an exception that does not occurr "in" the task but rather before the task is created. How can such an

How to catch exception from ReactiveCommand?

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-04 07:43:06
问题 I know how to handle exceptions thrown by async tasks called by ReactiveCommand<T> but how do I handle an exception that is thrown before the task is returned? In the following example ThrowAndHandle command will throw an exception from the async task when executed and the exception will be handled. The command ThrowButFailToHandle demonstrates that I can not use ThrownExceptions to handle an exception that does not occurr "in" the task but rather before the task is created. How can such an

How to use ReactiveList so UI is updated when new items are added

你。 提交于 2020-01-02 12:17:11
问题 I'm creating a Xamarin.Forms application with a list. The itemSource is a reactiveList. Adding new items to the list however does not update the UI. What is the correct way of doing this? List Definition _listView = new ListView(); var cell = new DataTemplate(typeof(TextCell)); cell.SetBinding(TextCell.TextProperty, "name"); cell.SetBinding(TextCell.DetailProperty, "location"); _listView.ItemTemplate = cell; Binding this.OneWayBind(ViewModel, x => x.monkeys, x => x._listView.ItemsSource);

Having trouble mapping highcharter aesthetics to reactive object elements

半腔热情 提交于 2019-12-25 09:08:56
问题 I have a large shiny app that allows users to filter through an API and spark table aggregate (dumped to an .Rdata) simultaneously using the same set of initially selectized parameters. Fitting all this into a reproducible example is going to be tough, but, this is the function that is grouping and summming my metric of interest (try to resist asking me to paste in partitionFiltered() ): df <- reactive({partitionFiltered() %>% dplyr::group_by(updatedTimeHour, direction) %>% dplyr::mutate

ReactiveUI 7.0 how to handle with observables that are disposed when exception is thrown

自闭症网瘾萝莉.ら 提交于 2019-12-25 08:37:50
问题 I'm really starting to dig this rx thing... Basically, I am following along with this video just to teach myself more about ReactiveUI before I start using it for real! I am trying to create a situation when we use WhenAnyValue to perform a throttled search-as-you-type. And, if the search function throws an exception, I want to set a property on the view model called IsError (so I can show an X or something). This the important parts of the ViewModel I have working: public ReactiveCommand

ReactiveCommand CanExecute reacting to changes in a collection

本小妞迷上赌 提交于 2019-12-25 04:45:23
问题 I have a ReactiveCollection filled with Items (that are ReactiveObjects as well). I want to create a ReactiveCommand that should be enabled only when any of the items in the collection has some property set to true, something like: MyCommand = ReactiveCommand.Create( watch items in collection to see if item.MyProp == true ) So anytime there is one of the items with the property set to true, the command should be enabled. EDIT: Thanks, Paul. The resulting code is this: public MainViewModel() {