1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <TabbedPage xmlns =" http://xamarin.com/schemas/2014/forms"
3
+ xmlns : x =" http://schemas.microsoft.com/winfx/2009/xaml"
4
+ x : Class =" Xamarin.Forms.Controls.GalleryPages.RadioButtonGroupGalleryPage" >
5
+ <TabbedPage .Resources>
6
+ <ResourceDictionary >
7
+ <DataTemplate x : Key =" NoGroupNameLVItemTemplate" >
8
+ <ViewCell >
9
+ <RadioButton Text =" RadioButton, Group=null" />
10
+ </ViewCell >
11
+ </DataTemplate >
12
+ <DataTemplate x : Key =" GroupNameLVItemTemplate" >
13
+ <ViewCell >
14
+ <RadioButton GroupName =" A" Text =" RadioButton, Group='A'" />
15
+ </ViewCell >
16
+ </DataTemplate >
17
+ <ControlTemplate x : Key =" NoGroupNameControlTemplate" >
18
+ <ContentPresenter />
19
+ </ControlTemplate >
20
+ <ControlTemplate x : Key =" GroupNameControlTemplate" >
21
+ <ContentPresenter />
22
+ </ControlTemplate >
23
+ </ResourceDictionary >
24
+ </TabbedPage .Resources>
25
+ <ContentPage Title =" Parent level" >
26
+ <ScrollView >
27
+ <StackLayout Padding =" 10" >
28
+ <Label Text =" Radio buttons with no group name are mutually exclusive at parent level"
29
+ Margin =" 0, 0, 0, 10" />
30
+ <Label Text =" StackLayout" />
31
+ <StackLayout >
32
+ <RadioButton Text =" RadioButton, Group=null" />
33
+ <RadioButton Text =" RadioButton, Group=null" />
34
+ <RadioButton Text =" RadioButton, Group=null" />
35
+ </StackLayout >
36
+ <Label Text =" StackLayout" Margin =" 0, 10" />
37
+ <StackLayout >
38
+ <RadioButton Text =" RadioButton, Group=null" />
39
+ <RadioButton Text =" RadioButton, Group=null" />
40
+ <RadioButton Text =" RadioButton, Group=null" />
41
+ </StackLayout >
42
+ <Label Text =" ScrollView" />
43
+ <ScrollView >
44
+ <RadioButton Text =" RadioButton, Group=null" />
45
+ </ScrollView >
46
+ <Label Text =" ContentView" />
47
+ <ContentView >
48
+ <RadioButton Text =" RadioButton, Group=null" />
49
+ </ContentView >
50
+ <Label Text =" Frame" />
51
+ <Frame >
52
+ <RadioButton Text =" RadioButton, Group=null" />
53
+ </Frame >
54
+ <Label Text =" ContentView with ControlTemplate" />
55
+ <ContentView ControlTemplate =" {StaticResource NoGroupNameControlTemplate}" >
56
+ <RadioButton Text =" RadioButton, Group=null" />
57
+ </ContentView >
58
+ <Label Text =" ListView with ItemTemplate" />
59
+ <ListView ItemTemplate =" {StaticResource NoGroupNameLVItemTemplate}"
60
+ VerticalOptions =" Start"
61
+ HeightRequest =" 300" >
62
+ <ListView .ItemsSource>
63
+ <x : Array Type =" {x:Type x:String}" >
64
+ <x : String >mono</x : String >
65
+ <x : String >monodroid</x : String >
66
+ <x : String >monotouch</x : String >
67
+ </x : Array >
68
+ </ListView .ItemsSource>
69
+ </ListView >
70
+ </StackLayout >
71
+ </ScrollView >
72
+ </ContentPage >
73
+
74
+ <ContentPage Title =" Page level" >
75
+ <ScrollView >
76
+ <StackLayout Padding =" 10" >
77
+ <Label Text =" Radio buttons with same group name are mutually exclusive at page level"
78
+ Margin =" 0, 0, 0, 10" />
79
+ <Label Text =" StackLayout" />
80
+ <StackLayout >
81
+ <RadioButton GroupName =" A" Text =" RadioButton, Group='A'" />
82
+ <RadioButton GroupName =" A" Text =" RadioButton, Group='A'" />
83
+ <RadioButton GroupName =" A" Text =" RadioButton, Group='A'" />
84
+ </StackLayout >
85
+ <Label Text =" StackLayout" Margin =" 0, 10" />
86
+ <StackLayout >
87
+ <RadioButton GroupName =" A" Text =" RadioButton, Group='A'" />
88
+ <RadioButton GroupName =" A" Text =" RadioButton, Group='A'" />
89
+ <RadioButton GroupName =" A" Text =" RadioButton, Group='A'" />
90
+ </StackLayout >
91
+ <Label Text =" ScrollView" />
92
+ <ScrollView >
93
+ <RadioButton GroupName =" A" Text =" RadioButton, Group='A'" />
94
+ </ScrollView >
95
+ <Label Text =" ContentView" />
96
+ <ContentView >
97
+ <RadioButton GroupName =" A" Text =" RadioButton, Group='A'" />
98
+ </ContentView >
99
+ <Label Text =" Frame" />
100
+ <Frame >
101
+ <RadioButton GroupName =" A" Text =" RadioButton, Group='A'" />
102
+ </Frame >
103
+ <Label Text =" ContentView with ControlTemplate" />
104
+ <ContentView ControlTemplate =" {StaticResource GroupNameControlTemplate}" >
105
+ <RadioButton GroupName =" A" Text =" RadioButton, Group='A'" />
106
+ </ContentView >
107
+ <Label Text =" ListView with ItemTemplate" />
108
+ <ListView ItemTemplate =" {StaticResource GroupNameLVItemTemplate}"
109
+ VerticalOptions =" Start"
110
+ HeightRequest =" 300" >
111
+ <ListView .ItemsSource>
112
+ <x : Array Type =" {x:Type x:String}" >
113
+ <x : String >mono</x : String >
114
+ <x : String >monodroid</x : String >
115
+ <x : String >monotouch</x : String >
116
+ </x : Array >
117
+ </ListView .ItemsSource>
118
+ </ListView >
119
+ </StackLayout >
120
+ </ScrollView >
121
+ </ContentPage >
122
+
123
+ <ContentPage Title =" Test" >
124
+ <ScrollView >
125
+ <StackLayout Padding =" 10" >
126
+ <Label Text =" Test with radio buttons with no group name or same group name"
127
+ Margin =" 0, 0, 0, 10" />
128
+ <Label Text =" StackLayout" />
129
+ <StackLayout >
130
+ <RadioButton GroupName =" A" Text =" RadioButton, GroupName='A'" />
131
+ <RadioButton GroupName =" A" Text =" RadioButton, GroupName='A'" />
132
+ <RadioButton Text =" RadioButton, GroupName=null" />
133
+ </StackLayout >
134
+ <StackLayout Margin =" 0, 10" >
135
+ <RadioButton GroupName =" A" Text =" RadioButton, GroupName='A'" />
136
+ <RadioButton GroupName =" B" Text =" RadioButton, GroupName='B'" />
137
+ <RadioButton GroupName =" B" Text =" RadioButton, GroupName='B'" />
138
+ <RadioButton Text =" RadioButton, GroupName=null" />
139
+ </StackLayout >
140
+ <StackLayout >
141
+ <RadioButton GroupName =" A" Text =" RadioButton, GroupName='A'" />
142
+ <RadioButton GroupName =" B" Text =" RadioButton, GroupName='B'" />
143
+ <RadioButton GroupName =" C" Text =" RadioButton, GroupName='C'" />
144
+ <RadioButton GroupName =" C" Text =" RadioButton, GroupName='C'" />
145
+ <RadioButton Text =" RadioButton, GroupName=null" />
146
+ <RadioButton Text =" RadioButton, GroupName=null" />
147
+ </StackLayout >
148
+ </StackLayout >
149
+ </ScrollView >
150
+ </ContentPage >
151
+ </TabbedPage >
0 commit comments