Skip to content

Commit c9d4901

Browse files
committed
Updated Readme file
1 parent 32ab335 commit c9d4901

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ Set the control to content in ContentPage.
4545
```
4646
# Wrap text in Segmented control
4747

48+
**[C#]**
4849
```
4950
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
5051
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
@@ -74,4 +75,35 @@ Set the control to content in ContentPage.
7475
</StackLayout>
7576
</ContentPage.Content>
7677
</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+
}
77109
```

0 commit comments

Comments
 (0)