design-time

Designing WPF UserControl that gets its DataContext from outer controls: What is best practice to have some sample data in designer but use inherited DC at runtime?

Hi, I am designing a WPF user control which contains other user controls (imagine a WidgetContainer, containing different Widgets) - using M-V-VM architecture. During development, I have WidgetContainerView in a window, window (View) spawns a WidgetContainerViewModel as its resource, and in a parameterless constructor of WidgetContainer...

Can the Visual Studio properties editor reference a property to component in another form (or class)?

As a Delphi developer moving to .NET I'm expecting similar concept like TDataModule & TForm to be available. However, I could not find way to make a reference from a component on a Form to another component on another Form (or Component) class. I understand technical difference underlying the issue. Delphi component architecture is ...

Limit the size of a user control at design time

I have a namespace Company.UI.Forms where we have a form base class BaseForm that inherits from System.Windows.Forms.Form. I need to limit the size of this form, so that if a concrete form, say ExampleForm, derives from BaseForm, it should have a fixed size in the VS designer view. The fixed size should be set or defined in some way (i...

How can I avoid properties being reset at design-time in tightly bound user controls?

I have UserControl 'A' with a label, and this property: /// <summary> /// Gets or Sets the text of the control /// </summary> [ Browsable(true), EditorBrowsable(EditorBrowsableState.Always), Category("Appearance") ] public override string Text { get { return uxLabel.Tex...

Adding controls dynamically at design time vb.net

I have been developing some custom smart tags. I am using a DesignerActionMethodItem which gets me to a fired method in code. When I try to hit the controls.Add the control is added but it seems the designer is unaware of it. It is never serialized and it goes away when the form is refreshed in the designer. Any help would be greatly...

Why do I get EntryPointNotFoundExceptions in Visual Studio's form designer?

I did some refactoring of an application framework, and now the form designer behaves in a weird way - after a rebuild, it crashes with a EntryPointNotFoundException until Visual Studio is started again. Background The framework consists of several projects, all in one solution. The projects have several dependencies between each other...

Smart Tags: what you can do when a Method in DesignerActionList is invoked?

Context: Visual Studio : C# : Windows Forms : design time : using a custom UserControl that implements Smart Tags which you have placed in a container (Window or Panel) on a Form in your current project : .NET FrameWork >= 3.5 Hi, Pease keep in mind everything I am describing is happening at Design Time. I am clear how to create a Sma...

C# ParentControlDesigner: Resize handles don't move on Resize by WndProc

I'm creating a collapsible panel control in C# and would like the expand/collapse button to function during design-time as well as run-time. I've gotten this to work fairly well, except that when the control resizes from clicking the button, the resize handles in the designer don't move. When you click on something else and then click ...

create design time controls with smart tag

Ok I have been working on this idea of a control that I have. I want the control to be able to add other controls to the form that it is on at design time. I am having a hell of a time trying to figure this out. I decided if nothing else I will just serialize to the code behind file myself. The only issue is I can't seem to get the l...

providing designtime ViewModel data for Blend and VS

In a MVVM based application, what options do I have to provide ViewModel data at design time, so our designers can actually see something in Blend3 (and VS 2008). How are you doing this? Can I utilize mc:ignorable for this somehow? ...

Can a C# control have a Design Time only property?

Hello, I wish to allow the user of my control to choose the licensing method for the control. The choice comes from an enumeration, so they must choose one of the methods I have laid out for them. This license needs to be chosen prior to the code executing at runtime. Therefore I wish for them to selected a value at design time. Fu...

Why are many Designer classes in System.Design marked as internal?

I have been developing some components for our products at work, and one of them is based off the flow layout panel. What i would like to do is provide a custom designer for it, but without loosing the features provided by it's default designer (System.Windows.Forms.Design.FlowLayoutPanelDesigner) which is marked as internal. Using Ref...

Are Expression Blend design-time specific visuals possible?

I'm trying to design some UserControl classes in Blend 3. I want parts of them to be "collapsed" when created at runtime, but I want to be able to edit their component parts without fiddling with code every time I want to build. It works with sample datasources, as the following example illustrates. But it doesn't appear to work with ot...

Design-time editor support for controls collection

I'd like to add a property which represents a collection of controls to a component and have a collection editor with which I can easily select the controls that belong to the collection. VS does almost what I want automatically with the following code: Private _controls As New List(Of Control) <DesignerSerializationVisibility(D...

Is it possible for a custom asp.net control to load types at design time from the assembly hosting the control?

I have a custom server control for asp.net. One of the properties available to it is a generic object. That generic object has custom attributes that are read and used to customize the rendering of the control. At run time, this is no problem, since all I need to do is find all the attributes on the instance that gets passed into the ...

Adding "Reset" Command to a Control's Extended Property in Property Grid

I have an Extender component of IExtenderProvider which extends a TextBox to have a "selected color". The default value for this color is "highlight". The user can change the "default selected color" in the Extender's property grid. If no extended TextBox has "selected color" defined, it will use the specified "default deleted color" val...

Design-Time drag and drop.

Hello everyone, I'm currently working of a project where my part is to design a Design Surface where the end user can add/remove/move controls at run-time. I followed this tutorial "Hosting Windows Forms Designers, by Tim Dawson", and almost have implemented all the features I need. Short story for those who don't want to read the tut...

Creating a ToolBox component with design-time support using a UserControl

I have a UserControl for Windows Forms. How can I convert it to a component? What I want to do is, to add it to the VS toolbox, add it to form with drag and drop at design-time and change its Location and Dock properties using the Properties window. What should I look for to do this? I've created something similar before but it was a Co...

How can I make a component disappear in the form designer?

I'm creating a custom control that contains other controls, including two scroll bars, one horizontal, one vertical. There's a property to set one or both scroll bars invisible, which works fine at runtime, but at design-time it doesn't disappear from the form designer when I set the property. Now, I can understand how this could be a ...

Change the order of property serialization at design time in .Net

I have a class where it's problematic to relay on the properties being serialized in alphabetical order at design time. In other words, property Z must be serialized before property A. The problem arises because property property Z clears property A whenever it changes - which happens in InitializeComponent. I work around this problem b...