Skip to main content
Home Forums Silverlight Programming Programming with .NET - General beta1->beta2 problem - XAML base class
2 replies. Latest Post by chadbr on June 27, 2008.
(0)
chadbr
Member
53 points
27 Posts
06-27-2008 12:31 AM |
Hey Everyone,
I'm trying to upgrade my B1 project to B2 --
In B1, I had defined a base class for my XAML classes --
namespace MyApp.Screens
{
public class FormBase : UserControl
public FormBase ()
}
And my XAML / XAML.cs files declared like so:
-------------
public partial class Test : FormBase
public Test()
InitializeComponent();
….
----------------
<FormBase x:Class="MyApp.Screens.Test"
xmlns="http://schemas.microsoft.com/client/2007"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"
xmlns:extSL="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Extended"
>
<Grid x:Name="LayoutRoot" Background="Transparent">
<Grid.RowDefinitions>
In beta 2, I always get this error when I try to instantiate my control from code:
Test test = new Test();
Exception:
XamlParseException - Unknown element: FormBase [Line: 6 Position: 16]
The base class has no code (just a public ctor) or XAML.
Can anyone give me a clue here… ?
Thanks --
Leonid A...
636 points
137 Posts
06-27-2008 3:18 AM |
Modify your xaml:
<screens:FormBase x:Class="MyApp.Screens.Test"
xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml
xmlns:screens="clr-namespace:MyApp.Screens"
don't forget to modify closing tags. If not works - specify assembly for
06-27-2008 10:00 AM |
Thanks Leonid -- I should have tried that instead of posting the question - it was next on my list