![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
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.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| 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 |
| | #2 (permalink) |
| 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 > > |
| | #3 (permalink) |
| 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 >> >> > > |
| |
| |
![]() |
| 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 |