Skip to content

Commit

Permalink
Add virtual XwtComponent.Name
Browse files Browse the repository at this point in the history
Lets allow naming for all components, which
can be overriden with some useful backend
implmentation.
  • Loading branch information
sevoku committed Dec 28, 2015
1 parent 4adb26f commit 2acb8f2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Xwt/Xwt/Widget.cs
Expand Up @@ -590,7 +590,7 @@ public void Hide ()
/// <value>The widgets name.</value>
/// <remarks>The name can be used to identify this widget by e.g. designers.</remarks>
[DefaultValue (null)]
public string Name {
public override string Name {
get { return Backend.Name; }
set { Backend.Name = value; }
}
Expand Down
10 changes: 9 additions & 1 deletion Xwt/Xwt/XwtComponent.cs
Expand Up @@ -73,10 +73,18 @@ protected virtual BackendHost CreateBackendHost ()
get { return backendHost.Backend; }
}

/// <summary>
/// Gets or sets the name of this component.
/// </summary>
/// <value>The components name.</value>
/// <remarks>The name can be used to identify this component by e.g. designers.</remarks>
[DefaultValue (null)]
virtual public string Name { get; set; }

/// <summary>
/// A value, that can be used to identify this component
/// </summary>
public object Tag { get; set; }
virtual public object Tag { get; set; }

/// <summary>
/// Maps an event handler of an Xwt component to an event identifier.
Expand Down

0 comments on commit 2acb8f2

Please sign in to comment.