我有我的ViewModel属性,我需要绑定到我的行为BindableProperty,但我似乎无法让它绑定。从ViewModel绑定到行为
private int _test;
public int Test {
get {
return _test;
}
set {
if (SetProperty (ref _test, value)) {
_profileIsDirty = true;
NotifyPropertyChanged ("AllowUpdate");
}
}
}
这里是行为的性质
public static readonly BindableProperty MinLengthProperty = BindableProperty.Create("MinLength", typeof(int), typeof(MinLengthValidator), 0);
public int MinLength
{
get { return (int)GetValue(MinLengthProperty); }
set { SetValue(MinLengthProperty, value); }
}
这是在视图模型的财产,这是我正在试图绑定到它在XAML
<behave:TelephoneNumberValidatorBehaviour x:Name="phoneValidator" MinLength="{Binding Test, Mode=OneWay}"/>
但永不结合。我在这里做错了什么?
是的,我有,在SetProperty方法中有一个内置的通知,所以它不是不幸的。 –