我已经创建了Android应用程序,它按预期工作。现在我添加了UvP Project,如MvvmCross站点所示。MvvmCross绑定UWP
问题是绑定在那里不起作用。
还有就是我的XAML:
<Grid Row="1" >
<StackPanel VerticalAlignment="Center"
Margin="40 0 40 0">
<TextBox Text="{Binding Login}"
Margin="0 0 0 20"/>
<PasswordBox Password="{Binding Password}"/>
</StackPanel>
<Button VerticalAlignment="Bottom"
Content="Login"
Command="{Binding LoginCommand}"
Foreground="#F9F9F9"
HorizontalAlignment="Stretch"
Background="#FF4081"/>
</Grid>
而且视图模型
public string Login { get; set; }
public string Password { get; set; }
public MvxCommand LoginCommand { get; private set; }
//...
当按下登录按钮,它成功地进入给定的方法,但登录名和密码字符串为空。使用MvxBind登录和密码字符串时,相同的代码适用于Android。
我会做一些工作吗?
您使用的是Fody PropertyChanged吗?如果是这样的话,请确保UWP项目中的wave xml是正确的 – xleon
顺便说一句,如果你不显示你是如何绑定的,那么人们将无法提供帮助 – xleon