designer

What causes the VS 2010 SP1 WPF Designer to crash?

☆樱花仙子☆ 提交于 2019-12-01 17:56:07
We're experiencing crashes on various machines in the VS2010 WPF designer in the following scenario: VS 2010 SP1 installed 64 Bit Windows 7 Reference to NHibernate.dll (Version 1.2.0.712) To reproduce the Error, create a new WPF Solution, perform the following actions: create a new WPF solution open the main window, add a textbox to it, set some static text add a reference to FluentNhibernate.dll, Version 1.2.0.712 Clean and Rebuild the solution Open main window in designer again, edit text in the designer, click left of the window, then back into the textbox again There's no Data / Command

Why does the Windows Forms Designer cast int to byte then back to int for FromArgb?

余生长醉 提交于 2019-12-01 17:16:53
问题 I was looking through some code today and saw something like the following: var colour = Color.FromArgb(((int)(((byte)(227)))), ((int)(((byte)(213)))), ((int)(((byte)(193))))); When I asked why it was so, since Resharper confirmed that all the casts are redundant, I was told that the Designer done it that way and they had copied that. I had a look and sure enough the Designer generates code the same as above when setting a property to a custom colour. Does anyone know why the Designer would

WPF Designer “Could not create an instance of type”

偶尔善良 提交于 2019-12-01 15:02:06
In my UI XAML I'm essentially inheriting from a class "BaseView" that contains functionality common to several forms, however this is preventing the designer from displaying the form: "Could not create instance of type BaseView". The code will compile and run, but it is frustrating not to be able to see the form in the Designer. Is there a better way? Thanks. XAML: <vw:BaseView xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:vw="clr-namespace:ReviewClient" x:Class="ReviewClient.MainPage" ... The problem was that the

WPF Designer “Could not create an instance of type”

与世无争的帅哥 提交于 2019-12-01 14:38:57
问题 In my UI XAML I'm essentially inheriting from a class "BaseView" that contains functionality common to several forms, however this is preventing the designer from displaying the form: "Could not create instance of type BaseView". The code will compile and run, but it is frustrating not to be able to see the form in the Designer. Is there a better way? Thanks. XAML: <vw:BaseView xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006

How do I provide designer support to a TabControl residing in a UserControl, so that I can drag/drop controls onto tab pages?

不想你离开。 提交于 2019-12-01 12:05:10
问题 I have a user control, which contains both a Panel and a TabControl. I enabled design-time support for both. I can drag/drop controls from the toolbox onto the Panel control that resides within the user control. I can also add and remove tab pages via the designer on the TabControl. However, I am not able to drag/drop any controls onto the tab pages themselves. Below is the code generated source code for my user control: partial class TestUserControl { private System.ComponentModel.IContainer

Properties won't get serialized into the .designer.cs file

旧城冷巷雨未停 提交于 2019-12-01 09:28:42
In VS2010, control properties won't get serialized despite the ShouldSerializeFoo method, with the DesignerSerializationVisibility.Visible/Content as well. Here's the code: class Class1 : UserControl { [Browsable(true)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] public string Foo { get; set; } public bool ShouldSerializeFoo() { return true; } public Class1() { Foo = "dupa"; } } However, the designer doesn't generate anything for this property: // // class11 // this.class11.Location = new System.Drawing.Point(224, 262); this.class11.Name = "class11"; this.class11

How do I add a Control to a Container in an inherited WinForm

不问归期 提交于 2019-12-01 07:35:49
I have a base form in another project that enforces the same look & feel to all our WinForms programs. I inherited from that BaseForm, to create my own template, BaseView. This template of mine has additional controls like a ProgressBar, a Timer and a TableLayoutPanel. I now want to inherit from my BaseView and use the Designer to add my program-specific controls, however I cannot drop anything like Panels or any other Controls into it. I have tried some suggestions, like making sure the base form's components are public, but to no avail - most of the TLP's properties are still grayed out.

Properties won't get serialized into the .designer.cs file

别来无恙 提交于 2019-12-01 06:19:04
问题 In VS2010, control properties won't get serialized despite the ShouldSerializeFoo method, with the DesignerSerializationVisibility.Visible/Content as well. Here's the code: class Class1 : UserControl { [Browsable(true)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] public string Foo { get; set; } public bool ShouldSerializeFoo() { return true; } public Class1() { Foo = "dupa"; } } However, the designer doesn't generate anything for this property: // // class11 //

How to update design-time UserControl interface based on property value?

懵懂的女人 提交于 2019-12-01 05:54:19
I've created a UserControl with the following public property: [Browsable(true)] public string Text { get { return pnlLookupTable.GroupingText; } set { pnlLookupTable.GroupingText = value; } } pnlLookupTable is, as you may have guessed, a Panel control. I can change the value of the Text property in the Properties window and it's reflected in the markup like it should be. However, the design view of the UserControl inside a page does not show updated GroupingText for the Panel. How can I get this to happen? EDIT : By request, here is the entire class to which that property belongs. You can see

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

て烟熏妆下的殇ゞ 提交于 2019-12-01 04:20:02
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 SolidColorBrush(Colors.Blue); } But this doesn't work. Any tips? UPDATE: I dont understand how this works