.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Is it possible to combine implementation variable with design time activities?

Posted By:      Posted Date: September 14, 2010    Points: 0   Category :Windows Application
Here is my scenario : - We have a custom While activity which can take an Activity<bool> as a condition in the designer.- We can program some predefined conditions with Activity<bool> (useful for complex conditions), and they can have some variables, for exemple "IsGreaterThanActivity" with arguments "Number1" and "Number2".- Some of the conditions have internal states (for exemple, the current position in a list). We don't wan't to show them in the designer, it's implementation detail (so they use AddImplementationVariable). - Our custom While activity schedule the condition, if true his body, and so on... So, to not lose the internal state of the condition between executions, it would be nice to add an implementation variable to the custom while activity, and "bind" the condition state by an InArgument to the while.- We do not want to show the state in the designer (it should always be binded, so we do the binding in the CacheMetadata). But if we do a AddImplementationChild to add the condition in the CacheMetadata, the condition won't find design time variables / arguments. So we need to do a AddChild. But if we do AddChild, we can't get the implementation variable to store the state. And if we use the AddVariable, in the xaml we see the variable decleration, so it's possible to alter them. So is there any way to use

View Complete Post

More Related Resource Links

Custom Control Design-Time SiteMap Provider Error


Greetings - I was referred here by MSDN forums hope this is the right place -  

I have a custom control (:WebControl) that renders web.sitemap in a specific way. While it runs error free and produces the expected result, at Design-Time it complains

Error Creating Control - MyControl  The provider 'AspNetXmlSiteMapProvider' specified for the defaultProvider does not exist in the providers collection.

I have discovered that the error is cause by this line of code:

string div = string.Format("<div class='{0}' id='{1}'>{2}</div>", this.CssClass, this.ID.ToString(), EnumerateNodesRecursive(SiteMap.RootNode, level));

or more specifically, by the reference to SiteMap.RootNode - I am not clear what is missing thoough because I have configured the SiteMapProvider in web.config as this:

        <add name="AspNetXmlSiteMapProvider" 
             type="System.Web.XmlSiteMapProvider, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" 

ASP.NET Designer - How Do I generate this Design-Time Markup?


I want to generate this:
    <x:MyControl id="a" runat="server">
            <x:MyScript .. />

How do I persist custom complex types in design-time


Let's say that I've got one custom webcontrol called MyControl.

public partial class MyControl: WebControl {
public IComplex Complex { get; set; }

The control is a very simple control but it holds an instance of a complex type that is accessable through a property. The property has the propertytype IComplex

public interface IComplex {
string Name { get; set; }
List<IComplex> Children {get;}

Let's say that I am able to pick one of several different types of object that derives from IComplex in design-time and assign it to the controls property "Complex" property.

Naturally I would like to persist this information to the HTML-View in a user-friendly way.

Because we don't know what type the user has picked there is no way to instansiate the type if we don't persist the name of that type. The Type could also contain more properties than the Interface the controls property is refering.

<cc1:MyControl id="MyControl1" runat="server">
<Complex> <!-

Netting C++: EEK!-Time to Design the Mouse


This month begins the design of the actual mouse class for EEK!

Stanley B. Lippman

MSDN Magazine December 2007

Data Binding: Give Your Everyday Custom Collections a Design-Time Makeover


In this article, Paul Ballard shows how you can provide data binding support for your custom collections to enable sorting, searching, and editing in as simple a manner as possible. In addition, he shows how to make all of these features available in the Windows and Web Forms Designers, just like an ADO.NET DataSet.

Paul Ballard

MSDN Magazine August 2005

Visual Studio .NET: Building Windows Forms Controls and Components with Rich Design-Time Features, P


This is the second of two articles discussing the extremely rich design-time features of the .NET Framework. Part 1 discussed the basics, showing you where to start and how to extend your control implementation through attributes and interfaces, as well as their effects on the property browser, code serialization, and other controls. Part 2 continues the journey by concentrating on design-time functionality that you can implement beyond your components and controls, including TypeConverters, UITypeEditors, and Designers. It would be impossible to cover everything you can do in two short articles, which is a testament to just how all-encompassing and flexible the design-time capability of the .NET Framework is.

Michael Weinhardt and Chris Sells

MSDN Magazine May 2003

Visual Studio .NET: Building Windows Forms Controls and Components with Rich Design-Time Features


Visual Studio .NET provides support for designing rich features into your controls and components, allowing you to set properties, set form placement, inherit from base classes, and much more. So how does Visual Studio .NET do all this? What does the Windows Forms designer do? What's the difference between a control and a component? How does Visual Studio integrate your controls so that they can access features of the .NET Framework?In this article, the authors answer these common questions by building a clock control and taking the reader along for the ride. In building the control, hosts and containers are illustrated, the property browser is explained, debugging is discussed, and a general overview of the design-time infrastructure is presented.

Michael Weinhardt and Chris Sells

MSDN Magazine April 2003

UserControl, CustomControl Design Time Support errors IOC, Dependency Injection, MVP

  Hi, is there a way to completely disable design time support for CustomControl, and UserControl ? I have about 30 UserControls and 10 CustomControls in my WinForms app, which contains some Dependency Injections and IOC stuff in constructors and Load handlers. I have lots of large UserControls containing smaller UserControls (CompositeView). All my UI code is pretty dynamic and the only thing i need to do at design time is to drag&drop containers in other containers (UserControls). And now i have a hard time doing this, because i have to wrap all constructors and Load Handlers in CurrentProccess!="devenv"... and when I'm Implementing some new View interface (which consist lots of properties) in UserControl all those properties by default throw NotImplementedException and i don't always need to implement them immediately but still i need to be able to run this code for testing. Besides, then i have to clean up designer generated class because it adds unnecessary null value property initializations, and then it way add some other ____ code, and so on.... Imagine UserControl with 10-15 nested UserControls, and then i try to open it in Form Designer and get ObjectReference NULL exception (for IOC) or some NotSupported NotImplemented exceptions (for properties) without adequate CallStack available! There is a CallStack but there is no trace in it to my Code (

For a control which events are raised at design-time, run-time or both?

Hi. I have been getting several different errors on the my windows forms designer. I'm trying to implement an application with some complexity on the screen navigating since it includes several main views as also sub-views in which the sub-views are represented by user controls. I believe that some of my errors are related to the fact that I miss important information related the events that are raised while working in the windows forms designer. Is there any link that includes information about the events of a control that are raised at design-time, run-time or both? For example, if I override the OnLoad() method of a User Control, that method will be executed both at design-time and run-time. Knowing about this information has helped me resolving an issue related to duplication of columns on a customized DataGridView. Not 100% sure if it's possible to obtain what I'm asking for or if this information exists. If this information is not available what could I do in order to understand in more detail the kind of events that are raised in the design-time vs run-time? Can I debug an application in design-time using Visual C# 2008 Express Edition? I found this link that helps identifying the run-time and the design mode: http://dotnetfacts.blogspot.com/2009/01/identifying-run-time-and-design-mode.html This link has been helpful but I still feel that I need more information.

Cannot switch between tabs of a tab control at design time

Hi, I have the same problem as this fellows description below. Any suggestions? Cannot switch between tabs of a tab control at design time 06-11-2010 4:21 PM | Hi. I'm using a tabcontrol with some tabs. it works fine in the navigator but in design time a cannot switch between tabs to insert content in graphic mode. When i have created this tabcontrol, i could move me across the tabs. Now when i click the tab it jump the possition in the xaml code but not in the Design. Whats happening? Thanks in advance.

WPF get Type in Design time?

Well here is my problem i have a class that inherits UserControl (View) now i use this class instead of the UserControl and i need to get the type in some cases now this works great a run time .GetType() returns the right type (for example ShellView) but when running in design time (the wpf editor in Visual Stuido) .GetType() returns the base type instead of the type of the current xaml document... Example: public class View : UserControl { public override void OnApplyTemplate() { MessageBox.Show(this.GetType().ToString()); base.OnApplyTemplate(); } } My XAML: <local:View x:Class="WpfApplication2.Test" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:WpfApplication2" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300"> <Grid> </Grid> </local:View> so in this case when i open Test in the designer i get a message saying View, but when i run the program i get a message box saying Test.. How can i get the right type in design time im totaly lost on this problem..

how to change dynamically [Bbrowsable] attribute for a property at design time c#

hi,   how to change dynamically  [Browsable] attribute for a property  at design time c#

Custom panel - missing design time support for controls.

I’m trying to implement a custom panel, one that will behave kind of like the standard Canvas panel. The implementation is done and it is working when I add components in the xaml, but what is not working is move and resize of components in the designer. In the designer each component shows the ‘selected frame’ when selected, but it cannot be moved or resized. Can someone point me to what I’m missing, or an article that describes how do add this support?.   The reason I’m not deriving from the existing Canvas is mainly because I want to understand how it works and how to implement it manually.   Thanks  

using Custom Formatter when format is unknown at design time

I have class "CF" that implements IFormattable interface. I can convert it to string var cf = new CF(); string str = cf.ToString("MYFORMAT", CultureInfo.InvariantCulture) or str = String.Format("{0:MYFORMAT}", cf);   the problem is that "MYFORMAT" is a parameter. so i can still use string fmt = "FORMAT"; string str = cf.ToString(fmt, CultureInfo.InvariantCulture) Is it possible still use String.Format for formatting? That doesnt work str = String.Format("{0:{1}}", cf, format)      

VS 2010 could not find database at design time

Hi all, I'm having this problem.... Scenario: C# 2010, WPF, SQL Compact 3.5 SP2. I'm working at a wpf window which loads records from a SQL Compact DB and shows data in textboxes. At runtime everything works perfectly but since this morning (working on it last 2 days) i'm not able to edit the window at DesignTime. As soon as I open the window with the wpf editor I got the error (translating from Italian): "Impossible to find the database. Check the database path. [Data Source = C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\thedbfile.sdf]" Now, in settings and app.config I have the connection string which is something like Data Source=|DataDirectory|\thedbfile.sdf I don't understand why and where NOW (only since this afternoon) at Design Time VS look that path for the database, while at RunTime it's ok. Again, I'm using Datasets, and I can preview data, ecc., as said everything is ok except the edit of the window which crash with this error.... thanks

How to implement Design-Time drag & drop from Custom Visual Studio Tool Window to WPF Designer

Hi, Could someone tell me if it is possible to intercept a design time drop event coming from a custom Visual Studio tool window onto the cider design surface? I am hoping to use the same API's as those used by the Visual Studio 2010 'Data Sources' tool window, which provides drag & drop data-binding between classes and WPF/Silverlight controls. My requirement is to pass a DataObject (used with the WPF DragDrop API) from my custom Visual Studio WPF tool window treeview to my custom WPF control at design time, read the data and do some binding/XAML manipulation of my own. The drag aspect is simple enough but I can't work out how to accept a drop event from anything other than the toolbox. At the moment, when I drag my treenode over the design surface it shows the 'cannot drop here' cursor. If someone could give me some insight into how the 'Data Sources' tool window allows dragging of treenodes to controls I would really appreciate it. It is obviously possible but which API's are used and are they public? Thanks in advance, Paul  
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend