design-time

How to see design-time data-binding in XAML editor (it works in runtime)?

走远了吗. 提交于 2020-01-09 07:14:25
问题 I data-binded version number to appear as follows: <Window <!-- ... --> DataContext="{Binding RelativeSource={RelativeSource Self}}"> <Grid> <TextBlock> Version is: <Run Text="{Binding Version, Mode=OneWay}"></Run> and advancing... </TextBlock> </Grid> </Window> and it's working during run-time. How can I see it during design-time in the XAML editor in Visual Studio 2012 ? I only see: Version is: and advancing... instead of: Version is: 5.2.2 and advancing... EDIT - My solution: Jure's answer

Add Label with Textbox at design time

走远了吗. 提交于 2020-01-07 05:30:48
问题 I am creating a project using VS.NET (C#) with many forms that contain textboxes and associated labels. I have created the association through an exposed property I created for the textbox which contains the label name. The problem is that each time I add a textbox at design-time I have to add a label and then enter the label name into the property of the textbox. I would much rather do this dynamically at design-time when I create the textbox, much like the old VB textbox add. I have been

How to disable designer in derived classes in following generations

夙愿已清 提交于 2020-01-01 04:51:06
问题 In order to disable component designer in classes it is simple to add just [System.ComponentModel.DesignerCategory("")] attribute to it, however it does not work for any classes derived from this class in any generation. E.g: [System.ComponentModel.DesignerCategory("")] public class A:ServiceBase { } //Designer is disabled here public class B:A {} //Designer is enabled here [System.ComponentModel.DesignerCategory("")] public class B:A {} //Designer is enabled here too [System.ComponentModel

How do I debug a designtime package unloading crash involving a crash in ThreadProc in Classes.pas?

倾然丶 夕夏残阳落幕 提交于 2019-12-30 10:30:56
问题 I am not sure how to track down the following crash: It happens when Unloading a Designtime Package that is used in-house at my company. It is our code, thus it is our bug to fix, not a third party component vendor problem. It apppears that a thread is involved, but since it happens in the Function ThreadProc in Classes.pas, I'm guessing it's a bare System/RTL thread without even a TThread class wrapper that I should be searching for in our code. (Question Part A: Is that so?) The call stack

Adding design-time support for a nested container in a custom/usercontrol (Winforms)

…衆ロ難τιáo~ 提交于 2019-12-30 05:11:11
问题 I have something similar to a wizard control, in the middle is a Panel I would like to use to place any child controls. I have found using the ScrollableControlDesigner will allow dropped controls to be added to the custom/usercontrol, but this is not what I require. It needs to be added to the container, so layout can be applied without affecting the 'outer' controls (heading, navigation buttons). I have tried various ways, that did not work, and looked hacky. Any ideas? 回答1: I found the

Design-time editor support for controls collection

邮差的信 提交于 2019-12-30 02:29:24
问题 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(DesignerSerializationVisibility.Content)> _ Public ReadOnly Property SelectedControls() As List(Of Control) Get Return _controls End Get End Property I get the default

How to troubleshoot and debug Visual Studio design mode errors?

流过昼夜 提交于 2019-12-28 02:05:17
问题 Using Windows 7 and Visual Studio 2010, I am writing a C# custom UserControl. I was coding in code view for weeks and recently when I tried to switch to design mode, Visual Studio hanged, "NOT RESPONDING". I can wait for an hour, and still nothing happens. Clicking on the close button it gives the "Do you want to wait, close, restart and send information to Microsoft" dialog. Is there a way to (stack)trace the code that the designer is trying to execute? Maybe design-time trace messages or

How WinForms PropertyGrid finds custom type converters in external libraries?

核能气质少年 提交于 2019-12-25 01:13:44
问题 We have a custom control. Some properties of this control use custom type converters and UI type editors, and they are implemented in a separate design-time DLL. These type converters are defined using the string syntax of the TypeConverter and Editor attributes, for example: [TypeConverter("<full class name>, <library name>, Version=<version>")] public CustomType Property1 { // property implementation } When we display the properties of our custom control in the standard PropertyGrid control

How is an assembly resolved at design time?

China☆狼群 提交于 2019-12-23 12:36:17
问题 I have an extensibility library (or the start of one), with a UITypeEditor. I'd now like to decorate the property with the EditorAttribute. I don't want to reference the extensibility library, as it does not need to be deployed, so I'm using this: [Editor("MyProject.Extensibility.MyUIEditor, MyProject.Extensibility, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null", typeof (UITypeEditor))] MySpecialType SpecialType { get; set; } This doesn't work. The type editor is for use on enums and

How to disable child controls at design-time?

跟風遠走 提交于 2019-12-22 10:55:44
问题 I have my own control, derived from TCustomPanel . It has a child ( TEdit ) on it. type TMyControl = class(TCustomPanel) private FEditor: TEdit; public constructor Create(AOwner: TComponent); destructor Destroy(); override; end; constructor TMyControl.Create(AOwner: TComponent); begin FEditor := TEdit.Create(nil); FEditor.Parent := Self; end; destructor TMyControl.Destroy(); begin FEditor.Free(); end; When I click on a child control at design-time, it acts as the run-time TEdit , capturing