11using System ;
22using System . Runtime . CompilerServices ;
33using System . Windows . Input ;
4+ using Plugin . MaterialDesignControls . Implementations ;
45using Xamarin . Forms ;
56
67namespace Plugin . MaterialDesignControls
@@ -23,7 +24,7 @@ public MaterialButton()
2324
2425 private bool initialized = false ;
2526
26- protected Button button ;
27+ protected CustomButton button ;
2728
2829 private Grid grid ;
2930
@@ -177,6 +178,15 @@ public string DisabledIcon
177178 set { SetValue ( DisabledIconProperty , value ) ; }
178179 }
179180
181+ public static readonly BindableProperty ToUpperProperty =
182+ BindableProperty . Create ( nameof ( ToUpper ) , typeof ( bool ) , typeof ( MaterialButton ) , defaultValue : false ) ;
183+
184+ public bool ToUpper
185+ {
186+ get { return ( bool ) GetValue ( ToUpperProperty ) ; }
187+ set { SetValue ( ToUpperProperty , value ) ; }
188+ }
189+
180190 #endregion Properties
181191
182192 #region Methods
@@ -203,7 +213,7 @@ private void Initialize()
203213 } ;
204214 this . grid . Children . Add ( this . actIndicator , 0 , 0 ) ;
205215
206- this . button = new Button
216+ this . button = new CustomButton
207217 {
208218 CornerRadius = 4 ,
209219 Padding = new Thickness ( 12 , 0 )
@@ -221,7 +231,8 @@ protected override void OnPropertyChanged([CallerMemberName] string propertyName
221231 switch ( propertyName )
222232 {
223233 case nameof ( this . Text ) :
224- this . button . Text = this . Text ;
234+ case nameof ( this . ToUpper ) :
235+ this . button . Text = this . ToUpper ? this . Text ? . ToUpper ( ) : this . Text ;
225236 break ;
226237 case nameof ( this . TextColor ) :
227238 case nameof ( this . DisabledTextColor ) :
0 commit comments