-
Notifications
You must be signed in to change notification settings - Fork 340
/
IsStringNullOrWhiteSpaceConverterPage.xaml
35 lines (27 loc) · 1.92 KB
/
IsStringNullOrWhiteSpaceConverterPage.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
<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"
xmlns:vm="clr-namespace:CommunityToolkit.Maui.Sample.ViewModels.Converters"
x:Class="CommunityToolkit.Maui.Sample.Pages.Converters.IsStringNullOrWhiteSpaceConverterPage"
x:DataType="vm:IsStringNullOrWhiteSpaceConverterViewModel"
x:TypeArguments="vm:IsStringNullOrWhiteSpaceConverterViewModel">
<pages:BasePage.Resources>
<ResourceDictionary>
<mct:IsStringNullOrWhiteSpaceConverter x:Key="IsStringNullOrWhiteSpaceConverter" />
</ResourceDictionary>
</pages:BasePage.Resources>
<pages:BasePage.Content>
<VerticalStackLayout
Padding="10,10"
HorizontalOptions="Fill"
Spacing="16"
VerticalOptions="Fill">
<Label Text="The IsStringNullOrWhiteSpaceConverter is a converter that allows users to convert an incoming string binding to a bool value. This value represents if the incoming string binding value is null or white space using string.IsNullOrWhiteSpace." TextColor="{StaticResource NormalLabelTextColor}" />
<Label Text="Enter text into the Entry, below. If the text is null or white space, the value will be true." TextColor="{StaticResource NormalLabelTextColor}" FontAttributes="Bold" />
<Entry VerticalOptions="CenterAndExpand" HorizontalOptions="Fill" Text="{Binding Path=LabelText, Mode=OneWayToSource}" TextColor="{StaticResource NormalLabelTextColor}" />
<Label VerticalOptions="CenterAndExpand" HorizontalOptions="CenterAndExpand" Text="{Binding Path=LabelText, Mode=OneWay, Converter={StaticResource IsStringNullOrWhiteSpaceConverter}}" />
</VerticalStackLayout>
</pages:BasePage.Content>
</pages:BasePage>