C# 如何更新其他项目视图模型(UWP)中的绑定属性?
我有UWP UI项目和其他带有逻辑视图模型的.NET标准项目。我将字符串从viewmodel绑定到视图C# 如何更新其他项目视图模型(UWP)中的绑定属性?,c#,uwp,reactiveui,C#,Uwp,Reactiveui,我有UWP UI项目和其他带有逻辑视图模型的.NET标准项目。我将字符串从viewmodel绑定到视图 <TextBlock Text="{Binding ConsoleData}" HorizontalAlignment="Center" FontSize="18"/> 启动后,程序将与一起下降。因为viewmodel存在于其他项目中,所以不可能调用Core.Dispather。请告诉我,如何解决此问题?使用Reactive.UI O
<TextBlock Text="{Binding ConsoleData}" HorizontalAlignment="Center"
FontSize="18"/>
启动后,程序将与一起下降。因为viewmodel存在于其他项目中,所以不可能调用Core.Dispather。请告诉我,如何解决此问题?使用Reactive.UI ObserveOnRxApp.MainThreadScheduler解决使用Reactive.UI ObserveOnRxApp.MainThreadScheduler解决
[Reactive] public string ConsoleData { get; set; } = "";
public TestViewModel()
{
_testLogicController = new TestLogicController();
_testLogicController.OnMessage += OnMessageUpdate;
}
private void OnMessageUpdate(object sender, EventArgs args)
{
ConsoleData += (string)sender;
ConsoleData += "\n";
}