October 14th, 2009, 05:46 AM
Autogenerated XAML and initializecomponent
I'm creating XAML pages from code, with a XMLWriter. No problem adding buttons, textbox, etc... So, i add to XAML file his XAML.CS with constructor etc.. . For example:
|_ Customers.XAML.CS (With CsharpCodeGenerator)
My problem is when I try to bind a control from this XAML to a event, for example, button1_click(). I create in the XAML.CS file an empty "InitializeComponent method". When I doubleclick control in my XAML to bind the event, this method is created but when I compile it, returns an error:
"Error 2 'CUSTOMERS1' does not contain a definition for 'button1_Click' and no extension method 'button1_Click' accepting a first argument of type 'CUSTOMERS1' could be found (are you missing a using directive or an assembly reference?)"
How could I create a correct InitializeComponent() by coding?
Thanks and regards
July 19th, 2010, 06:06 AM
Re: Autogenerated XAML and initializecomponent
You may try to correct the reference in .xaml files
provide correct namespace there
Tags for this Thread
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.