﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » .NET Forums » General .NET Discussion  » Question about inheritance and designer behaviour</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Thu, 28 May 2026 09:56:25 GMT</lastBuildDate><ttl>20</ttl><item><title>Question about inheritance and designer behaviour</title><link>http://forum.strataframe.net/FindPost22141.aspx</link><description>I'm confused about how properties work within the designer.&lt;br&gt;
&lt;br&gt;
If I have a form and I add a public property to the form, after I build the assembly, the property is there in the property &amp;#119;indow.  &lt;br&gt;
&lt;br&gt;
However, if I have a BO or a UserControl and I add a property, after I build the assembly, the property isn't in the property windows of the UserControl or BO itself.  It will be in the property window of an instance I've dropped on a form or some other container, but not in the designer for the object itself.  The property will also show up in the property window of any sub-classed objects.&lt;br&gt;
&lt;br&gt;
So, what determines what ends up in that little property window?</description><pubDate>Wed, 17 Jun 2009 16:14:36 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: Question about inheritance and designer behaviour</title><link>http://forum.strataframe.net/FindPost23564.aspx</link><description>LOL...most likely this is what I mentioned in my previous post.  Let me know if you want to tinker with this some more.  It will require some time to get it setup and troubleshoot...but I already know that it has to do with reflection.</description><pubDate>Wed, 17 Jun 2009 16:14:36 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Question about inheritance and designer behaviour</title><link>http://forum.strataframe.net/FindPost23560.aspx</link><description>Here is is, for the time being I got around&amp;nbsp;the problem&amp;nbsp;by declaring it again as SHADOWS in my 2nd level BO, at least if I decide to change it someday that will give me a nice fat compile error. &lt;P&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#008000 size=2&gt;''' &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;&lt;FONT color=#808080 size=2&gt;&amp;lt;summary&amp;gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#008000 size=2&gt;''' Sets the required field dispay type&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#008000 size=2&gt;''' &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;&lt;FONT color=#808080 size=2&gt;&amp;lt;/summary&amp;gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&amp;lt;Category(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;"SDSI: Custom Settings"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;)&amp;gt; _&lt;/P&gt;&lt;P&gt;&amp;lt;Description(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;"Set the type of required field indicator."&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;)&amp;gt; _&lt;/P&gt;&lt;P&gt;&amp;lt;DefaultValue(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;True&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;)&amp;gt; _&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Public&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Property&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; sdsi_RequiredFieldIndicatorType() &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; RequiredFieldIndicatorType&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Get&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Return&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;.p_RequiredFieldIndicatorType&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Get&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Set&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;ByVal&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; value &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; RequiredFieldIndicatorType)&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;.p_RequiredFieldIndicatorType = value&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Set&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Property&lt;/FONT&gt;&lt;/FONT&gt;</description><pubDate>Wed, 17 Jun 2009 15:19:26 GMT</pubDate><dc:creator>Keith Chisarik</dc:creator></item><item><title>RE: Question about inheritance and designer behaviour</title><link>http://forum.strataframe.net/FindPost23558.aspx</link><description>What does your property definition look like?  Do you have a ReflectionPropertyDescriptor (or any property descriptor) setup for these custom properties?  If so then you may be fighting good ol' reflection and inheritance issues.  There are times that you have to "re-expose" a property....however, it depends on how the properties are declared.  I would need some more information to be able to give you any real suggestions.</description><pubDate>Wed, 17 Jun 2009 15:13:05 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Question about inheritance and designer behaviour</title><link>http://forum.strataframe.net/FindPost23557.aspx</link><description>update: this works fine (as described above) if A, B, and C BO's are in the same assembly together, then instantiated from another.&lt;/P&gt;&lt;P&gt;If I move A to another assembly I get the behavior described above.</description><pubDate>Wed, 17 Jun 2009 14:52:15 GMT</pubDate><dc:creator>Keith Chisarik</dc:creator></item><item><title>RE: Question about inheritance and designer behaviour</title><link>http://forum.strataframe.net/FindPost23555.aspx</link><description>If I&amp;nbsp;may&amp;nbsp;expand up on this a little to address multiple layers of inheritance.&lt;/P&gt;&lt;P&gt;I have a base BO with properties defined, business&amp;nbsp;objects that inherit from this base class have the properties visible in the designer when dropped on a form. Cool. Good stuff, no news here.&lt;/P&gt;&lt;P&gt;I now need to add another layer of inheritance so that:&lt;/P&gt;&lt;P&gt;BASE BO A - has a defined property that should be available to ALL BO's&lt;/P&gt;&lt;P&gt;BASE BO B - inherits from A and will have additional properties that only some BO's will ever need&lt;/P&gt;&lt;P&gt;BO C - inherits from B&lt;/P&gt;&lt;P&gt;My instance of B on the form does not have property as defined in A available in the designer, but I can reference/set it via code.&lt;/P&gt;&lt;P&gt;Why.. and how to fix?</description><pubDate>Wed, 17 Jun 2009 14:31:48 GMT</pubDate><dc:creator>Keith Chisarik</dc:creator></item><item><title>RE: Question about inheritance and designer behaviour</title><link>http://forum.strataframe.net/FindPost22183.aspx</link><description>Yup...you got it ;)</description><pubDate>Wed, 04 Mar 2009 07:40:49 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Question about inheritance and designer behaviour</title><link>http://forum.strataframe.net/FindPost22171.aspx</link><description>Oh...I think the light bulb just went off!&lt;br&gt;
&lt;br&gt;
So, when I look at a BO in design view, where I can get to the properties window, the BO I'm on isn't really being instantiated yet, thus properties of that BO aren't shown.  The same for a control or component, because the control itself isn't instantiated by the designer of that control.&lt;br&gt;
&lt;br&gt;
However, when plopped on a form or user control, the BO/control/component is instantiated by the designer and now the properties are available.  &lt;br&gt;
&lt;br&gt;
The reason that form/user control properties would show up in the designer is because the form/user control is actually instantiated by the designer, thus the properties are shown in that case.&lt;br&gt;
&lt;br&gt;
I think that is what's going on in any case.</description><pubDate>Tue, 03 Mar 2009 22:07:50 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: Question about inheritance and designer behaviour</title><link>http://forum.strataframe.net/FindPost22164.aspx</link><description>Inheritance can play a factor.&amp;nbsp; For example if you add properties to a form then inherit that frorm, they will be visible wihtin the designer.&amp;nbsp; However, ifyou create a control and never inherit it, as soon as you drop it on a form those properties (as an instance) will be available within the designer.&amp;nbsp; Ultimately it comes down to when the object is created as an instance, even for design-time purposes.</description><pubDate>Tue, 03 Mar 2009 13:24:31 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Question about inheritance and designer behaviour</title><link>http://forum.strataframe.net/FindPost22158.aspx</link><description>OK, that makes some sense. &lt;br&gt;
&lt;br&gt;
How does .NET determine this?  Is it by inheritance? Things inheriting from component and control have this behavior?</description><pubDate>Tue, 03 Mar 2009 11:36:05 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: Question about inheritance and designer behaviour</title><link>http://forum.strataframe.net/FindPost22152.aspx</link><description>A property defined on a control itself will never show up within a property designer.&amp;nbsp; The purpose of a control and a control property is for use on a parent container or form or object other than itself.&amp;nbsp; So these properties will only show up as an instance.&amp;nbsp; This actually makes a lot of sense as the logic behind these properties is going to happen within the instance.&amp;nbsp; &lt;/P&gt;&lt;P&gt;So like you mentioned, any defined properties on a control will not show up until created as an instance.&amp;nbsp; You can make properties show up on a control through a lot of work and editor logic....but I am not even going down this road on this thread as that is a HUGE conversation&amp;nbsp;in and of itself.</description><pubDate>Tue, 03 Mar 2009 08:03:00 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>