.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

Resolving references at DESIGN TIME?

Posted By:      Posted Date: September 26, 2010    Points: 0   Category :WPF
So I have a class:




class GridViewColumnEx

View Complete Post

More Related Resource Links

Resolving references at DESIGN TIME?

So I have a class:




class GridViewColumnEx

"Could not find default endpoint element that references contract " @ Expression Blend @ Design Time


so, in Expression Blend, and only there, during design time i get an error:

"System.InvalidOperationException was unhandled by user code

Could not find default endpoint element that references contract 'GBAUploadService.IGBAUploadService' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element."

this doesn't happen in Visual Studio 2010, and of course the service itself works flawlessly.

any ideas?


the code triggering the exception is part of a ObjectDataProvider, which consumes a web service in code-behind:


  public class FileGroupsDataProvider
    public BaseUploadJob[] GetFileGroups()
      if (Assembly.GetEntryAssembly() != null)
        using (GBAUploadServiceClient gbaUploadServiceClient = new GBAUploadServiceClient())
          BaseUploadJob[] baseUploadJobs = gbaUploadServiceClient.GetFileGroups();
          return baseUploadJobs;
      return null;

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)      
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