Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FZEditor]Highlight distance range: slider and fix narrator (#19840)
* announce corrected value * tooltip * slider * announce value * custom slider announce * slider slyle * announce range * show current value
- Loading branch information
1 parent
b6fe34c
commit 8cea22a
Showing
8 changed files
with
172 additions
and
15 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
src/modules/fancyzones/editor/FancyZonesEditor/Controls/CustomSlider.xaml
This file contains 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,5 @@ | ||
<Slider x:Class="FancyZonesEditor.Controls.CustomSlider" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="clr-namespace:FancyZonesEditor.Controls"> | ||
</Slider> |
26 changes: 26 additions & 0 deletions
26
src/modules/fancyzones/editor/FancyZonesEditor/Controls/CustomSlider.xaml.cs
This file contains 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,26 @@ | ||
// Copyright (c) Microsoft Corporation | ||
// The Microsoft Corporation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
namespace FancyZonesEditor.Controls | ||
{ | ||
using System.Windows; | ||
using System.Windows.Automation.Peers; | ||
using System.Windows.Controls; | ||
|
||
/// <summary> | ||
/// Interaction logic for CustomSlider.xaml | ||
/// </summary> | ||
public partial class CustomSlider : Slider | ||
{ | ||
public CustomSlider() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
protected override AutomationPeer OnCreateAutomationPeer() | ||
{ | ||
return new CustomSliderAutomationPeer(this); | ||
} | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
src/modules/fancyzones/editor/FancyZonesEditor/Controls/CustomSliderAutomationPeer.cs
This file contains 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,41 @@ | ||
// Copyright (c) Microsoft Corporation | ||
// The Microsoft Corporation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
namespace FancyZonesEditor.Controls | ||
{ | ||
using System.Globalization; | ||
using System.Windows.Automation.Peers; | ||
using System.Windows.Controls; | ||
|
||
internal class CustomSliderAutomationPeer : SliderAutomationPeer | ||
{ | ||
public CustomSliderAutomationPeer(Slider owner) | ||
: base(owner) | ||
{ | ||
} | ||
|
||
protected override string GetNameCore() | ||
{ | ||
var element = this.Owner as Slider; | ||
if (element == null) | ||
{ | ||
return string.Empty; | ||
} | ||
|
||
string announce = string.Format( | ||
CultureInfo.CurrentCulture, | ||
Properties.Resources.Distance_adjacent_zones_slider_announce, | ||
element.Minimum, | ||
element.Maximum, | ||
element.Value); | ||
|
||
return announce; | ||
} | ||
|
||
protected override AutomationControlType GetAutomationControlTypeCore() | ||
{ | ||
return AutomationControlType.Custom; | ||
} | ||
} | ||
} |
This file contains 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 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 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
29 changes: 28 additions & 1 deletion
29
src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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