@@ -3,7 +3,7 @@ layout: post
3
3
title : Customization in .NET MAUI Button control | Syncfusion®
4
4
description : Learn here all about Customization support in Syncfusion® .NET MAUI Button (SfButton) control and more.
5
5
platform : maui
6
- control : Sfbutton
6
+ control : SfButton
7
7
documentation : ug
8
8
---
9
9
@@ -22,8 +22,8 @@ The [`TextColor`](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Core.Butto
22
22
{% tabs %}
23
23
{% highlight xaml %}
24
24
25
- <button : SfButton x: Name ="button" Text="Button" TextColor = "White">
26
- </button : SfButton >
25
+ <buttons : SfButton x: Name ="button" Text="Button" TextColor = "White">
26
+ </buttons : SfButton >
27
27
28
28
{% endhighlight %}
29
29
{% highlight c# %}
@@ -44,8 +44,8 @@ The [`FontSize`](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Core.Button
44
44
{% tabs %}
45
45
{% highlight xaml %}
46
46
47
- <button : SfButton x: Name ="button" Text="Button" FontSize = "18">
48
- </button : SfButton >
47
+ <buttons : SfButton x: Name ="button" Text="Button" FontSize = "18">
48
+ </buttons : SfButton >
49
49
50
50
{% endhighlight %}
51
51
{% highlight c# %}
@@ -66,8 +66,8 @@ The [`FontAttributes`](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Core.
66
66
{% tabs %}
67
67
{% highlight xaml %}
68
68
69
- <button : SfButton x: Name ="button" Text="Button" FontAttributes = "Italic">
70
- </button : SfButton >
69
+ <buttons : SfButton x: Name ="button" Text="Button" FontAttributes = "Italic">
70
+ </buttons : SfButton >
71
71
72
72
{% endhighlight %}
73
73
{% highlight c# %}
@@ -88,15 +88,15 @@ The [`FontFamily`](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Core.Butt
88
88
{% tabs %}
89
89
{% highlight xaml %}
90
90
91
- <button : SfButton x: Name ="button" Text="Button" FontFamily = "Samantha-Demo ">
92
- </button : SfButton >
91
+ <buttons : SfButton x: Name ="button" Text="Button" FontFamily = "Lobster ">
92
+ </buttons : SfButton >
93
93
94
94
{% endhighlight %}
95
95
{% highlight c# %}
96
96
97
97
SfButton button = new SfButton();
98
98
button.Text = "Button";
99
- button.FontFamily = "Samantha-Demo ";
99
+ button.FontFamily = "Lobster ";
100
100
101
101
{% endhighlight %}
102
102
{% endtabs %}
@@ -110,8 +110,8 @@ The [`HorizontalTextAlignment`](https://help.syncfusion.com/cr/maui/Syncfusion.M
110
110
{% tabs %}
111
111
{% highlight xaml %}
112
112
113
- <button : SfButton x: Name ="button" Text="Button" HorizontalTextAlignment="Center" VerticalTextAlignment="Center">
114
- </button : SfButton >
113
+ <buttons : SfButton x: Name ="button" Text="Button" HorizontalTextAlignment="Center" VerticalTextAlignment="Center">
114
+ </buttons : SfButton >
115
115
116
116
{% endhighlight %}
117
117
{% highlight c# %}
@@ -131,12 +131,12 @@ Users can now customize the [`SfButton`](https://help.syncfusion.com/cr/maui/Syn
131
131
{% tabs %}
132
132
{% highlight xaml %}
133
133
134
- <button : SfButton x: Name ="button"
135
- Text="Submit"
134
+ <buttons : SfButton x: Name ="button"
135
+ Text="Submit"
136
136
TextTransform="Uppercase"
137
137
HorizontalTextAlignment="Center"
138
138
VerticalTextAlignment="Center">
139
- </button : SfButton >
139
+ </buttons : SfButton >
140
140
141
141
{% endhighlight %}
142
142
{% highlight c# %}
@@ -165,8 +165,8 @@ The [`LineBreakMode`](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Button
165
165
{% tabs %}
166
166
{% highlight xaml %}
167
167
168
- <button : SfButton x: Name ="button" Text="Add Items To Cart" LineBreakMode="MiddleTruncation" ImageSource="Cart.png">
169
- </button : SfButton >
168
+ <buttons : SfButton x: Name ="button" Text="Add Items To Cart" LineBreakMode="MiddleTruncation" ImageSource="Cart.png">
169
+ </buttons : SfButton >
170
170
171
171
{% endhighlight %}
172
172
{% highlight c# %}
@@ -192,8 +192,8 @@ The [`Background`](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Buttons.S
192
192
{% tabs %}
193
193
{% highlight xaml %}
194
194
195
- <button : SfButton x: Name ="button" Text="Button" Background = "DeepSkyBlue">
196
- </button : SfButton >
195
+ <buttons : SfButton x: Name ="button" Text="Button" Background = "DeepSkyBlue">
196
+ </buttons : SfButton >
197
197
198
198
{% endhighlight %}
199
199
{% highlight c# %}
@@ -216,8 +216,8 @@ The [`Stroke`](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Core.ButtonBa
216
216
{% tabs %}
217
217
{% highlight xaml %}
218
218
219
- <button : SfButton x: Name ="button" Text="Button" Stroke="Red">
220
- </button : SfButton >
219
+ <buttons : SfButton x: Name ="button" Text="Button" Stroke="Red" StrokeThickness="2 ">
220
+ </buttons : SfButton >
221
221
222
222
{% endhighlight %}
223
223
{% highlight c# %}
@@ -229,6 +229,8 @@ button.Stroke = Colors.Red;
229
229
{% endhighlight %}
230
230
{% endtabs %}
231
231
232
+ N> To display the ` Stroke ` color, we should define the ` StrokeThickness ` property.
233
+
232
234
![ SfButton with stroke] ( images/customization-images/Button_border.png )
233
235
234
236
### StrokeThickness
@@ -238,8 +240,8 @@ The [`StrokeThickness`](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Core
238
240
{% tabs %}
239
241
{% highlight xaml %}
240
242
241
- <button : SfButton x: Name ="button" Text="Button" Stroke="Red" StrokeThickness="6">
242
- </button : SfButton >
243
+ <buttons : SfButton x: Name ="button" Text="Button" Stroke="Red" StrokeThickness="6">
244
+ </buttons : SfButton >
243
245
244
246
{% endhighlight %}
245
247
{% highlight c# %}
@@ -261,8 +263,8 @@ The [`CornerRadius`](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Core.Bu
261
263
{% tabs %}
262
264
{% highlight xaml %}
263
265
264
- <button : SfButton x: Name ="button" Text="Button" CornerRadius="20">
265
- </button : SfButton >
266
+ <buttons : SfButton x: Name ="button" Text="Button" CornerRadius="20">
267
+ </buttons : SfButton >
266
268
267
269
{% endhighlight %}
268
270
{% highlight c# %}
@@ -287,8 +289,8 @@ You can enable the Icon image using the [`ShowIcon`](https://help.syncfusion.com
287
289
{% tabs %}
288
290
{% highlight xaml %}
289
291
290
- <button : SfButton x: Name ="button" Text="Button" ImageSource="Heart.png" ShowIcon="True">
291
- </button : SfButton >
292
+ <buttons : SfButton x: Name ="button" Text="Button" ImageSource="Heart.png" ShowIcon="True">
293
+ </buttons : SfButton >
292
294
293
295
{% endhighlight %}
294
296
{% highlight c# %}
@@ -310,8 +312,8 @@ N> Enable the [`ShowIcon`](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.C
310
312
{% tabs %}
311
313
{% highlight xaml %}
312
314
313
- <button : SfButton x: Name ="button" Text="Button" ImageSource="Heart.png" ShowIcon="True">
314
- </button : SfButton >
315
+ <buttons : SfButton x: Name ="button" Text="Button" ImageSource="Heart.png" ShowIcon="True">
316
+ </buttons : SfButton >
315
317
316
318
{% endhighlight %}
317
319
{% highlight c# %}
@@ -335,8 +337,8 @@ N> Enable the `ShowIcon` property to enable the `ImageSize` property.
335
337
{% tabs %}
336
338
{% highlight xaml %}
337
339
338
- <button : SfButton x: Name ="button" Text="Button" ImageSource="Heart.png" ShowIcon="True" ImageSize="50">
339
- </button : SfButton >
340
+ <buttons : SfButton x: Name ="button" Text="Button" ImageSource="Heart.png" ShowIcon="True" ImageSize="50">
341
+ </buttons : SfButton >
340
342
341
343
{% endhighlight %}
342
344
{% highlight c# %}
@@ -640,7 +642,7 @@ The [EnableRippleEffect](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Cor
640
642
{% tabs %}
641
643
{% highlight xaml %}
642
644
643
- <button : SfButton x: Name ="button" Text="Button" EnableRippleEffect="True" />
645
+ <buttons : SfButton x: Name ="button" Text="Button" EnableRippleEffect="True" />
644
646
645
647
{% endhighlight %}
646
648
{% highlight c# %}
@@ -668,27 +670,27 @@ Refer to this [`documentation`](https://learn.microsoft.com/en-us/dotnet/maui/us
668
670
669
671
. . .
670
672
671
- <button : SfButton Text="Linear Gradient" CornerRadius="20">
672
- < button :SfButton.Background>
673
+ <buttons : SfButton Text="Linear Gradient" CornerRadius="20">
674
+ < buttons :SfButton.Background>
673
675
<LinearGradientBrush >
674
676
<LinearGradientBrush.GradientStops>
675
677
<GradientStop Color =" #0D62D4 " Offset =" 0 " />
676
678
<GradientStop Color =" #9F3CDC " Offset =" 1 " />
677
679
</LinearGradientBrush.GradientStops>
678
680
</LinearGradientBrush >
679
- </button : SfButton .Background>
680
- </button : SfButton >
681
+ </buttons : SfButton .Background>
682
+ </buttons : SfButton >
681
683
682
- <button : SfButton Text="Radial Gradient" CornerRadius="20">
683
- < button :SfButton.Background>
684
+ <buttons : SfButton Text="Radial Gradient" CornerRadius="20">
685
+ < buttons :SfButton.Background>
684
686
<RadialGradientBrush Radius =" 1.5 " >
685
687
<RadialGradientBrush.GradientStops>
686
688
<GradientStop Color =" #0D62D4 " Offset =" 0 " />
687
689
<GradientStop Color =" #9F3CDC " Offset =" 1 " />
688
690
</RadialGradientBrush.GradientStops>
689
691
</RadialGradientBrush >
690
- </button : SfButton .Background>
691
- </button : SfButton >
692
+ </buttons : SfButton .Background>
693
+ </buttons : SfButton >
692
694
693
695
{% endhighlight %}
694
696
{% highlight c# %}
@@ -735,11 +737,11 @@ N> Default value is [`null`].
735
737
<local: CommandDemoViewModel />
736
738
</ContentPage.BindingContext>
737
739
738
- <button : SfButton x: Name ="button"
740
+ <buttons : SfButton x: Name ="button"
739
741
Text="Button"
740
742
Background="{Binding Background}"
741
743
Command="{Binding ButtonCommand}">
742
- </button : SfButton >
744
+ </buttons : SfButton >
743
745
744
746
{% endhighlight %}
745
747
{% highlight c# %}
0 commit comments