This is a migrated thread and some comments may be shown as answers.

Binding to UserControl.Resource; disable at Design time.

2 Answers 58 Views
Chart
This is a migrated thread and some comments may be shown as answers.
CD
Top achievements
Rank 1
CD asked on 14 Apr 2011, 08:11 PM
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 Answers, 1 is accepted

Sort by
0
Accepted
Evgenia
Telerik team
answered on 20 Apr 2011, 08:44 AM
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
0
CD
Top achievements
Rank 1
answered on 21 Apr 2011, 01:00 AM
Thank you Evgenia, works great!
Tags
Chart
Asked by
CD
Top achievements
Rank 1
Answers by
Evgenia
Telerik team
CD
Top achievements
Rank 1
Share this question
or