-
Notifications
You must be signed in to change notification settings - Fork 79
[SegmentedControl] Adding AutoSelection and high contrast improvements #374
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
Conversation
components/SegmentedControl/src/Segmented/Segmented.Properties.cs
Outdated
Show resolved
Hide resolved
components/SegmentedControl/src/Segmented/Segmented.Properties.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Arlo <[email protected]>
michael-hawker
left a comment
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.
Ugh, silly GitHub requires a comment here if you do things out of order... 😋
|
@niels9001 FYI, I noticed you had some usages of if (element is SegmentedItem segmentedItem)
{
segmentedItem.Loaded += SegmentedItem_Loaded;
} |
|
FYI @niels9001 I noticed at different DPI (150?) the padding (gaps) is off: |
|
Same C# // Only do stuff if the index is actually changing
if (index != previousIndex && ContainerFromIndex(index) is SegmentedItem newItem)
{
newItem.Focus(FocusState.Keyboard);
retVal = true;
}
}
return retVal;
}
private SegmentedItem? GetCurrentContainerItem()
{
if (ControlHelpers.IsXamlRootAvailable && XamlRoot != null)
{
return FocusManager.GetFocusedElement(XamlRoot) as SegmentedItem;
}
else
{
return FocusManager.GetFocusedElement() as SegmentedItem;
}
} |
|
@niels9001 was looking into the selection issue with Was investigating if we could simplify the logic here than trying to check everytime an item is loaded if we've set the index. Will think about it more Monday. (Though I'm also still surprised we have to do anything special here. I mean |
…Toolkit/Labs-Windows into niels9001/segmented-hc
michael-hawker
left a comment
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.
Tested on UWP and WinAppSDK, looks great.
components/SegmentedControl/samples/SegmentedControlStylesSample.xaml
Outdated
Show resolved
Hide resolved
|
@Arlodotexe feel free to take a quick poke if you'd like and/or just merge. |



See #392
This PR introduces the following changes:
Adds the AutoSelection property (by default the first item will be selected - this can be disabled if needed)

High contrast improvements
