reactiveui

Process lots of small tasks and keep the UI responsive

这一生的挚爱 提交于 2019-12-02 13:57:57
问题 I have a WPF application that needs to do some processing of many small tasks. These small tasks are all generated at the same time and added to the Dispatcher Queue with a priority of Normal. At the same time a busy indicator is being displayed. The result is that the busy indicator actually freezes despite the work being broken into tasks. I tried changing the priority of these tasks to be Background to see if that fixed it, but still the busy indicator froze. I subscribed to the Dispatcher

Binding ReactiveList to ComboBox couldn't find view error

走远了吗. 提交于 2019-12-02 11:22:45
问题 I am binding a ReactiveList to a ComboBox in the view code-behind and get the error System.Exception: 'Couldn't find view for 'Value1'.' . ViewModel.cs public class SourceItem { public override string ToString() { return Name; } public string Name { get; set; } } public class ViewModel : ReactiveObject { public ReactiveList<SourceItem> SourceList { get; } = new ReactiveList<SourceItem>(); public SourceItem SelectedSourceItem { get; set; } public ViewModel() { SourceList.Add(new SourceItem()

Rx how to combine command with another observable

点点圈 提交于 2019-12-02 11:06:13
问题 I've got a number of reactive commands as well as some observables holding some information, and I'm trying to do something like: _navigate = ReactiveCommand.Create(CanNavigate); _navigate.CombineLatest(navigationTarget, (_, tgt) => tgt) .Subscribe(tgt => Navigation.NavigateTo(tgt)); I've tried a couple of different approaches: SelectMany Zip I either end up with: Subscribe stops invoking after the first time (if I use Zip) Subscribe invokes even when the command hasn't been executed after it

ReactiveUI 6.0 and WinForms binding

安稳与你 提交于 2019-12-02 06:52:35
问题 Now that ReactiveUI 6.0 has been released, I have a question to the commuity: what is the best or most efficient way to bind ReactiveObject(s) and Windows Form(s). Here is what I have so far: My Model namespace WindowsFormsApplication1 { #region using System; using System.Reactive.Linq; using ReactiveUI; #endregion public class ClockModel : ReactiveObject { #region Fields private DateTime currentDateTime; #endregion #region Constructors and Destructors public ClockModel() { Observable

Process lots of small tasks and keep the UI responsive

点点圈 提交于 2019-12-02 05:15:11
I have a WPF application that needs to do some processing of many small tasks. These small tasks are all generated at the same time and added to the Dispatcher Queue with a priority of Normal. At the same time a busy indicator is being displayed. The result is that the busy indicator actually freezes despite the work being broken into tasks. I tried changing the priority of these tasks to be Background to see if that fixed it, but still the busy indicator froze. I subscribed to the Dispatcher.Hooks.OperationStarted event to see if any render jobs occurred while my tasks were processing but

Rx how to combine command with another observable

人走茶凉 提交于 2019-12-02 04:57:20
I've got a number of reactive commands as well as some observables holding some information, and I'm trying to do something like: _navigate = ReactiveCommand.Create(CanNavigate); _navigate.CombineLatest(navigationTarget, (_, tgt) => tgt) .Subscribe(tgt => Navigation.NavigateTo(tgt)); I've tried a couple of different approaches: SelectMany Zip I either end up with: Subscribe stops invoking after the first time (if I use Zip) Subscribe invokes even when the command hasn't been executed after it was executed once Essentially I want: An observable that triggers every time (and only ) when the

ReactiveAsyncCommand missing in ReactiveUI 5.0.2

落花浮王杯 提交于 2019-12-02 04:56:13
问题 I just start learn ReactiveUI from https://github.com/reactiveui/ReactiveUI.Samples/blob/master/ReactiveUI_4Only.Samples.sln. I download lastest version via nuget but I cant find class ReactiveAsyncCommand in ReactiveUI.Xaml. 回答1: ReactiveAsyncCommand is now in ReactiveUI.Legacy . 来源: https://stackoverflow.com/questions/17792826/reactiveasynccommand-missing-in-reactiveui-5-0-2

Buffer data from database cursor while keeping UI responsive

别等时光非礼了梦想. 提交于 2019-12-02 04:43:53
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.Instance.GetAllObjects(); var status = cursor.MoveToFirst(); while (status == DbStatus.OK) { var dbObject= Db

ReactiveAsyncCommand missing in ReactiveUI 5.0.2

▼魔方 西西 提交于 2019-12-02 03:12:27
I just start learn ReactiveUI from https://github.com/reactiveui/ReactiveUI.Samples/blob/master/ReactiveUI_4Only.Samples.sln . I download lastest version via nuget but I cant find class ReactiveAsyncCommand in ReactiveUI.Xaml. ReactiveAsyncCommand is now in ReactiveUI.Legacy . 来源: https://stackoverflow.com/questions/17792826/reactiveasynccommand-missing-in-reactiveui-5-0-2

Bind data inside ListBox using code-behind in ReactiveUI

好久不见. 提交于 2019-12-01 08:25:18
I have WPF listbox: <ListBox Name="FileDownloads" SelectionMode="Extended"> <ListBox.ItemTemplate> <DataTemplate> <TextBlock Name="Url" Text="{Binding Url}" /> </DataTemplate> </ListBox.ItemTemplate> </ListBox> I like the ability to bind ListBox by name from code behind using: this.OneWayBind(ViewModel, vm => vm.DownloadManager.FileDownloads, v => v.FileDownloads.ItemsSource); Having binding in code-behind helps with refactoring. Is there any way to bind Url texbox inside the listbox using code-behind? Is there any way to bind Url textbox inside the listbox using code-behind? Not at the moment