User Property Designer Properties

For C # UserControl on Windows Mobile (although please answer if you know it for full Windows ... this might work), how do you change what is displayed in the "Designer Properties" window for one of the public properties of the control. For example:

private Color blah = Color.Black; public Color Blah { get { return this.blah; } set { this.blah = value; } } 

This is displayed for the control, but it belongs to the Miscellaneous category and has no description or default value. I tried using the settings in System.ComponentModel as "DesignerCategory", for example:

 [DesignerCategory("Custom")] 

But says that this is only valid for class declarations ... maybe swore that these were System.ComponentModel elements that I used before ...

Update:

@ John said:

DesignerCatogy is used to say class is a form, component, etc.

Try the following:

[Category ("Custom")]

Is there any specific namespace that I need to use to get them? I tried them for sure, and the compiler does not recognize them.

In .NETCF, everything that seems to me is accessible from System.ComponentModel:

 DataObject, DataObjectMethod, DefaultValue, DesignerCategory, DesignTimeVisible, EditorBrowsable 

The only thing he doesn't yell at is EditorBrowsable

+6
c # windows-mobile user-controls
source share
3 answers

Is this good for you? I am not involved in CF development, but it looks like you need to add some XML metadata to enable it:

http://blogs.msdn.com/bluecollar/archive/2007/02/08/adding-compact-framework-design-time-attributes-or-more-fun-with-textboxes.aspx

Interesting reading .. It looks like a lot of time for design support has been removed from CF because you don't design them on devices. What seems strange to me ... Can't imagine a PDA as a development platform?

Scroll about half way for good stuff;)

+2
source share

DesignerCatogy is used to say if a class is a form, component, etc.

For full windows you need the attribute:

[System.ComponentModel.Category ("Custom")]

and for description you can use [System.ComponentModel.Description ("This description")]

use both together

[System.ComponentModel.Category ("Custom"), System.ComponentModel.Description ("This Description")]

However, this is part of system.dll, which may differ for Windows Mobile.

+3
source share

The article does not say that someone is designing a device. However, when creating a Compact Framework project, the compact structure (for your desktop PC) is used to handle the rendering of design time. If you think about it, this is what you expect. The same structure (or almost the same) is used for rendering both on your PC at design time and later on the device at run time. The problem is that development-time attributes were not added to the compact structure (I suppose to reduce the size).

0
source share

All Articles