Binding to UserControl.Resource; disable at Design time.

3 posts, 1 answers
  1. CD
    CD avatar
    14 posts
    Member since:
    Mar 2011

    Posted 14 Apr 2011 Link to this post

    Hello

    I am following the example here  telerik chart example .

    Everything works, it is just that if I have the DataSource as a resource in the application:

    <UserControl.Resources>
       <example:NorthwindDataSource x:Key="DataSource"/>
    </UserControl.Resources

    Then I can't preview the xaml at design time. From a little research it appears I have to disable the binding at design time? Is there an example of this?

    Visual Studio designer throws 'Domain operations cannot be started at design time.' when attempting to view the layout.


    Thanks.
  2. Answer
    Evgenia
    Admin
    Evgenia avatar
    1437 posts

    Posted 20 Apr 2011 Link to this post

    Hello Curt,

    Your are trying to make the call to the RIA service which isn't allowed at design time. You need to set the resource in code behind to prevent this happening at design time.

    Take a look at this forum thread where this issue is discussed.
    You may also need to check if you are in Design Tool like this :
    private void UserControl_Loaded(object sender, RoutedEventArgs e)
            {
      
                if (DesignerProperties.IsInDesignTool)
                    return;
      // your binding method here ...
                Bind();
            }

    Kind regards,
    Evgenia
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. CD
    CD avatar
    14 posts
    Member since:
    Mar 2011

    Posted 20 Apr 2011 Link to this post

    Thank you Evgenia, works great!
Back to Top