CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2009
    Posts
    1

    Question Autogenerated XAML and initializecomponent

    Hello:

    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
    |_ 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

  2. #2
    Join Date
    Jul 2010
    Posts
    1

    Re: Autogenerated XAML and initializecomponent

    You may try to correct the reference in .xaml files

    provide correct namespace there

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured