Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/xamarin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 使用最新版本(未弃用)创建BindableProperty_C#_Xamarin_Xamarin.forms - Fatal编程技术网

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:一些链接。不直接相关,但当我看到那个链接时,它让我想知道链接到哪里以及它的样本和数据。