Hi all,
I have a xaml form for use in my application, and i have subclassed the Frame class to create my own, and edited the interface to specify my own class for the content (as i need to access properties on the content for data binding).
The problem comes then in the designer that the compiler says it cannot create an instance of my control - i've tried to do some designer checks on the offending property bit but that didnt work either.
How can i get the control to display? Works fine at runtime...
Xaml:
<Grid Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2">
<views:PageFrame Name="Content_MainPage" Frame.NavigationUIVisibility="Hidden"/>
</Grid>
CS:
public new BaseView Content
{
get
{
if (DesignerProperties.GetIsInDesignMode(this))
{
return new BaseView();
}
else
{
return (BaseView)base.Content;
}
}
set
{
if (DesignerProperties.GetIsInDesignMode(this))
{
base.Content = new BaseView();
FrameTitle = "design mode";
}
else
{
base.Content = value;
FrameTitle = value.Title;
}
}
}