-
Notifications
You must be signed in to change notification settings - Fork 697
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RadioButtons doesn't respect BorderThickness or BorderBrush property #3247
Comments
@Muziburrahman I agree that these properties should have an effect: <RadioButtons Header="Options header"
BorderBrush="Gray" BorderThickness="2">
<x:String>Option 1</x:String>
<x:String>Option 2</x:String>
<x:String>Option 3</x:String>
<RadioButtons> Alongside the <RadioButtons Header="Options header"
BorderBrush="Gray" BorderThickness="2"
Background="DodgerBlue"
Padding="5"
CornerRadius="4">
<x:String>Option 1</x:String>
<x:String>Option 2</x:String>
<x:String>Option 3</x:String>
<RadioButtons> If we decide to respect these APIs, we should also consider adding matching theme resources like
@StephenLPeters @YuliKl FYI. Open questionsShould we respect the <RadioButtons Background="DodgerBlue">
<x:String>Option 1</x:String>
<x:String>Option 2</x:String>
<x:String>Option 3</x:String>
<RadioButtons> And with a header: That looks fine to me. |
Also it should have a default Padding. Without padding it looks ugly. |
I don't think we need the resources right? we add resources for customization points on template parts which are not exposed on the root control. These customization points will be settable on RadioButtons' without a resource. |
I agree. I think it would be just creating those properties and then TemplateBinding them with the root StackPanel. |
@StephenLPeters I suggested creating resources because that would match the current resource system. The |
ButtonBackground is used as the default value for the Background property (via a setter). This is useful for two reasons; First it allows us to pick a non-standard default value, second it allows an app to change all of their button's backgrounds by setting the ButtonBackground resource. In this case I don't think that we should be choosing a non-standard default value, however the second reason I think is still applicable. @MikeHillberg do you have thoughts? |
@kikisaints to weigh in for light weight styling here. |
I agree we should have lightweights styling resources for this control. Even if the default is transparent. Looking at generic.xaml for RadioButton (non-plural) we have the following definitions: ...
<StaticResource x:Key="RadioButtonBackground" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonBackgroundPointerOver" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonBackgroundPressed" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonBackgroundDisabled" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonBorderBrush" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonBorderBrushPointerOver" ResourceKey="SystemControlTransparentBrush" />
... They may all be set to transparent because they are not being used in our current design system definition, however I don't think that negates the need for them to be available. We should have something similar for RadioButtons as well. |
@StephenLPeters Would you be fine with me tackling both this issue and #3350 in a single PR so we won't get merge conflicts to hold us back? (I.e. I would add new API tests to cover both issues which would create merge conflicts if we have two separate PRs.) Or would you favor a clear separation here even if that means merge conflicts will block PR merge for a short time? Edit: I think I will just create two PRs as usual. |
Either way is fine with me. |
@kikisaints @StephenLPeters I am thinking about not adding a Pressed visual state for the RadioButtons control (so no *Pressed theme resources like Customers could still use the So, for now I plan to add theme resources for the normal visual state (default background, border brush), the PointerOver visual state and the Disabled visual state. If, for example, the mouse pointer enters the RadioButtons control, then we enter the PointerOver visual state. If the customer then clicks somewhere on the RadioButtons UI surface (i.e. a RadioButton) we remain in the PointerOver visual state (as there is no Pressed visual state): <muxc:RadioButtons
BorderBrush="LightGray"
BorderThickness="2"
Padding="5"
CornerRadius="4"
Header="RadioButtons control">
<muxc:RadioButtons.Resources>
<SolidColorBrush x:Key="RadioButtonsBackgroundPointerOver" Color="DodgerBlue"/>
<SolidColorBrush x:Key="RadioButtonsBorderBrushPointerOver" Color="Gray"/>
</muxc:RadioButtons.Resources>
<x:String>Option 1</x:String>
<x:String>Option 2</x:String>
</muxc:RadioButtons> If we aren't already in the PointerOver visual state when clicking on the RadioButtons control then we will remain in the current visual state. Your thoughts? |
@kikisaints Friendly ping. |
Yeah, it's a bit odd that the control is just using a StackPanel with no properties set as it's container. All the Border type properties should at least by using |
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
Setting these two properties has no effect on the Control.
I am not sure if it's bug or just intentionally designed in this way.
The text was updated successfully, but these errors were encountered: