-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathRadioGroupPage.xaml
81 lines (70 loc) · 4.14 KB
/
RadioGroupPage.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?xml version="1.0" encoding="UTF-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:global="clr-namespace:Global.InputForms;assembly=Global.InputForms"
xmlns:valid="clr-namespace:SampleApp.Behaviors"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="SampleApp.Views.RadioGroupPage"
BackgroundColor="{StaticResource LightBackgroundColor}">
<ContentPage.Content>
<ScrollView >
<StackLayout
Spacing="10"
Padding="0,10,0,10"
VerticalOptions="Start"
HorizontalOptions="Center">
<!-- Standard RadioGroup with defaultIndex to 0 -->
<global:RadioGroup x:Name="_radioGender"
DefaultIndex="0"
ItemsSource="{Binding Genders}"
Orientation="Horizontal"
Spacing="20"
HorizontalOptions="Center"
CheckTemplate="{StaticResource ButtonRadio}" />
<Label Text="Standard RadioGroup with defaultIndex to 0" FontSize="Small" TextColor="Gray"
HorizontalTextAlignment="Center" HorizontalOptions="Center" />
<BoxView BackgroundColor="#eee" HeightRequest="1" Margin="0,10" />
<!--Unselectable RadioGroup with Parent FrameInfo and no defaultIndex-->
<global:FrameInfo>
<global:RadioGroup
x:Name="_radioGroup"
ItemsSource="{Binding Genders}"
IsDeselectable="true"
Orientation="Horizontal"
HorizontalOptions="Center"
CheckTemplate="{StaticResource IconRadio}" />
<global:FrameInfo.Behaviors>
<valid:RadioGroupValidatorBehavior />
</global:FrameInfo.Behaviors>
</global:FrameInfo>
<Label Text="Deselectable RadioGroup with Parent FrameInfo and no defaultIndex" FontSize="Small"
TextColor="Gray" HorizontalTextAlignment="Center" HorizontalOptions="Center" />
<BoxView BackgroundColor="#eee" HeightRequest="1" Margin="0,10" />
<!-- RadioGroup with custom CheckButtons-->
<global:RadioGroup Grid.Column="0"
Orientation="Horizontal"
HorizontalOptions="Center"
x:Name="_checkGroup">
<global:CheckButton Key="0" Value="Male"
WidthRequest="70" HeightRequest="30" CornerRadius="15" FontSize="12"
BackgroundColor="LightGray"
BorderColor="LightGray"
TextColor="Maroon"
CheckedBackgroundColor="Maroon"
CheckedBorderColor="Maroon"
CheckedTextColor="White" />
<global:CheckButton Key="1" Value="Female"
WidthRequest="70" HeightRequest="30" CornerRadius="15" FontSize="12"
BackgroundColor="LightGray"
BorderColor="LightGray"
TextColor="Teal"
CheckedBackgroundColor="Teal"
CheckedBorderColor="Teal"
CheckedTextColor="White" />
</global:RadioGroup>
<Label Text="RadioGroup with custom CheckButtons" FontSize="Small" TextColor="Gray"
HorizontalTextAlignment="Center" HorizontalOptions="Center" />
<BoxView BackgroundColor="#eee" HeightRequest="1" Margin="0,10" />
</StackLayout>
</ScrollView>
</ContentPage.Content>
</ContentPage>