designer

VS2010: How to avoid Windows Forms designer problems when working with inherited user controls?

一个人想着一个人 提交于 2019-12-04 05:45:16
Problem: The Windows Forms designer does not work for an inherited user control when the base class is implementing an interface from another assembly. Platform: VS 2010 SP1, .NET 4.0 Framework Error: The designer could not be shown for this file because none of the classes within it can be designed. The designer inspected the following classes in the file: MyControl --- The base class 'MyBaseControlLib.MyBaseControl' could not be loaded. Ensure the assembly has been referenced and that all projects have been built. at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader

In Designer: Property default value is set, but property isn't called while setting default?

我的梦境 提交于 2019-12-04 04:01:01
问题 I have a piece of code that goes something like this: [DefaultValue(false)] public bool Property { set { blah = value; someControl.Visible = value; } get { return blah; } } When I look at the properties in the designer, the property is set to false (or true if I play with it). But the property isn't actually set. The Visible value of the control isn't changed. How can I make the designer actually set the property with the default value ? 回答1: The [DefaultValue] attribute is only a hint to the

Does Xamarin.Forms have designer support on VS?

爱⌒轻易说出口 提交于 2019-12-04 03:03:58
问题 I recently downloaded Xamarin.Forms as Microsoft made it free. I am looking around in Visual Studio for a visual designer, that is usually included in Xamarin.Droid and Xamarin.IOS. Is there no such feature for Xamarin.Forms? Surely I must be missing something ? 回答1: Xamarin does not have a designer for Xamarin.Forms at this time, but is working on the Xamarin.Forms Previewer which renders a live preview of a Xamarin.Forms page side-by-side with the XAML markup directly inside the Visual

XAML : How to change background color only in Design mode?

↘锁芯ラ 提交于 2019-12-04 01:20:50
问题 I have a control with white text foreground color and transparent background color. Later on this usercontrol will be added into a different control that carries the real background color. However during designing this, control due white foreground on white background in VS 2010, I can't obviously see anything. In there anyway to define a different color for just the design time? I have tried this: if (System.ComponentModel.DesignerProperties.IsInDesignTool) { LayoutRoot.Background = new

.NET Configuration Section Designer - Where is my collection?

会有一股神秘感。 提交于 2019-12-03 20:58:47
I am using the Configuration Section Designer for .NET to build a simple ConfigurationElementCollection . It appears that everything builds just fine and the code is automatically generated since the sub-elements are visible with Intellisense. Unfortunately, even though I have added elements to the collection in the configuration section, they do not exist at run-time; it shows the collection's Length property to be 0 - i.e. the collection is empty even though, as you can see in my example XML, I have clearly put them there: Example configuration <logParserSettings xmlns="LogParser">

How to stop visual studio from opening my winforms controls in the designer

折月煮酒 提交于 2019-12-03 12:26:46
When I want to edit/view the code for a winforms control/form i created, I need to right-click in the solution and select "view code". The default action for opening the file is "view designer". This appears to be the case for any C# file containing a class that inherits from a winforms control, even if this is indirectly. The daft thing is that VS does this if it can't run the designer (for instance when the control is not the first class in the file). Is there hint or attribute or workaround to stop VS from doing this? Right-click on a file in your solution Select "Open With..." Select

Making the Visual Studio designer ignore a public property

核能气质少年 提交于 2019-12-03 11:18:23
I have a UserControl with a public property using the following attributes: [Browsable(false)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] I have tried deleting the owner form, re-creating a fresh form in Visual Studio 2010, and adding this UserControl to the form. It keeps adding a line like the following in the Designer file: this.vMyUserControl.MyProperty = ((MyNamespace.MyClass)(resources.GetObject("vMyUserControl.MyProperty"))); This crashes my application because this property is not designed to be created by serialization. Making the property read only at

Visual Studio 2010 Designer Error on Run

天涯浪子 提交于 2019-12-03 09:11:02
问题 I am using using VS2010 and if I have a form open in designer mode and run my application the designer tab will no longer show the form designer but instead an error will be displayed (and it is only fixed by restarting the IDE) saying: "To prevent possible data loss before loading the designer, the following errors must be resolved:" 1 Error: "The designer could not be shown for this file because none of the classes within it can be designed. The designer inspected the following classes in

Windows store app ResourceLoader at design time

依然范特西╮ 提交于 2019-12-03 06:04:24
I've started creating a Windows Store App for Windows 8.1 and now I encountered a problem concerning localization. I would like to display a string resource from a .resw file at design time, but every attempt to do so has failed, even though it works at runtime. When using the x:Uid attribute, I still have to supply the Text property (i.e. for a TextBlock) and I don't like to write the text twice. I also tried creating a property for the string on the viewmodel: public string Title { get { return ResourceLoader.GetForCurrentView("Strings").GetString("MainView_Title"); } } This is working at

How to make a User control property of type Collection<MyClass> editable in Form Designer?

帅比萌擦擦* 提交于 2019-12-02 20:54:59
Today at work, I stumbled upon a problem that was driving me nuts. Basically my goal is this: I have a UserControl1 , with a field of the type Collection<Class1> and a corresponding property Collection<Class1> Prop . Like this: public class UserControl1 : UserControl { private Collection<Class1> field = null; // later changed to: //private Collection<Class1> field = new Collection<Class1>(); [Category("Data")] [DefaultValue(null)] [Description("asdf")] public Collection<Class1> prop { get { return field; } set { field = value; } } } // later added: //[Serializable] public class Class1 {