This repository was archived by the owner on May 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add Radiobutton.RadioColor #10411
Closed
Closed
Add Radiobutton.RadioColor #10411
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
e73d2d7
Implemented iOS
jfversluis 18a0fa1
Implemented Android
jfversluis 70b6384
Implement UWP
jfversluis 26889c1
Merge branch 'radiobutton-radiocolor' of github.com:xamarin/Xamarin.F…
jfversluis 62196f7
Update RadioButtonRenderer.cs
jfversluis 9c898f7
Update Xamarin.Forms.Platform.UAP/Resources.xaml
jfversluis 0e0b306
Update Xamarin.Forms.Platform.UAP/Resources.xaml
jfversluis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
Xamarin.Forms.Controls/GalleryPages/RadioButtonGalleries/ColoredRadioGallery.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
using System; | ||
namespace Xamarin.Forms.Controls.GalleryPages.RadioButtonGalleries | ||
{ | ||
public class ColoredRadioGallery : ContentPage | ||
{ | ||
readonly Random _rand = new Random(); | ||
readonly RadioButton _radioButton = new RadioButton | ||
{ | ||
Text = "I can change color", | ||
RadioColor = Color.Red | ||
}; | ||
|
||
readonly RadioButton _radioButtonDisabled = new RadioButton | ||
{ | ||
Text = "I'm disabled", | ||
IsEnabled = false | ||
}; | ||
|
||
public ColoredRadioGallery() | ||
{ | ||
var stackLayout = new StackLayout | ||
{ | ||
VerticalOptions = LayoutOptions.Center, | ||
HorizontalOptions = LayoutOptions.Center | ||
}; | ||
|
||
var button = new Button | ||
{ | ||
Text = "Change color" | ||
}; | ||
|
||
button.Clicked += Button_Clicked; | ||
|
||
stackLayout.Children.Add(button); | ||
stackLayout.Children.Add(_radioButton); | ||
stackLayout.Children.Add(_radioButtonDisabled); | ||
|
||
Content = stackLayout; | ||
} | ||
|
||
void Button_Clicked(object sender, EventArgs e) | ||
{ | ||
var c = Color.FromRgb(_rand.Next(256), _rand.Next(256), _rand.Next(256)); | ||
_radioButton.RadioColor = c; | ||
_radioButtonDisabled.RadioColor = c; | ||
} | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we just call it Color?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m fine with anything really. I just figured it would make it more clear with RadioColor to what it refers.
And it’s a bit more consistent with other properties like
BackgroundColor
orTextColor
etc."Radio" might not be the best, but I guess it's called
RadioButton
for a reason. So that thing is called the Radio, right? :PThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I expected
Color
as well...