From 72f24689d8c07541c7c0a0e919ddd9e9042c2485 Mon Sep 17 00:00:00 2001 From: Steven Moyes Date: Fri, 10 Jul 2020 17:45:14 -0700 Subject: [PATCH 1/6] Clarify the distinction between RadioButton and RadioButtons by moving RadioButtons into the Layouts section and clarify wording --- .../DataModel/ControlInfoData.json | 54 +++++++++---------- 1 file changed, 26 insertions(+), 28 deletions(-) diff --git a/XamlControlsGallery/DataModel/ControlInfoData.json b/XamlControlsGallery/DataModel/ControlInfoData.json index b7d208b7b..21b1889f9 100644 --- a/XamlControlsGallery/DataModel/ControlInfoData.json +++ b/XamlControlsGallery/DataModel/ControlInfoData.json @@ -898,8 +898,7 @@ "ImagePath": "ms-appx:///Assets/RadioButton.png", "Description": "Use RadioButtons to let a user choose between mutually exclusive, related options.", "Content": "

Look at the RadioButtonPage.xaml file in Visual Studio to see the full code for this page.

", - "IsNew": false, - "IsPreview": true, + "IsUpdated": true, "Docs": [ { "Title": "RadioButton - API", @@ -917,32 +916,6 @@ "ToggleButton" ] }, - { - "UniqueId": "RadioButtons", - "Title": "RadioButtons", - "Subtitle": "A control that allows a user to select a single option from a group of options. The RadioButtons control makes the available options mutually exclusive", - "ImagePath": "ms-appx:///Assets/RadioButton.png", - "Description": "Use RadioButtons to let a user choose between mutually exclusive, related options.", - "Content": "

Look at the RadioButtonsPage.xaml file in Visual Studio to see the full code for this page.

", - "IsNew": false, - "IsPreview": true, - "Docs": [ - { - "Title": "RadioButtons - API", - "Uri": "https://docs.microsoft.com/uwp/api/microsoft.ui.xaml.controls.radiobuttons?view=winui-2.4" - }, - { - "Title": "Guidelines", - "Uri": "https://docs.microsoft.com/windows/uwp/design/controls-and-patterns/radio-button" - } - ], - "RelatedControls": [ - "CheckBox", - "RadioButton", - "ToggleSwitch", - "ToggleButton" - ] - }, { "UniqueId": "RatingControl", "Title": "RatingControl", @@ -1376,6 +1349,31 @@ "VariableSizedWrapGrid", "RelativePanel" ] + }, + { + "UniqueId": "RadioButtons", + "Title": "RadioButtons", + "Subtitle": "A control that displays a group of related RadioButton controls.", + "ImagePath": "ms-appx:///Assets/RadioButton.png", + "Description": "A control that displays a group of related RadioButton controls.", + "Content": "

Look at the RadioButtonsPage.xaml file in Visual Studio to see the full code for this page.

", + "IsNew": true, + "Docs": [ + { + "Title": "RadioButtons - API", + "Uri": "https://docs.microsoft.com/uwp/api/microsoft.ui.xaml.controls.radiobuttons?view=winui-2.4" + }, + { + "Title": "Guidelines", + "Uri": "https://docs.microsoft.com/windows/uwp/design/controls-and-patterns/radio-button" + } + ], + "RelatedControls": [ + "CheckBox", + "RadioButton", + "ToggleSwitch", + "ToggleButton" + ] }, { "UniqueId": "RelativePanel", From fd662906c04461ef23a364a2deedf031216db791 Mon Sep 17 00:00:00 2001 From: Steven Moyes Date: Fri, 10 Jul 2020 17:52:31 -0700 Subject: [PATCH 2/6] Remove unnecessary RelativePanel, update wording in json file --- XamlControlsGallery/ControlPages/RadioButtonPage.xaml | 6 ++---- XamlControlsGallery/ControlPages/RadioButtonsPage.xaml | 4 ++-- XamlControlsGallery/DataModel/ControlInfoData.json | 8 ++++---- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/XamlControlsGallery/ControlPages/RadioButtonPage.xaml b/XamlControlsGallery/ControlPages/RadioButtonPage.xaml index 8d7269f29..1bc6614b9 100644 --- a/XamlControlsGallery/ControlPages/RadioButtonPage.xaml +++ b/XamlControlsGallery/ControlPages/RadioButtonPage.xaml @@ -13,9 +13,8 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:AppUIBasics" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" - xmlns:muxc="using:Microsoft.UI.Xaml.Controls" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"> - + @@ -44,6 +43,5 @@ - - + diff --git a/XamlControlsGallery/ControlPages/RadioButtonsPage.xaml b/XamlControlsGallery/ControlPages/RadioButtonsPage.xaml index 0381b0ebe..d13b1eee0 100644 --- a/XamlControlsGallery/ControlPages/RadioButtonsPage.xaml +++ b/XamlControlsGallery/ControlPages/RadioButtonsPage.xaml @@ -19,7 +19,7 @@ mc:Ignorable="d" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> - + @@ -52,5 +52,5 @@ - + diff --git a/XamlControlsGallery/DataModel/ControlInfoData.json b/XamlControlsGallery/DataModel/ControlInfoData.json index 21b1889f9..a022890f0 100644 --- a/XamlControlsGallery/DataModel/ControlInfoData.json +++ b/XamlControlsGallery/DataModel/ControlInfoData.json @@ -894,9 +894,9 @@ { "UniqueId": "RadioButton", "Title": "RadioButton", - "Subtitle": "A control that allows a user to select a single option from a group of options. When radio buttons are grouped together they are mutually exclusive.", + "Subtitle": "A control that allows a user to select a single option from a group of options.", "ImagePath": "ms-appx:///Assets/RadioButton.png", - "Description": "Use RadioButtons to let a user choose between mutually exclusive, related options.", + "Description": "Use RadioButtons to let a user choose between mutually exclusive, related options. Generally contained within a RadioButtons group control.", "Content": "

Look at the RadioButtonPage.xaml file in Visual Studio to see the full code for this page.

", "IsUpdated": true, "Docs": [ @@ -1353,9 +1353,9 @@ { "UniqueId": "RadioButtons", "Title": "RadioButtons", - "Subtitle": "A control that displays a group of related RadioButton controls.", + "Subtitle": "A control that displays a group of related RadioButton controls with keyboarding and accessibility support.", "ImagePath": "ms-appx:///Assets/RadioButton.png", - "Description": "A control that displays a group of related RadioButton controls.", + "Description": "A control that displays a group of related RadioButton controls with keyboarding and accessibility support.", "Content": "

Look at the RadioButtonsPage.xaml file in Visual Studio to see the full code for this page.

", "IsNew": true, "Docs": [ From c689e3064ba7bcc948d6b6821161d254a2aac9de Mon Sep 17 00:00:00 2001 From: Steven Moyes Date: Fri, 10 Jul 2020 18:00:07 -0700 Subject: [PATCH 3/6] Clean up RadioButton sample. --- .../ControlPages/RadioButtonPage.xaml | 38 ++++++++----------- .../ControlPages/RadioButtonPage.xaml.cs | 14 +------ 2 files changed, 17 insertions(+), 35 deletions(-) diff --git a/XamlControlsGallery/ControlPages/RadioButtonPage.xaml b/XamlControlsGallery/ControlPages/RadioButtonPage.xaml index 1bc6614b9..ad0e4053c 100644 --- a/XamlControlsGallery/ControlPages/RadioButtonPage.xaml +++ b/XamlControlsGallery/ControlPages/RadioButtonPage.xaml @@ -13,33 +13,25 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:AppUIBasics" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:muxc="using:Microsoft.UI.Xaml.Controls" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"> - - - - - - - - - - - - - - - + + + + + + + + + -<StackPanel> - <TextBlock Text="Options:"/> - <RadioButton x:Name="Option1RadioButton" Content="Option 1" Checked="Option1RadioButton_Checked"/> - <RadioButton x:Name="Option2RadioButton" Content="Option 2" Checked="Option2RadioButton_Checked"/> - <RadioButton x:Name="Option3RadioButton" Content="Option 3" Checked="Option3RadioButton_Checked"/> -</StackPanel> +<muxc:RadioButtons> + <RadioButton Content="Option 1" Checked="RadioButton_Checked"/> + <RadioButton Content="Option 2" Checked="RadioButton_Checked"/> + <RadioButton Content="Option 3" Checked="RadioButton_Checked"/> +</muxc:RadioButtons> diff --git a/XamlControlsGallery/ControlPages/RadioButtonPage.xaml.cs b/XamlControlsGallery/ControlPages/RadioButtonPage.xaml.cs index 99b10cc31..caf7cadad 100644 --- a/XamlControlsGallery/ControlPages/RadioButtonPage.xaml.cs +++ b/XamlControlsGallery/ControlPages/RadioButtonPage.xaml.cs @@ -21,19 +21,9 @@ public RadioButtonPage() this.InitializeComponent(); } - private void Option1RadioButton_Checked(object sender, RoutedEventArgs e) + private void RadioButton_Checked(object sender, RoutedEventArgs e) { - Control1Output.Text = "You selected option 1."; - } - - private void Option2RadioButton_Checked(object sender, RoutedEventArgs e) - { - Control1Output.Text = "You selected option 2."; - } - - private void Option3RadioButton_Checked(object sender, RoutedEventArgs e) - { - Control1Output.Text = "You selected option 3."; + Control1Output.Text = string.Format("You selected {0}", (sender as RadioButton).Content.ToString()); } } } From dd377ba51335ef6ea814fe9b9220d7b6d812f783 Mon Sep 17 00:00:00 2001 From: Steven Moyes Date: Fri, 10 Jul 2020 18:25:08 -0700 Subject: [PATCH 4/6] Adding RadioButtons icon to differentiate from RadioButton --- XamlControlsGallery/Assets/RadioButtons.png | Bin 0 -> 2071 bytes .../DataModel/ControlInfoData.json | 2 +- XamlControlsGallery/XamlControlsGallery.csproj | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 XamlControlsGallery/Assets/RadioButtons.png diff --git a/XamlControlsGallery/Assets/RadioButtons.png b/XamlControlsGallery/Assets/RadioButtons.png new file mode 100644 index 0000000000000000000000000000000000000000..c228311446c0572e9abe0bf23279f029968fd47e GIT binary patch literal 2071 zcmc&#Yfuwc6b?lMM0qIVAV|Axq)OX7Hi1L}i47!>RKm+p5|NgWtY*<<)7?;lmeIyh zgCYrtQ4kAaXr--A5i6h_S`h@RBBBgp0hw_IYgK52fC$!Z5N&^y{_W1*y?f4l-*?Wv z=iIsZiSejfl2l@Vc$>Qsvgo%5W99hPP-zq=7>yXkfhp zFle@DagKot&Iogee}|g}0y7Z(W-iEgLu4J90nVheLx}{07PP{jhtjb%xpNq;(}_uUdN%)a&mI0IZP^wZK6Tp z;o%M$27^K%D0r?`uP{)wIQgZ>tc(E0l^CMaBd8W|$SN|?Y&{nwGJd%fjqbI!7N6ZO zV&`ZEg^mVM>5iqn0!k$R4b^B~qj7yQ{CCp-DvV2WbucX%#?fp{2@`O#Bb1I4jll{% zib+v)%d6c?RHJ$nSED*0dL0W`m5OLpXbv7SgO^A+VlA#$XqB*7zy%2fDuSputSI{G zFlaS{5lR<8kdPhDWJX8x!x)59$QH)%UvUMfGFt;{^{=?9zq!mgxidv_R4kGRMig zGXZOfgMbkouWz;4iNmH83;0sQM~_P*M9Y(Wcbm;m=kGMl&*#4zKmk{o_KQB)xzv4W z8JOYY!|(L{Mg1M*9aLo!zSk2a3To+!;sra z4q_vHaL&diE&;933)zA=U(<H7 z*|zP-`1tsVsw!hvR@RAz1{p8gaJ@K_5%2MaaRt`2;;hNj(^H+9X=Jh4@KD*ga~yv^ zze>9uD}^Exz7pBpip!ms44qytmmjOC3E@Pn{bJ9k-LBT@EM;Y7s!JQR3G%L>7Xv*l zx1R4XPv$QSoHknUfsBIo2M-^59K?kRMUW&RVI6|hTum&`8Q;5oSAbAaBZG0*uOt_#kFhK!t(O+S(`2K_QfrSNCv&*m z>MLunKUw1{UUp+)xCspPe#h;1_aHG@e)l(?Tg1gY%frHF%#lacA9ubelvpBMKdP@z1V>(SUQN9EEvu8|xRrtPlhWJ@1P3Gd1Z#&ZD)eMhuj)M31 z+Ki;N%{TAIYH1C<#XgMHwn2E=it4~)##0$dvS(=xlXu0mI=>%2P4R90Swe#-Q@1mq z_2WgnpD2fN1tr$JCox4u?KffMDc%+l0eteI stk{}o^V%gudSjD@TmIkpB|m!IKtHd0+9RIa=Osi+L&U*8x;zW@LL literal 0 HcmV?d00001 diff --git a/XamlControlsGallery/DataModel/ControlInfoData.json b/XamlControlsGallery/DataModel/ControlInfoData.json index a022890f0..a7f3b2e5a 100644 --- a/XamlControlsGallery/DataModel/ControlInfoData.json +++ b/XamlControlsGallery/DataModel/ControlInfoData.json @@ -1354,7 +1354,7 @@ "UniqueId": "RadioButtons", "Title": "RadioButtons", "Subtitle": "A control that displays a group of related RadioButton controls with keyboarding and accessibility support.", - "ImagePath": "ms-appx:///Assets/RadioButton.png", + "ImagePath": "ms-appx:///Assets/RadioButtons.png", "Description": "A control that displays a group of related RadioButton controls with keyboarding and accessibility support.", "Content": "

Look at the RadioButtonsPage.xaml file in Visual Studio to see the full code for this page.

", "IsNew": true, diff --git a/XamlControlsGallery/XamlControlsGallery.csproj b/XamlControlsGallery/XamlControlsGallery.csproj index bf9c9b0ac..9e2a6558f 100644 --- a/XamlControlsGallery/XamlControlsGallery.csproj +++ b/XamlControlsGallery/XamlControlsGallery.csproj @@ -110,6 +110,7 @@ + From 75cc1f243cefc328b79cd0b829bde5e9d9abddce Mon Sep 17 00:00:00 2001 From: Steven Moyes Date: Fri, 10 Jul 2020 21:12:50 -0700 Subject: [PATCH 5/6] Add sample code substitution for SelectedIndex on RadioButtons page. --- .../ControlPages/RadioButtonsPage.xaml | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/XamlControlsGallery/ControlPages/RadioButtonsPage.xaml b/XamlControlsGallery/ControlPages/RadioButtonsPage.xaml index d13b1eee0..65c3ab188 100644 --- a/XamlControlsGallery/ControlPages/RadioButtonsPage.xaml +++ b/XamlControlsGallery/ControlPages/RadioButtonsPage.xaml @@ -22,12 +22,12 @@ - + Green Yellow White - + Green Yellow White @@ -37,20 +37,22 @@ -<StackPanel> - <muxc:RadioButtons MaxColumns="4" Header="Background" SelectedIndex="1" SelectionChanged="BackgroundColor_SelectionChanged"> - <x:String>Green</x:String> - <x:String>Yellow</x:String> - <x:String>White</x:String> - </muxc:RadioButtons> - <muxc:RadioButtons MaxColumns="4" Header="Border" SelectedIndex="2" SelectionChanged="BorderBrush_SelectionChanged"> - <x:String>Green</x:String> - <x:String>Yellow</x:String> - <x:String>White</x:String> - </muxc:RadioButtons> -</StackPanel> +<muxc:RadioButtons x:Name="BackgroundRadioButtons" SelectedIndex="$(BackgroundRadioButtonsSubstitution)" MaxColumns="3" Header="Background" SelectionChanged="BackgroundColor_SelectionChanged"> + <x:String>Green</x:String> + <x:String>Yellow</x:String> + <x:String>White</x:String> +</muxc:RadioButtons> +<muxc:RadioButtons x:Name="BorderRadioButtons" SelectedIndex="$(BorderRadioButtonsSubstitution)" MaxColumns="3" Header="Border" SelectionChanged="BorderBrush_SelectionChanged"> + <x:String>Green</x:String> + <x:String>Yellow</x:String> + <x:String>White</x:String> +</muxc:RadioButtons> + + + + From f959ec1a7ae942f2301826bd2851cad410ae6ebb Mon Sep 17 00:00:00 2001 From: Steven Moyes Date: Mon, 13 Jul 2020 16:51:25 -0700 Subject: [PATCH 6/6] Responding to PR feedback --- XamlControlsGallery/ControlPages/RadioButtonPage.xaml | 2 +- XamlControlsGallery/DataModel/ControlInfoData.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/XamlControlsGallery/ControlPages/RadioButtonPage.xaml b/XamlControlsGallery/ControlPages/RadioButtonPage.xaml index ad0e4053c..9630f56c3 100644 --- a/XamlControlsGallery/ControlPages/RadioButtonPage.xaml +++ b/XamlControlsGallery/ControlPages/RadioButtonPage.xaml @@ -27,7 +27,7 @@
-<muxc:RadioButtons> +<muxc:RadioButtons Header="Options:"> <RadioButton Content="Option 1" Checked="RadioButton_Checked"/> <RadioButton Content="Option 2" Checked="RadioButton_Checked"/> <RadioButton Content="Option 3" Checked="RadioButton_Checked"/> diff --git a/XamlControlsGallery/DataModel/ControlInfoData.json b/XamlControlsGallery/DataModel/ControlInfoData.json index a7f3b2e5a..523017533 100644 --- a/XamlControlsGallery/DataModel/ControlInfoData.json +++ b/XamlControlsGallery/DataModel/ControlInfoData.json @@ -1353,9 +1353,9 @@ { "UniqueId": "RadioButtons", "Title": "RadioButtons", - "Subtitle": "A control that displays a group of related RadioButton controls with keyboarding and accessibility support.", + "Subtitle": "A control that displays a group of mutually exclusive options with keyboarding and accessibility support.", "ImagePath": "ms-appx:///Assets/RadioButtons.png", - "Description": "A control that displays a group of related RadioButton controls with keyboarding and accessibility support.", + "Description": "A control that displays a group of mutually exclusive options with keyboarding and accessibility support.", "Content": "

Look at the RadioButtonsPage.xaml file in Visual Studio to see the full code for this page.

", "IsNew": true, "Docs": [