カスタム BindableProperty を持つカスタム ビューがあります。
public string Valore {
get { return (string)GetValue(ValoreProperty); }
set { SetValue(ValoreProperty, value); }
}
public static readonly BindableProperty ValoreProperty =
BindableProperty.Create(
propertyName: nameof(Valore),
returnType: typeof(string),
declaringType: typeof(VolosTimePickerView),
defaultBindingMode: BindingMode.TwoWay,
propertyChanged: ValorePropertyChanged,
propertyChanging: ValorePropertyChanging
);
私の XAML では、 の値がValore
nullableInt
であるため、次のようなコンバーターを使用する必要があります。
<view:VolosTimePickerView Grid.Row="0" Grid.Column="1"
Valore="{Binding OrariSelezionati.ViaggioInizioMattina, Converter={StaticResource NullableConverter}}" />
Converter={StaticResource NullableConverter
XAML 側で使用せずに、プロパティの背後にあるコードで同じことを行うにはどうすればよいですか?
ありがとうございました!