-
Notifications
You must be signed in to change notification settings - Fork 340
/
StringToListConverterPage.xaml
37 lines (31 loc) · 1.61 KB
/
StringToListConverterPage.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?xml version="1.0" encoding="utf-8"?>
<pages:BasePage
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:mct="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
xmlns:pages="clr-namespace:CommunityToolkit.Maui.Sample.Pages"
x:Class="CommunityToolkit.Maui.Sample.Pages.Converters.StringToListConverterPage"
xmlns:vm="clr-namespace:CommunityToolkit.Maui.Sample.ViewModels.Converters"
x:TypeArguments="vm:StringToListConverterViewModel"
x:DataType="vm:StringToListConverterViewModel">
<VerticalStackLayout Spacing="8">
<Label
Text="The StringToListConverter returns a string array that contains the substrings in this string that are delimited by Separator"
TextColor="{StaticResource NormalLabelTextColor}" />
<Label
FontAttributes="Bold"
Text="Enter some text separated by ',' or '.' or ';'" />
<Entry
FontSize="Medium"
Placeholder="Enter some text separated by ',' or '.' or ';'"
Text="{Binding LabelText, Mode=OneWayToSource}" />
<CollectionView
ItemsSource="{Binding LabelText, Mode=OneWay, Converter={StaticResource StringToListConverter}}">
<CollectionView.ItemTemplate>
<DataTemplate x:DataType="x:String">
<Label FontSize="Medium" Text="{Binding .}" TextColor="{StaticResource NormalLabelTextColor}" />
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</VerticalStackLayout>
</pages:BasePage>