[SegmentedControl] Adding AutoSelection and high contrast improvements#374
[SegmentedControl] Adding AutoSelection and high contrast improvements#374Arlodotexe merged 20 commits intomainfrom
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 <arlo.godfrey@outlook.com>
michael-hawker
left a comment
There was a problem hiding this comment.
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.
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
