0
我试图找到一种方法,命令的生命周期内改变ReactiveUI ReactiveCommand的谓词:ReactiveUI ReactiveCommand动态谓词
public class Form1ViewModel
{
public Form1ViewModel()
{
TestAction =() => Observable.Start(() => { MessageBox.Show("Initial step"); });
TestCommand = ReactiveCommand.CreateFromObservable(TestAction);
TestCommand.ThrownExceptions.Subscribe(ex => MessageBox.Show(string.Format("Something went wrong while executing test command: {0}", ex)));
TestAction =() => Observable.Start(() => { MessageBox.Show("Another step"); });
}
public ReactiveCommand TestCommand { get; set; }
public Func<IObservable<Unit>> TestAction { get; set; }
}
当从绑定到这个视图模型的视图下执行命令,它总是给“初始一步“的信息而不是”另一个步骤“。 任何想法,将不胜感激。
谢谢,你是对的。 –