Tag: activeui

ContentControl不更新

我正在尝试将一个绑定到视图的MainWindow。 我在代码中更改了该视图,并期望它在主窗口中更新,但是没有发生。 我在XAML中有这个代码 然后我通过此代码更改我的控件 public class MainWindowViewModel : ReactiveObject { private UserControl _CurrentControl = null; public UserControl CurrentControl { get { if (_CurrentControl == null) { _CurrentControl = new HomePage(); } return _CurrentControl; } set { this.RaiseAndSetIfChanged(x => x.CurrentControl, value); } } } 如您所见,我正在使用ReactiveUI库。 ContentControl在该视图中使用是错误的还是我没有正确绑定和更新?

ReactiveUI 6异步命令未在WPF应用程序中的后台线程上运行

视图模型 public class MyViewModel:ReactiveObject, IRoutableViewModel{ private ReactiveList _appExtensions; public MyViewModel(IScreen screen){ HostScreen = screen; AppExtensions = new ReactiveList(); GetApplicationExtensions = ReactiveCommand.CreateAsyncTask(x => _schemaService.GetApplicationExtensions()); // returns a Task<IEnumerable> GetApplicationExtensions .ObserveOn(RxApp.MainThreadScheduler) .SubscribeOn(RxApp.TaskpoolScheduler) .Subscribe(p => { using (_appExtensions.SuppressChangeNotifications()) { _appExtensions.Clear(); _appExtensions.AddRange(p); } }); GetApplicationExtensions.ThrownExceptions.Subscribe( ex => Console.WriteLine(“Error during fetching of application extensions! Err: {0}”, ex.Message)); } // bound […]