Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > Avalon

WPF UserControl in a Forms.UserControl

Closed Thread
 
Thread Tools Display Modes
Old 01-10-2006   #1 (permalink)
MichaelG
Guest


 

WPF UserControl in a Forms.UserControl

I've managed to add a WPF button to a Forms.UserControl in code and am now
trying to add a WPF UserControl (defined in XAML) onto a Forms.UserControl.

I've started with Add->New Item...->WinFX User Control which adds
TestPage.xaml and TestPage.xaml.cs to the project. I've added some XAML
inside <UserControl.FixedTemplate> (works in XAMLPad) but when I compile I
get 'Error 2 The name 'InitializeComponent' does not exist in the current
context'. I've looked at one of the SDK samples and it seems TestPage.g.cs
should be generated but isn't.

What have I missed? Is it ok to mix WPF and Forms classes in the same DLL
or do I need to put all WPF Controls into a separate assembly?

Thanks
Michael


Old 01-10-2006   #2 (permalink)
Nick Kramer [MSFT]
Guest


 

Re: WPF UserControl in a Forms.UserControl

Have you told VS how to compile .xaml files? You do that by adding a line
to your project file, described on
http://blogs.msdn.com/mhendersblog/a...03/476536.aspx (look for
"Whatchoo talkin' 'bout Willis?")

-Nick Kramer [MSFT]
http://blogs.msdn.com/nickkramer

---
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm


"MichaelG" <MichaelG@newsgroups.nospam> wrote in message
news:uLVT5jBAGHA.272@TK2MSFTNGP09.phx.gbl...
> I've managed to add a WPF button to a Forms.UserControl in code and am now
> trying to add a WPF UserControl (defined in XAML) onto a
> Forms.UserControl.
>
> I've started with Add->New Item...->WinFX User Control which adds
> TestPage.xaml and TestPage.xaml.cs to the project. I've added some XAML
> inside <UserControl.FixedTemplate> (works in XAMLPad) but when I compile I
> get 'Error 2 The name 'InitializeComponent' does not exist in the current
> context'. I've looked at one of the SDK samples and it seems
> TestPage.g.cs should be generated but isn't.
>
> What have I missed? Is it ok to mix WPF and Forms classes in the same DLL
> or do I need to put all WPF Controls into a separate assembly?
>
> Thanks
> Michael
>
>



Old 01-10-2006   #3 (permalink)
MichaelG
Guest


 

Re: WPF UserControl in a Forms.UserControl

That was it. Thanks.


"Nick Kramer [MSFT]" <nkramer@ms.spam> wrote in message
news:OmsmaaDAGHA.3140@TK2MSFTNGP14.phx.gbl...
> Have you told VS how to compile .xaml files? You do that by adding a line
> to your project file, described on
> http://blogs.msdn.com/mhendersblog/a...03/476536.aspx (look
> for "Whatchoo talkin' 'bout Willis?")
>
> -Nick Kramer [MSFT]
> http://blogs.msdn.com/nickkramer
>
> ---
> This posting is provided "AS IS" with no warranties, and confers no
> rights. Use of included script samples are subject to the terms specified
> at http://www.microsoft.com/info/cpyright.htm
>
>
> "MichaelG" <MichaelG@newsgroups.nospam> wrote in message
> news:uLVT5jBAGHA.272@TK2MSFTNGP09.phx.gbl...
>> I've managed to add a WPF button to a Forms.UserControl in code and am
>> now trying to add a WPF UserControl (defined in XAML) onto a
>> Forms.UserControl.
>>
>> I've started with Add->New Item...->WinFX User Control which adds
>> TestPage.xaml and TestPage.xaml.cs to the project. I've added some XAML
>> inside <UserControl.FixedTemplate> (works in XAMLPad) but when I compile
>> I get 'Error 2 The name 'InitializeComponent' does not exist in the
>> current context'. I've looked at one of the SDK samples and it seems
>> TestPage.g.cs should be generated but isn't.
>>
>> What have I missed? Is it ok to mix WPF and Forms classes in the same
>> DLL or do I need to put all WPF Controls into a separate assembly?
>>
>> Thanks
>> Michael
>>
>>

>
>



Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Drawing Polygon on UserControl Sudha Avalon 1 02-21-2008 11:02 AM
Getting the window which contains a usercontrol Michael Jackson Avalon 2 06-08-2007 12:04 PM
UserControl inside another UserControl with WYSIWYG jan.bannister@gmail.com Avalon 1 02-07-2007 06:42 AM
How to bind to a usercontrol property from inside this usercontrol Pon Avalon 4 11-13-2006 08:38 AM
UserControl in VB project Eli Avalon 1 06-05-2006 06:25 PM








Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50