reactiveui

ReactiveUI and Validation

不羁岁月 提交于 2019-12-23 03:11:13
问题 What's considered "best practice" when performing data validation while using ReactiveUI ? Let's say I have a view model that looks like this: public class MyViewModel: ReactiveObject { public ReactiveAsyncCommand SaveMyDataCommand { get; protected set; } private string _email; public string Email { get { return _email; } set { _email = value; raisePropertyChanged("Email"); } } private string _name; public string Name { get { return _name; } set { _name= value; raisePropertyChanged("Name"); }

How to setup a ViewModel binding for a TextBox with ReactiveUI?

非 Y 不嫁゛ 提交于 2019-12-23 01:54:55
问题 For some reason I can't get my textbox/property binding to work "automatically" with Reactive UI. My DataContext is setup like this: My ViewModel is setup in the code behind for the MainWindow.xaml.cs: public MainWindowViewModel ViewModel { get; protected set; } public MainWindow() { ViewModel = new MainWindowViewModel(); } In my WPF MainWindow.xaml I have the DataContext and the have a textbox element like this: (Other properties ommitted) <Window x:Name="Window"> <Grid DataContext="{Binding

How to use ReactiveUI inside a PRISM module

烂漫一生 提交于 2019-12-22 00:27:51
问题 We have an existing WPF application that uses PRISM (6.x) with Unity (3.5.x) for DI. We are going to be adding more functionality to this application and would like to start utilizing ReactiveUI for any new modules that we need to implement. We were hoping to minimize the learning curve and continue to utilize Unity and DI for our ViewModels; however, ReactiveUI uses Splat for View location and so far I have not been able to get my ReactiveUI module to actually display in a PRISM region

ReactiveUI - View Locator performance

余生颓废 提交于 2019-12-21 17:30:18
问题 In my WPF application which makes use of ReactiveUI , I've noticed an area of poor performance. I have a view-model which contains a lot of other lightweight view-models (think 30ish). These nested view-models are simple, usually representing a button each. They're all displayed within a user control, inside an ItemsControl which is wired using ReactiveUI's OneWayBind . This means that each item is displayed using ViewModelViewHost. So, the problem On my powerful desktop PC, when I navigate

ReactiveUI and Caliburn Micro together?

て烟熏妆下的殇ゞ 提交于 2019-12-20 08:11:21
问题 I've been doing some prototype work on a new Silverlight application using Caliburn Micro as our MVVM Framework. The team has generally been happy with it. In order to address some issues with throttling requests to services, it was suggested that I look into ReactiveUI's ReactiveCollections and their implementation of INotifyPropertyChanged. Does anyone have any experience around using the two together? Since they are both primarily MVVM Frameworks, there's a good bit of overlap, so I wonder

ReactiveUI and Caliburn Micro together?

旧巷老猫 提交于 2019-12-20 08:11:20
问题 I've been doing some prototype work on a new Silverlight application using Caliburn Micro as our MVVM Framework. The team has generally been happy with it. In order to address some issues with throttling requests to services, it was suggested that I look into ReactiveUI's ReactiveCollections and their implementation of INotifyPropertyChanged. Does anyone have any experience around using the two together? Since they are both primarily MVVM Frameworks, there's a good bit of overlap, so I wonder

Buffer data from database cursor while keeping UI responsive

核能气质少年 提交于 2019-12-20 03:53:20
问题 I have a database catalog that is populated, and a cursor that can be used to retrieve objects. This catalog can obviously be very large, and what I'd like to do is use ReactiveUI to buffer the data in, while keeping the UI data-bound and responsive. I followed the steps here to translate my IEnumerable into an IObservable , as shown here: public class CatalogService { ... public IObservable<DbObject> DataSource { get { return Observable.Create<DbObject>(obs => { var cursor = Database

ReactiveUI How to use WhenAnyObservable properly

北慕城南 提交于 2019-12-19 06:21:17
问题 I am attempting to use WhenAnyObservable for the first time. When a ReactiveList Count == 0 and a tipText length is > 0 then I want to set a local value to true in the subscribe, or the opposite. this.ViewModel.WhenAnyObservable( x => x.AutoCompleteItems.CountChanged, x => x.ObservableForProperty(y => y.TipText), (countChanged, tipText) => countChanged == 0 && tipText.Length > 0); I am having trouble getting this to work. Is there any trick I should be doing, or should I be using one of the

ReactiveUI exception handling

纵饮孤独 提交于 2019-12-18 10:29:43
问题 I've looked around at a number of the ReactiveUI samples, but I can't see a good simple example of how to handle exceptions, where a message should be displayed to the user. (If there is a good example can somebody point me to it?). My first question is how to handle an exception with ReactiveCommand and ToProperty. For example, I have the following code: public class MainWindowViewModel : ReactiveObject { public ReactiveCommand CalculateTheAnswer { get; set; } public MainWindowViewModel() {

Invoking source property update on a non-UI thread in two-way data binding

送分小仙女□ 提交于 2019-12-13 21:28:29
问题 Suppose I have a WPF two-way data binding between a source (CLR property) and a destination (UI control property). Now anytime the destination property is updated, I want to update the source property on a non-UI thread (not on Dispatcher thread). In my application, I am using Rx (Reactive Extension) Scheduler, thus, I plan to provide one Rx scheduler for the execution. As an example, if I bind the property Value of the following object and the UI updates the property using the binding, I