-
Notifications
You must be signed in to change notification settings - Fork 338
/
IsStringNullOrEmptyConverterPage.xaml
49 lines (40 loc) · 2.27 KB
/
IsStringNullOrEmptyConverterPage.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
38
39
40
41
42
43
44
45
46
47
48
49
<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:views="clr-namespace:CommunityToolkit.Maui.Sample.Views"
xmlns:vm="clr-namespace:CommunityToolkit.Maui.Sample.ViewModels.Converters"
x:Class="CommunityToolkit.Maui.Sample.Pages.Converters.IsStringNullOrEmptyConverterPage"
x:DataType="vm:IsStringNullOrEmptyConverterViewModel"
x:TypeArguments="vm:IsStringNullOrEmptyConverterViewModel">
<pages:BasePage.Resources>
<ResourceDictionary>
<mct:IsStringNullOrEmptyConverter x:Key="IsStringNullOrEmptyConverter" />
</ResourceDictionary>
</pages:BasePage.Resources>
<pages:BasePage.Content>
<VerticalStackLayout
Padding="10,10"
HorizontalOptions="Fill"
Spacing="16"
VerticalOptions="Fill">
<Label Text="The IsStringNullOrEmptyConverter is a converter that allows usersc to convert an incoming string binding to a bool value. This value represents if the incoming string binding value is null or empty using string.IsNullOrEmpty." TextColor="{StaticResource NormalLabelTextColor}" />
<Label
Text="Enter text into the Entry, below. If the text is null or empty, the value will be true."
TextColor="{StaticResource NormalLabelTextColor}"
FontAttributes="Bold" />
<views:NullableBoolComponentWithLabel
NullableIsVisible="{Binding LabelText, Mode=OneWay, Converter={StaticResource IsStringNullOrEmptyConverter}}" />
<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 IsStringNullOrEmptyConverter}}" />
</VerticalStackLayout>
</pages:BasePage.Content>
</pages:BasePage>