File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ Set the control to content in ContentPage.
45
45
```
46
46
# Wrap text in Segmented control
47
47
48
+ ** [ C#] **
48
49
```
49
50
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
50
51
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
@@ -74,4 +75,35 @@ Set the control to content in ContentPage.
74
75
</StackLayout>
75
76
</ContentPage.Content>
76
77
</ContentPage>
78
+ ```
79
+
80
+ ** [ C#] **
81
+
82
+ ```
83
+ public class ViewModel
84
+ {
85
+ public ObservableCollection<View> ViewItems { get; set; }
86
+
87
+ public ViewModel()
88
+ {
89
+ ViewItems = new ObservableCollection<View>()
90
+ {
91
+ new CustomLabel(){Text = "Veg (Garlic, taco toppings and ranch)" },
92
+ new CustomLabel(){Text = "Non Veg (bafbecue sauce and chicken)" }
93
+ };
94
+ }
95
+ }
96
+
97
+ public class CustomLabel : Label
98
+ {
99
+ public CustomLabel()
100
+ {
101
+ TextColor = Color.Black;
102
+ FontSize = 30;
103
+ LineBreakMode = Xamarin.Forms.LineBreakMode.WordWrap;
104
+ HorizontalTextAlignment = TextAlignment.Center;
105
+ VerticalOptions = LayoutOptions.Center;
106
+ HeightRequest = 200;
107
+ }
108
+ }
77
109
```
You can’t perform that action at this time.
0 commit comments