Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net Web Controls (http://www.velocityreviews.com/forums/f63-asp-net-web-controls.html)
-   -   Designer Property Serialization -- Sycning inner properties to designer property window (http://www.velocityreviews.com/forums/t780046-designer-property-serialization-sycning-inner-properties-to-designer-property-window.html)

Alexander Higgins 07-21-2007 12:58 AM

Designer Property Serialization -- Sycning inner properties to designer property window
 
Hi,

I am just getting started developing custom user controls, and I am
having issues keep the inner properties of nested controls in sync
with the properties in the designer window. When I change a property
of a nested control in the properties window, the designer does not
automatically redraw itself. If I switch to HTML Mode and then return
to design mode, the control is redrawn. But If I switch back to HTML
Mode the inner properties are not updated.

However, If I change a property of my custom control or the font-bold
property of the nested control in the design window, the nested
control is refreshed and the inner properties are correctly updated.
How do I keep the two in sync? Am I missing something here? Do I
need to implement a TypeConverter and set NotifyParentProperty(True)
to keep the designer in sync with the properties window. If I do, how
can I implement one for web controls as I will have several controls
and do not feel like coding a wrapper for every property of every
control on the page. Or, is there some why to manually fire the event
that is raised when the nested control's font-bold is changed in the
properties window.

Also, what is the difference between refresh.repaint and refresh.all.
Does one only redraw the control on the designer while the other
recreates the controls properties and then redraws the control on the
designer?

Here is my code in the simplest form. Thanks for the help in
advance...

Imports System.ComponentModel
Imports System.Web.UI
Imports System.Web.UI.WebControls
<Assembly: TagPrefix("Editor", "cms")>
<ParseChildren(True), Designer("System.Web.UI.Design.ControlDesigner,
System.Design"), DefaultProperty("Text"), ToolboxData("<cms:Editor
runat=server></cms:Editor>"),
RefreshProperties(RefreshProperties.Repaint)> Public Class Editor
Inherits System.Web.UI.WebControls.WebControl
Implements INamingContainer

Dim _text As String

<Bindable(True), Category("Appearance"), DefaultValue("")>
Property [Text]() As String
Get
Return _text
End Get

Set(ByVal Value As String)
_text = Value
End Set

End Property
Private _TitleLabel As Label
<Category("CMS"), Bindable(True),
DesignerSerializationVisibility(DesignerSerializat ionVisibility.Visible),
RefreshProperties(RefreshProperties.Repaint),
NotifyParentProperty(True),
PersistenceMode(PersistenceMode.InnerProperty)> _
Public Property [TitleLabel]() As Label
Get

Return _TitleLabel
End Get
Set(ByVal Value As Label)

_TitleLabel = Value
Me.ChildControlsCreated = False
Me.EnsureChildControls()

End Set
End Property



All times are GMT. The time now is 07:52 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.