Skip to content

Commit

Permalink
* Extended the interface so that the control's name can be set
Browse files Browse the repository at this point in the history
 * Implemented extended interface in WPF/WidgetBackend.

This change is important for UI automation/UI testing tools like Microsoft Test Manager. These tools use the name of a control to identify it, without setting a name, at least Microsoft Test Manager will use the first control of that type that it encounters (for example: the minimize button)
  • Loading branch information
steffenWi committed Nov 3, 2015
1 parent 0d2ca45 commit 2f45218
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Xwt.WPF/Xwt.WPFBackend/WidgetBackend.cs
Expand Up @@ -178,6 +178,12 @@ protected virtual void SetWidgetColor (Color value)
set { Widget.Opacity = value; }
}

public string Name
{
get { return Widget.Name; }
set { Widget.Name = value; }
}

FontData GetWidgetFont ()
{
if (!(Widget is Control)) {
Expand Down
5 changes: 5 additions & 0 deletions Xwt/Xwt.Backends/IWidgetBackend.cs
Expand Up @@ -63,6 +63,11 @@ public interface IWidgetBackend: IBackend
/// <value><c>true</c> if sensitive; otherwise, <c>false</c>.</value>
bool Sensitive { get; set; }

/// <summary>
/// Gets or sets the name of this widget.
/// </summary>
string Name { get; set; }

/// <summary>
/// Gets or sets a value indicating whether this widget can get focus.
/// </summary>
Expand Down

0 comments on commit 2f45218

Please sign in to comment.