Created
September 20, 2018 22:28
-
-
Save tugcearar/78050e6a369ac5fc0ae4832cb893ad0a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CustomPicker : Picker | |
{ | |
public string DoneButtonText | |
{ | |
get | |
{ | |
return (string)GetValue(DoneButtonTextProperty); | |
} | |
set | |
{ | |
SetValue(DoneButtonTextProperty, value); | |
} | |
} | |
public static readonly BindableProperty DoneButtonTextProperty = BindableProperty.Create( | |
propertyName: "DoneButtonTextProperty", | |
returnType: typeof(string), | |
declaringType: typeof(CustomPicker), | |
defaultValue: string.Empty, | |
defaultBindingMode: BindingMode.TwoWay, | |
propertyChanged: DoneButtonTextPropertyChanged); | |
private static void DoneButtonTextPropertyChanged(BindableObject bindable, object oldValue, object newValue) | |
{ | |
(bindable as CustomPicker).DoneButtonText = newValue.ToString(); | |
} | |
public string CancelButtonText | |
{ | |
get | |
{ | |
return (string)GetValue(CancelButtonTextProperty); | |
} | |
set | |
{ | |
SetValue(CancelButtonTextProperty, value); | |
} | |
} | |
public static readonly BindableProperty CancelButtonTextProperty = BindableProperty.Create( | |
propertyName: "CancelButtonTextProperty", | |
returnType: typeof(string), | |
declaringType: typeof(CustomPicker), | |
defaultValue: string.Empty, | |
defaultBindingMode: BindingMode.TwoWay, | |
propertyChanged: CancelButtonTextPropertyChanged); | |
private static void CancelButtonTextPropertyChanged(BindableObject bindable, object oldValue, object newValue) | |
{ | |
(bindable as CustomPicker).CancelButtonText = newValue.ToString(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment