C# 使用最新版本(未弃用)创建BindableProperty
我想更新我不推荐使用的代码,如下所示:C# 使用最新版本(未弃用)创建BindableProperty,c#,xamarin,xamarin.forms,C#,Xamarin,Xamarin.forms,我想更新我不推荐使用的代码,如下所示: public static readonly BindableProperty CompletedProperty = BindableProperty.CreateAttached<EntryCompletedBehavior, Command>( bindable => EntryCompletedBehavior.GetCompleted(bindable), /* staticgetter */
public static readonly BindableProperty CompletedProperty = BindableProperty.CreateAttached<EntryCompletedBehavior, Command>(
bindable => EntryCompletedBehavior.GetCompleted(bindable), /* staticgetter */
null, /* default value */
BindingMode.OneWay, /* defaultBindingMode */
null, /* validateValue */
(b, o, n) => EntryCompletedBehavior.OnCompletedChanged(b, o, n), /* PropertyChanged */
null, /* PropertyChanging */
null); /* CoerceValue */
这里有一个GitHub链接,指向Charles Petzold何时更新他的示例以使用非通用BindableProperty,如果您查看前后的内容,它应该会对您有所帮助
这里有一个GitHub链接,指向Charles Petzold何时更新其示例以使用非通用BindableProperty,如果您查看前后的内容,它应该会对您有所帮助 谢谢比尔·赖斯;-) 以下代码正在运行:
public static readonly BindableProperty CompletedProperty = BindableProperty.CreateAttached(
"Completed", /* string PropertyName */
typeof(Command), /* Type returnType */
typeof(Entry), /* Type declaringType */
null, /* default value */
BindingMode.OneWay, /* defaultBindingMode */
propertyChanged: (bindable, oldValue, newValue) => {
EntryCompletedBehavior.OnCompletedChanged(bindable, (Command)oldValue, (Command)newValue);
});
谢谢比尔·赖斯;-)
以下代码正在运行:
public static readonly BindableProperty CompletedProperty = BindableProperty.CreateAttached(
"Completed", /* string PropertyName */
typeof(Command), /* Type returnType */
typeof(Entry), /* Type declaringType */
null, /* default value */
BindingMode.OneWay, /* defaultBindingMode */
propertyChanged: (bindable, oldValue, newValue) => {
EntryCompletedBehavior.OnCompletedChanged(bindable, (Command)oldValue, (Command)newValue);
});
FWIW:一些链接。不直接相关,但当我看到那个链接时,我想知道链接到哪里以及它的样本和。FWIW:一些链接。不直接相关,但当我看到那个链接时,它让我想知道链接到哪里以及它的样本和数据。