reactiveui

How to use ReactiveUI inside a PRISM module

ぐ巨炮叔叔 提交于 2019-12-04 19:57:47
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 within our main application regardless of what I have tried. The only article that I have really found was

How can I bind a command to a local event?

夙愿已清 提交于 2019-12-04 14:52:12
I have a form that should capture KeyDown/KeyUp events. This code fails with NRE, because it looks for KeyDown control on my current view: this.BindCommand(ViewModel, vm => vm.KeyDown, "KeyDown"); What I've done is created wrapper class that has form as a property, so I can use this overload: this.BindCommand(ViewModel, vm => vm.KeyDown, v => v.Form, "KeyDown"); While it works, it seems like a hack to me. Is there a proper way to bind to local events? That's the right way to do it if you're using BindCommand. If you want to get rid of the string and you're using ReactiveUI.Events, you could

ContentControl not updating

好久不见. 提交于 2019-12-04 12:55:30
问题 I'm trying to have a MainWindow that is bound to the a view. I change that view in code and expect it to update in the Main Window, however that is not happening. I have this code in my XAML <Grid> <ContentControl Content="{Binding Source={StaticResource ViewModelLocator}, Path=MainWindowViewModel.CurrentControl}" /> </Grid> I then change my Control via this code public class MainWindowViewModel : ReactiveObject { private UserControl _CurrentControl = null; public UserControl CurrentControl {

ReactiveUI - View Locator performance

感情迁移 提交于 2019-12-04 09:39:26
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 to this view-model, there is a noticable delay between pressing the "go-to-view-model" button and the

ReactiveUI 6 Async Command Not Running on Background Thread in WPF app

对着背影说爱祢 提交于 2019-12-04 01:36:41
问题 ViewModel public class MyViewModel:ReactiveObject, IRoutableViewModel{ private ReactiveList<string> _appExtensions; public MyViewModel(IScreen screen){ HostScreen = screen; AppExtensions = new ReactiveList<string>(); GetApplicationExtensions = ReactiveCommand.CreateAsyncTask(x => _schemaService.GetApplicationExtensions()); // returns a Task<IEnumerable<string>> GetApplicationExtensions .ObserveOn(RxApp.MainThreadScheduler) .SubscribeOn(RxApp.TaskpoolScheduler) .Subscribe(p => { using (

Does ReactiveUI RaiseAndSetIfChanged fire for List<T> Add, Delete, Modify?

北城以北 提交于 2019-12-03 21:55:39
Will this fire private List<TweetTileViewModel> _TweetTiles; public List<TweetTileViewModel> TweetTiles { get { return _TweetTiles; } set { this.RaiseAndSetIfChanged(ref _TweetTiles, value); } } When I do: TweetTiles.Add(new TweetTileViewModel(...)); or TweetTiles.Remove(new TweetTileViewModel(...)); etc. I suspect not, but am not sure how I should get this behavior. I have a function, running on a background Task, that is returning tweets. Each time I get a new tweet I convert it to a TweetTileViewModel and want it to show in my UI listbox. Will this fire? Nope, this will only fire when you

ReactiveUI, View/ViewModel injection and DI in general

为君一笑 提交于 2019-12-03 18:28:26
问题 Lately I've trying to get myself into the new age of UI development and discovered ReactiveUI. I love its declarative nature. I wanted to make a complete switch, so I tried to understand how are things made in this new world of ReactiveUI. I choose ReactiveUI because I've seen that is maintained by a very clever guy (Paul C. Betts). I'm very new to it and I will likely be flooding StackOverflow with questions about it because I has a huge power and I think it deserves to be learnt and

ReactiveUI (RxUI) vs Reactive Extensions

我怕爱的太早我们不能终老 提交于 2019-12-03 08:52:01
问题 From http://docs.reactiveui.net/en/index.html : ReactiveUI is a MVVM framework that allows you to use the Reactive Extensions for .NET to create elegant, testable User Interfaces that run on any mobile or desktop platform. Is RxUI somehow differs from Reactive Extensions? Why should I prefer RxUI over MVVMCross/light+Rx? What so special? Can RxUI do something that Rx can't? Is it more concise? Is it more cozy? I saw example on github page https://github.com/reactiveui/ReactiveUI#a-compelling

Creating a ReactiveUI derived collection with more elements than the original

流过昼夜 提交于 2019-12-03 07:28:35
问题 Is it possible to create a ReactiveUI derived collection that has more elements in it than the original? I've seen that there is a way of filtering a collection, and selecting single properties, but what I'm looking for is the equivalent of the SelectMany operation for enumerables. To illustrate, imagine trying to get a derived collection representing every passenger stuck in a traffic jam. class Car { ReactiveCollection<Passenger> Passengers; } var TrafficJam=new ReactiveCollection<Car>();

ReactiveUI and Caliburn Micro together?

戏子无情 提交于 2019-12-02 16:38:42
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 if it might be more trouble than it's worth to try and make them work together. Some of the things we