![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
| |
| | #1 (permalink) |
| | 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 |
My System Specs![]() |
| | #2 (permalink) |
| | 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 > > |
My System Specs![]() |
| | #3 (permalink) |
| | 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 >> >> > > |
My System Specs![]() |