reactiveui

WPF MaterialDesignInXamlToolkit Dialog expand to full width

妖精的绣舞 提交于 2021-02-11 15:14:44
问题 I'm trying to get the dialog in DialogHost to be horizontally stretched as much as possible, without hardcoding the size of the control that I'm displaying. Tried the following: setting the UserControl.HorizontalAligment to Stretch setting HorizontalContentAligment to Stretch on DialogHost I noticed that if set the Width to something like 6000, the dialog fills the DialogHost with some nice padding, but the content overflows and things on the right side are not visible. Is there some standard

How to properly cancel a Task on ViewModel-deactivation with ReactiveUI?

 ̄綄美尐妖づ 提交于 2021-02-10 12:44:59
问题 In my MVVM application, when a ViewModel gets activated, a Task gets started that establishes a network connection and could take some time to complete. This Task is cancalable: private async Task ConnectAsync(CancellationToken cancellationToken = default) { ... } I'm using IActivatableViewModel to start it on ViewModel-activation like that: // Constructor: public SomeViewModel(...) { this.WhenActivated(disposable => { Observable.StartAsync(ConnectAsync); }); } Now what is the recommended

ReactiveUI, WPF and Validation

梦想与她 提交于 2020-07-18 13:47:31
问题 I've seen that ReactiveUI had validation features in the past. Currently, with version 6.5, I cannot find anything related to it. Do you know if there's a more or less official way to deal with validation tasks in WPF using ReactiveUI? 回答1: Overall consensus on RxUI slack group is that people are exposing extra validation properties, e.g. split UserName and UserNameError (which is null if there is no error). Then use the platform’s validation/error mechanism to bring to user’s attention. 回答2:

ReactiveUI, WPF and Validation

时光总嘲笑我的痴心妄想 提交于 2020-07-18 13:47:02
问题 I've seen that ReactiveUI had validation features in the past. Currently, with version 6.5, I cannot find anything related to it. Do you know if there's a more or less official way to deal with validation tasks in WPF using ReactiveUI? 回答1: Overall consensus on RxUI slack group is that people are exposing extra validation properties, e.g. split UserName and UserNameError (which is null if there is no error). Then use the platform’s validation/error mechanism to bring to user’s attention. 回答2:

Is it possible to use ReactiveUI bindings in WPF for validating user input with only INotifyDataErrorInfo?

本秂侑毒 提交于 2020-05-29 05:15:12
问题 We're using ReactiveUI.WPF 11.0.1 in our .Net Core WPF application. We're looking into replacing all XAML-based bindings with ReactiveUI-based bindings. There is a ViewModel for the domain type that implements INotifyPropertyChanged and INotifyDataErrorInfo: public class ItemViewModel : INotifyPropertyChanged, INotifyDataErrorInfo { private string Error => string.IsNullOrEmpty(Name) ? "Empty name" : string.Empty; private string _name; public string Name { get => _name; set { _name = value;

How can I get xaml hot reload to work for custom types in WPF

自古美人都是妖i 提交于 2020-05-26 09:29:53
问题 I am using the ReactiveUI library within my WPF project and it seems that ReactiveUserControl<TViewModel> : UserControl and the ReactiveWindow<TViewModel> : Window don't work with the XAML Hot Reload . Although extending directly from a Usercontrol did allow me to use the XAML hot reload . I can not find any documentation or posts on the matter besides this one page which explains absolutely nothing. Wondering if it maybe has to do with the x:TypeArguments="navigation:MainVM" that you have to

Minimum runnable example for ReactiveUI - not running

你离开我真会死。 提交于 2020-03-25 19:45:32
问题 I wanted to generate a MWE for my ReactiveUI problem. However I came across new problems. This is what i tried: using System; using ReactiveUI; using ReactiveUI.Fody.Helpers; namespace ReactivUI_Test { class BarClass : ReactiveObject { [Reactive] public String Baz { get; set; } = ""; public BarClass(String b) { Baz = b; } public BarClass() { Baz = "!!!"; } public override String ToString() { return Baz.ToString(); } } class FooClass : ReactiveObject { [Reactive] public BarClass Bar { get; set

ReactiveCommand and ConnectableObservable

 ̄綄美尐妖づ 提交于 2020-01-23 18:55:27
问题 I'd like to wire a ReactiveCommand up to a ConnectableObservable, since the observable should be connectable by multiple subscribers. The problem is that ReactiveCommand will only call the Subscribe method on the ConnectableObservable, rather than the Connect method as I would like. The code below demonstrates what I'm trying to achieve. Notice the StartOrConnectService method that is called by service code. public class Foo { public IConnectableObservable<string> Connection { get; } public