UWP MVVMCross绑定属性到方法
如何根据使用MVVPCross的第一个按钮的方法更改第二个按钮的内容 大概是这样的: MainPage.xaml:UWP MVVMCross绑定属性到方法,mvvm,binding,uwp,cross-platform,mvvmcross,Mvvm,Binding,Uwp,Cross Platform,Mvvmcross,如何根据使用MVVPCross的第一个按钮的方法更改第二个按钮的内容 大概是这样的: MainPage.xaml: <Button Content="Translate" Click="{x:Bind PhonewordTranslator.Translate}" /> <Button Content="{x:Bind PhonewordTranslatorViewModel.CallButtonText, Mode=TwoWay}" Click="{x:Bind Phonew
<Button Content="Translate" Click="{x:Bind PhonewordTranslator.Translate}" />
<Button Content="{x:Bind PhonewordTranslatorViewModel.CallButtonText, Mode=TwoWay}" Click="{x:Bind PhonewordTranslatorViewModel.Call}" />
请修改您的翻译方法,如下所示:
public void Translate()
{
CallButtonText = "test123";
}
试试这个:
public void Translate()
{
CallButtonText = "NewText";
RaisePropertyChanged(() => CallButtonText);
}
public void Translate()
{
CallButtonText = "NewText";
RaisePropertyChanged(() => CallButtonText);
}