You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
669 B
31 lines
669 B
using System; |
|
using System.Windows; |
|
using ICSharpCode.WpfDesign.PropertyGrid; |
|
using ICSharpCode.WpfDesign.Designer.Services; |
|
|
|
namespace ICSharpCode.WpfDesign.AddIn |
|
{ |
|
[PropertyEditor(typeof(FrameworkElement), "DataContext")] |
|
public partial class ObjectEditor |
|
{ |
|
public ObjectEditor() |
|
{ |
|
InitializeComponent(); |
|
} |
|
|
|
public PropertyNode PropertyNode { |
|
get { return DataContext as PropertyNode; } |
|
} |
|
|
|
protected override void OnClick() |
|
{ |
|
var s = PropertyNode.Services.GetService<ChooseClassServiceBase>(); |
|
if (s != null) { |
|
var c = s.ChooseClass(); |
|
if (c != null) { |
|
PropertyNode.Value = Activator.CreateInstance(c); |
|
} |
|
} |
|
} |
|
} |
|
} |