<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Editing custom types in the WPF Property Grid</title>
	<atom:link href="http://www.mindscapehq.com/blog/index.php/2008/01/23/editing-custom-types-in-the-wpf-property-grid/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mindscapehq.com/blog/index.php/2008/01/23/editing-custom-types-in-the-wpf-property-grid/</link>
	<description>The official blog of Mindscape</description>
	<lastBuildDate>Wed, 08 Feb 2012 09:29:30 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Mindscape - MindBlog</title>
		<link>http://www.mindscapehq.com/blog/index.php/2008/01/23/editing-custom-types-in-the-wpf-property-grid/comment-page-1/#comment-9816</link>
		<dc:creator>Mindscape - MindBlog</dc:creator>
		<pubDate>Thu, 24 Jan 2008 19:48:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.mindscape.co.nz/blog/?p=90#comment-9816</guid>
		<description>[...] wrote previously about editing custom types in the WPF Property Grid&#8212;how to extend the grid to provide a good editing experience for, [...]</description>
		<content:encoded><![CDATA[<p>[...] wrote previously about editing custom types in the WPF Property Grid&#8212;how to extend the grid to provide a good editing experience for, [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JD&#8217;s Blog &#187; Mindscape ships the WPF Property Grid</title>
		<link>http://www.mindscapehq.com/blog/index.php/2008/01/23/editing-custom-types-in-the-wpf-property-grid/comment-page-1/#comment-9747</link>
		<dc:creator>JD&#8217;s Blog &#187; Mindscape ships the WPF Property Grid</dc:creator>
		<pubDate>Thu, 24 Jan 2008 06:21:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.mindscape.co.nz/blog/?p=90#comment-9747</guid>
		<description>[...] has posted a a blog article about using custom editors with the Mindscape WPF Property Grid - I&#8217;d urge anyone interested in it to download the trial and then check out his article. Pass [...]</description>
		<content:encoded><![CDATA[<p>[...] has posted a a blog article about using custom editors with the Mindscape WPF Property Grid &#8211; I&#8217;d urge anyone interested in it to download the trial and then check out his article. Pass [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex Henderson</title>
		<link>http://www.mindscapehq.com/blog/index.php/2008/01/23/editing-custom-types-in-the-wpf-property-grid/comment-page-1/#comment-9721</link>
		<dc:creator>Alex Henderson</dc:creator>
		<pubDate>Thu, 24 Jan 2008 01:18:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.mindscape.co.nz/blog/?p=90#comment-9721</guid>
		<description>Not an immediate issue for me - was just wondering how that would be accomodated - being able to add the editors at run time would be more then enough to let me roll my own specific solution I would think :)</description>
		<content:encoded><![CDATA[<p>Not an immediate issue for me &#8211; was just wondering how that would be accomodated &#8211; being able to add the editors at run time would be more then enough to let me roll my own specific solution I would think :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ivan Towlson</title>
		<link>http://www.mindscapehq.com/blog/index.php/2008/01/23/editing-custom-types-in-the-wpf-property-grid/comment-page-1/#comment-9712</link>
		<dc:creator>Ivan Towlson</dc:creator>
		<pubDate>Wed, 23 Jan 2008 23:22:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.mindscape.co.nz/blog/?p=90#comment-9712</guid>
		<description>There&#039;s nothing built into the grid that inspects a type or property for an editor declaration; at the moment, it is left entirely up to the hosting application to figure out what editors to hook up.  But the application can certainly add editors at runtime from code.  This would go something like:

TypeEditor editor = new TypeEditor();
editor.EditedType = myType;
editor.EditorTemplate = GetEditorTemplate(myType);
myGrid.Editors.Add(editor);

Here I am assuming that the application has defined a GetEditorTemplate method which returns a suitable DataTemplate.  This might be implemented by inspecting an attribute on the custom type a la EditorAttribute, or by a naming convention, a configuration file mapping types to resources, or whatever.  Similarly, it might load the DataTemplate from embedded resources in the add-in DLL, from a resource in the hosting application, from a satellite DLL, or wherever.

Note that this does depend on the application having some way at runtime of getting the relevant types so it can hook them up.  If you know in advance which properties are going to have runtime-determined types, this is easy enough: just do a GetType() on the relevant values (and then go off and inspect their attributes or whatever).  But if the edited object has a complex, deeply nested structure, and/or you don&#039;t know at compile time which properties may have runtime-determined types, it could become tedious.  This use case wasn&#039;t on our list for v1, and offhand I don&#039;t think v1 provides any workaround easier than walking the graph yourself, but it sounds like a good candidate for the wishlist.  Let me know if this is an immediate issue for you.</description>
		<content:encoded><![CDATA[<p>There&#8217;s nothing built into the grid that inspects a type or property for an editor declaration; at the moment, it is left entirely up to the hosting application to figure out what editors to hook up.  But the application can certainly add editors at runtime from code.  This would go something like:</p>
<p>TypeEditor editor = new TypeEditor();<br />
editor.EditedType = myType;<br />
editor.EditorTemplate = GetEditorTemplate(myType);<br />
myGrid.Editors.Add(editor);</p>
<p>Here I am assuming that the application has defined a GetEditorTemplate method which returns a suitable DataTemplate.  This might be implemented by inspecting an attribute on the custom type a la EditorAttribute, or by a naming convention, a configuration file mapping types to resources, or whatever.  Similarly, it might load the DataTemplate from embedded resources in the add-in DLL, from a resource in the hosting application, from a satellite DLL, or wherever.</p>
<p>Note that this does depend on the application having some way at runtime of getting the relevant types so it can hook them up.  If you know in advance which properties are going to have runtime-determined types, this is easy enough: just do a GetType() on the relevant values (and then go off and inspect their attributes or whatever).  But if the edited object has a complex, deeply nested structure, and/or you don&#8217;t know at compile time which properties may have runtime-determined types, it could become tedious.  This use case wasn&#8217;t on our list for v1, and offhand I don&#8217;t think v1 provides any workaround easier than walking the graph yourself, but it sounds like a good candidate for the wishlist.  Let me know if this is an immediate issue for you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex Henderson</title>
		<link>http://www.mindscapehq.com/blog/index.php/2008/01/23/editing-custom-types-in-the-wpf-property-grid/comment-page-1/#comment-9709</link>
		<dc:creator>Alex Henderson</dc:creator>
		<pubDate>Wed, 23 Jan 2008 22:26:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.mindscape.co.nz/blog/?p=90#comment-9709</guid>
		<description>What we would be the approach to dealing with this in a non-markup manor i.e. I have add-ins loaded at run time, which have their own strongly typed configuration classes and custom types - is there an equivalent to say the way WinForms does it with UITypeEditor, something that could be done with code attributes and embedded resources?

Looking great by the way :) very impressed.</description>
		<content:encoded><![CDATA[<p>What we would be the approach to dealing with this in a non-markup manor i.e. I have add-ins loaded at run time, which have their own strongly typed configuration classes and custom types &#8211; is there an equivalent to say the way WinForms does it with UITypeEditor, something that could be done with code attributes and embedded resources?</p>
<p>Looking great by the way :) very impressed.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: basic (Requested URI is rejected)
Database Caching 4/14 queries in 0.013 seconds using disk: basic
Content Delivery Network via cdn.mindscapehq.com

Served from: www.mindscapehq.com @ 2012-02-08 16:34:22 -->
