This question is locked. New answers and comments are not allowed.
Scenario:
I have looked through the forums and the TabControl documentation and could not find anything that addressed this issue. I have a Xaml with a RadTabControl in it. Each RadTabItem is added in this Xaml. The code for the Xaml is located in a separate Xaml file, in the same project, under the same namespace. I coded it to basically follow the example First Look in the GridView control Demo. Design view does work for each of the Xamls I am using for Tabs. I am guessing that the issue is that the designer doesn't have an object for "StephensPlayground", so it doesn't know that it has a button in it, or anything else for that matter.
Problem:
The problem is that the main page's Xaml cannot parse those RabTabItems, so I get a null reference exception. This breaks the designer in Visual Studio and Blend. It happens on any tab I try to add and it only affects when you are looking at the code. Despite the error, compile and runtime are fine.
Error:
What I get in VS is "NullReferenceException was thrown on "StephensPlayground": Cannot create instance of "StephensPlayground".
Here is my main page's Xaml:
Here is the Xaml from StephensPlayground:
I have looked through the forums and the TabControl documentation and could not find anything that addressed this issue. I have a Xaml with a RadTabControl in it. Each RadTabItem is added in this Xaml. The code for the Xaml is located in a separate Xaml file, in the same project, under the same namespace. I coded it to basically follow the example First Look in the GridView control Demo. Design view does work for each of the Xamls I am using for Tabs. I am guessing that the issue is that the designer doesn't have an object for "StephensPlayground", so it doesn't know that it has a button in it, or anything else for that matter.
Problem:
The problem is that the main page's Xaml cannot parse those RabTabItems, so I get a null reference exception. This breaks the designer in Visual Studio and Blend. It happens on any tab I try to add and it only affects when you are looking at the code. Despite the error, compile and runtime are fine.
Error:
What I get in VS is "NullReferenceException was thrown on "StephensPlayground": Cannot create instance of "StephensPlayground".
Here is my main page's Xaml:
<mica:MICAContent x:Class="TestingCenter.TestingCenterForm" xmlns:local="clr-namespace:TestingCenter" xmlns:mica="clr-namespace:NS_MICAContent;assembly=MICAContent" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" d:DesignHeight="800" d:DesignWidth="1000" mc:Ignorable="d"> <Grid x:Name="LayoutRoot" Background="Transparent"> <StackPanel x:Name="MainForm"> <telerik:RadTabControl x:Name="rtcMainTabControl" Margin="10" HorizontalAlignment="Left" VerticalAlignment="Center" AllowDragReorder="True" IsContentPreserved="True"> <telerik:RadTabItem Header="Stephen's Playground"> <local:StephensPlayground /> </telerik:RadTabItem> </telerik:RadTabControl> </StackPanel> </Grid></mica:MICAContent>Here is the Xaml from StephensPlayground:
<UserControl x:Class="TestingCenter.StephensPlayground" xmlns:baseclass="clr-namespace:Controls;assembly=Controls_BaseClass" xmlns:darxaml="clr-namespace:DAR;assembly=DAR_BaseXaml" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" d:DesignHeight="800" d:DesignWidth="1100" mc:Ignorable="d"> <Grid x:Name="LayoutRoot" Background="Transparent"> <Grid Margin="10"> <StackPanel> <telerik:RadButton x:Name="rbtnPlacement" Width="100" Height="25" Margin="10,0,0,0" HorizontalAlignment="Left" Content="Test" /> </StackPanel> </Grid> </Grid></UserControl>