728x90
728x170

기존에 사용했던 코드가

public static readonly BindableProperty SpacingProperty =

    BindableProperty.Create<WrapLayout, double>(w => w.Spacing, 5,

        propertyChanged: (bindable, oldvalue, newvalue) => ((WrapLayout)bindable).layoutCache.Clear());

 

아래처럼 줄이 그어져 확인해보니


"Create<> (generic) is obsolete as of version 2.1.0 and is no longer supported."

 

위 문구 처럼 Create<> 는 더 이상 지원하지 않는다고한다.

 

위 내용을 지원되는 현재 버전으로 변경하면 아래와 같다.

 

public static readonly BindableProperty SpacingProperty =

    BindableProperty.Create(nameof(Spacing), typeof(double), typeof(WrapLayout), 5.0,

        propertyChanged: (bindable, oldValue, newValue) => ((WrapLayout)bindable).layoutCache.Clear());

 

 

참고

https://forums.xamarin.com/discussion/comment/177726/#Comment_177726

https://forums.xamarin.com/discussion/62984/generic-versions-of-create-are-no-longer-supported-and-deprecated

 

 

BindableProperty.Create<BindablePicker, IList>(p => p.ItemsSource, null,

    propertyChanged: OnItemsSourcePropertyChanged);

=>

BindableProperty.Create(nameof(ItemsSource), typeof(IList), typeof(BindablePicker), null,

    propertyChanged: OnItemsSourcePropertyChanged);

 

 

private static void OnItemsSourcePropertyChanged(BindableObject bindable, IList oldValue, IList newValue)

=>

private static void OnItemsSourcePropertyChanged(BindableObject bindable, object oldValue, object newValue)

 

 

728x90
그리드형
Posted by kjun.kr
,