design-time

providing designtime ViewModel data for Blend and VS

半城伤御伤魂 提交于 2019-12-22 09:57:19
问题 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? 回答1: Yes, Expression Blend can help you with this. Use the "Data" tab to create sample data that has the same shape as your production data. When you create the data source, be sure to uncheck "Enable sample data when application is running". Sample Data http://www

Detect design time in NetBeans

孤人 提交于 2019-12-21 21:27:45
问题 When using the Swing graphical editor in NetBeans is it possible for a custom component to detect that it's design time? E.g. public CustomComponent() { initComponents(); if (!isDesignTime()) { someIcon = IconFactory.loadIcon("icons/SomeIcon.png"); } } Basically I'm after something like .net's Component.DesignMode 回答1: Try: java.beans.Beans.isDesignTime() 来源: https://stackoverflow.com/questions/1705656/detect-design-time-in-netbeans

Can't edit Point[] or List<Point> at design time

半世苍凉 提交于 2019-12-20 01:08:38
问题 I'm creating custom control that will draw shape from list (or array) of points. I have basic drawing functionality done, but now I'm struggling with design-time support in Visual Studio. I've created two properties: private Point _point; public Point Point { get { return _point; } set { _point = value; } } private Point[] _points; public Point[] Points { get { return _points; } set { _points = value; } } As seen on screen below Point is editable, but editor for Points isn't working. For each

Can a Windows Forms control have a Design Time-only property?

此生再无相见时 提交于 2019-12-19 09:51:38
问题 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. Furthermore I do not wish for this property to be writable at runtime, if that can be avoided. Is there a way to make a property only available at design time? 回答1: You can

Visual Studio Design Time Property - Form List Drop Down

放肆的年华 提交于 2019-12-19 03:19:08
问题 [EDIT] To be clear, I know how to get a list of forms via reflection. I'm more concerned with the design time property grid. I have a user control with a public property of the type Form. I want to be able to select a form at design time from a dropdown. I want to populate the form dropdown list from a set namespace: UI.Foo.Forms This would work like if you have a public property of Control. At design time, the property will automatically populate a dropdown with all the controls on the form,

KeyedCollection and d:DataContext Design Error

别说谁变了你拦得住时间么 提交于 2019-12-18 17:37:15
问题 See the update below for VS2013. When using a class as a d:DesignInstance that exposes a KeyedCollection<TKey, TItem> , the XAML designer complains with the following warning: The number of generic arguments provided doesn't equal the arity of the generic type definition. Parameter name: instantiation The problem can be reproduced with the following simple program: <Window x:Class="Test.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas

VS2012/ Blend 5: Debugging an Exception (only) occurring in design view

戏子无情 提交于 2019-12-17 19:05:55
问题 I'm developing a Metro-style app (for Windows 8) using C# and XAML. I have set up my viewmodels to be used as design-time datacontexts, like so: xmlns:vm="using:hub.ViewModels" d:DataContext="{d:DesignInstance IsDesignTimeCreatable=True, Type=vm:ViewModels My app appears to work perfectly when run, but in the design views of both VS 2012 and Blend, I occasionally get this (unhelpful) error message: An Exception was thrown. TargetException: Error in the application. Stacktrace at System

What approaches are available to dummy design-time data in WPF?

非 Y 不嫁゛ 提交于 2019-12-17 04:40:14
问题 I am working without expression blend and just using the XAML editor in vs2010. The wisdom of this aside, I am increasingly seeing a need for design-time data binding. For simple cases, the FallbackValue property works very nicely (Textboxes and TextBlocks, etc). But especially when dealing with ItemsControl and the like, one really needs sample data to be visible in the designer so that you can adjust and tweak controls and data templates without having to run the executable. I know that

Are Expression Blend design-time specific visuals possible?

陌路散爱 提交于 2019-12-13 14:54:35
问题 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 other properties... or am I doing something wrong? With a sample data source SDS_AIVertexAction We can do this in Expression Blend: <UserControl xmlns="http:/

Access DataModule's event from another Form (delphi design-time)

こ雲淡風輕ζ 提交于 2019-12-13 09:11:50
问题 I would like to know if there's any way to link a component's event (As TButton.OnClick ) to a procedure defined in a datamodule (At design-time). At the moment, I'm doing this at runtime: MyButton.OnClick := MyDataModule.MyOnClickEvent; The goal would be that to get MyDataModule.MyOnClickEvent proposed in the dropdown lists in the Object Inspector Window. Thanks in advance to all who will share their knowledge :D Note1: Here's a similar question, but there are no informations about how to