![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
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 | Inheriting from custom made page in xaml How can I inherit from my custom made page? Example: I have a page baseclass in my 1st assembly: <Page x:Class="Common.WinFX.Pages.DetailPage" xmlns="http://schemas.microsoft.com/winfx/avalon/2005" xmlns:x="http://schemas.microsoft.com/winfx/xaml/2005" Title="DetailPage" > <Grid> <Label>Test</Label> </Grid> </Page> How can I inherit a new page (in another assembly)? If I do this: <DetailPage x:Class="Contact.WinFX.ContactPersonDetail" xmlns="http://schemas.microsoft.com/winfx/avalon/2005" xmlns:x="http://schemas.microsoft.com/winfx/xaml/2005" Title="ContactPersonDetail" > <Grid> </Grid> </DetailPage> I get an error stating that the DetailPage is an unknown tag. I'm "using" the 1st assembly. Do I need to make some xml tag? -- Thomas S. Andersen |
| | #2 (permalink) |
| Guest | Re: Inheriting from custom made page in xaml <Thomas Andersen> wrote in message news:%23dYZR5REGHA.3068@TK2MSFTNGP10.phx.gbl... > <SNIP> Okay, I cracked the namespace part, but then I got: "Error 25 Common.WinFX.Pages.DetailPage cannot be the root of a XAML file because it was defined using XAML." Can this be try? That seems like a wierd limitation? -- Thomas Andersen |
| | #3 (permalink) |
| Guest | Re: Inheriting from custom made page in xaml <Thomas Andersen> wrote in message news:%23bI8$QTEGHA.2036@TK2MSFTNGP14.phx.gbl... > Can this be try? That seems like a wierd limitation? Ups, should say: Can this be right? That seems like a wierd limitation? -- Thomas Andersen |
| | #4 (permalink) |
| Guest | Re: Inheriting from custom made page in xaml Yes that is a by design limitation for v1. If we do enable this in the future, how would you like the content of the first page to work in the subclassed page? We'd like to understand your scenario. Today, you can make the base class in a programming language and then build the subclasses with markup. Thanks, Rob Relyea WPF Program Manager http://longhornblogs.com/rrelyea <Thomas Andersen> wrote in message news:e4FQrVTEGHA.336@TK2MSFTNGP14.phx.gbl... > <Thomas Andersen> wrote in message > news:%23bI8$QTEGHA.2036@TK2MSFTNGP14.phx.gbl... >> Can this be try? That seems like a wierd limitation? > > Ups, should say: > Can this be right? That seems like a wierd limitation? > > -- > Thomas Andersen > |
| | #5 (permalink) |
| Guest | Re: Inheriting from custom made page in xaml Hi Roy, Thanks for your reply. We are developing a full blown "normal" Windows application in WinFX, so we are going to have a lot of pages for viewing for example details for customers, equipment, locations and so forth. I'm still fondling around in blind. But my idea was to design a base class for detail pages, with the look, feel and commands we would prefer, and then derive and specialize the individual pages. I am not sure how it would handle the content; I was hoping to see how you managed that But I was expecting that I could see the base class in thedesigner and then build on that like a normal Windows form. But it's okay. I got it working with a "coded" base class, so I can certainly live with that. -- Best regards Thomas Andersen Wendia A/S "Rob Relyea [MSFT]" <Rob.Relyea@microsoft.nospam.com> wrote in message news:uTCUflVEGHA.1288@TK2MSFTNGP09.phx.gbl... > Yes that is a by design limitation for v1. > > If we do enable this in the future, how would you like the content of the > first page to work in the subclassed page? > We'd like to understand your scenario. > > Today, you can make the base class in a programming language and then > build the subclasses with markup. > > Thanks, > Rob Relyea > WPF Program Manager > http://longhornblogs.com/rrelyea > > <Thomas Andersen> wrote in message > news:e4FQrVTEGHA.336@TK2MSFTNGP14.phx.gbl... >> <Thomas Andersen> wrote in message >> news:%23bI8$QTEGHA.2036@TK2MSFTNGP14.phx.gbl... >>> Can this be try? That seems like a wierd limitation? >> >> Ups, should say: >> Can this be right? That seems like a wierd limitation? >> >> -- >> Thomas Andersen >> > > |
| | #6 (permalink) |
| Guest | Re: Inheriting from custom made page in xaml Rob, My attempts so far to define a page or in my case a window with a base class other than the WPF class have failed. It complains that the generated .g.cs partial class has a different base class than my code behind partial class. Can you point me at a sample that does this? Michael "Rob Relyea [MSFT]" <Rob.Relyea@microsoft.nospam.com> wrote in message news:uTCUflVEGHA.1288@TK2MSFTNGP09.phx.gbl... > Yes that is a by design limitation for v1. > > If we do enable this in the future, how would you like the content of the > first page to work in the subclassed page? > We'd like to understand your scenario. > > Today, you can make the base class in a programming language and then > build the subclasses with markup. > > Thanks, > Rob Relyea > WPF Program Manager > http://longhornblogs.com/rrelyea > > <Thomas Andersen> wrote in message > news:e4FQrVTEGHA.336@TK2MSFTNGP14.phx.gbl... >> <Thomas Andersen> wrote in message >> news:%23bI8$QTEGHA.2036@TK2MSFTNGP14.phx.gbl... >>> Can this be try? That seems like a wierd limitation? >> >> Ups, should say: >> Can this be right? That seems like a wierd limitation? >> >> -- >> Thomas Andersen >> > > |
| | #7 (permalink) |
| Guest | Re: Inheriting from custom made page in xaml Hi Michael, Here is how I did mine: _________ 1st file DetailPageBase.cs: --- using System; using System.Collections.Generic; using System.Text; namespace Common.WinFX.Pages { public class DetailPageBase: System.Windows.Controls.Page { } } _________ 2nd file ContactPersonDetail.xaml: --- <?Mapping XmlNamespace="Local" ClrNamespace="Common.WinFX.Pages" Assembly="Common.WinFX" ?> <Local etailPageBase x:Class="Contact.WinFX.ContactPersonDetail"xmlns="http://schemas.microsoft.com/winfx/avalon/2005" xmlns:x="http://schemas.microsoft.com/winfx/xaml/2005" Title="ContactPersonDetail" xmlns:Local="Local"> <Grid> </Grid> </Local etailPageBase>_________ 3rd file ContactPersonDetail.xaml.cs: --- using System; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; using Common.WinFX.Pages; namespace Contact.WinFX { /// <summary> /// Interaction logic for ContactPersonDetail.xaml /// </summary> public partial class ContactPersonDetail : DetailPageBase { public ContactPersonDetail() { InitializeComponent(); } } } Hope you can figure out the example. -- Best regards, Thomas Andersen "Michael Latta" <lattam@mac.com> wrote in message news:OkDb9fjEGHA.532@TK2MSFTNGP15.phx.gbl... > Rob, > > My attempts so far to define a page or in my case a window with a base > class other than the WPF class have failed. It complains that the > generated .g.cs partial class has a different base class than my code > behind partial class. Can you point me at a sample that does this? > > Michael > > > "Rob Relyea [MSFT]" <Rob.Relyea@microsoft.nospam.com> wrote in message > news:uTCUflVEGHA.1288@TK2MSFTNGP09.phx.gbl... >> Yes that is a by design limitation for v1. >> >> If we do enable this in the future, how would you like the content of the >> first page to work in the subclassed page? >> We'd like to understand your scenario. >> >> Today, you can make the base class in a programming language and then >> build the subclasses with markup. >> >> Thanks, >> Rob Relyea >> WPF Program Manager >> http://longhornblogs.com/rrelyea >> >> <Thomas Andersen> wrote in message >> news:e4FQrVTEGHA.336@TK2MSFTNGP14.phx.gbl... >>> <Thomas Andersen> wrote in message >>> news:%23bI8$QTEGHA.2036@TK2MSFTNGP14.phx.gbl... >>>> Can this be try? That seems like a wierd limitation? >>> >>> Ups, should say: >>> Can this be right? That seems like a wierd limitation? >>> >>> -- >>> Thomas Andersen >>> >> >> > > |
| | #8 (permalink) |
| Guest | Re: Inheriting from custom made page in xaml Thanks, I will give that a try when I get a chance. Your example was very clear. Michael <Thomas Andersen> wrote in message news:eLHCLvpEGHA.3820@TK2MSFTNGP12.phx.gbl... > Hi Michael, > > Here is how I did mine: > _________ > 1st file DetailPageBase.cs: > --- > using System; > using System.Collections.Generic; > using System.Text; > > namespace Common.WinFX.Pages > { > public class DetailPageBase: System.Windows.Controls.Page > { > } > } > _________ > 2nd file ContactPersonDetail.xaml: > --- > <?Mapping XmlNamespace="Local" ClrNamespace="Common.WinFX.Pages" > Assembly="Common.WinFX" ?> > <Local etailPageBase x:Class="Contact.WinFX.ContactPersonDetail"> xmlns="http://schemas.microsoft.com/winfx/avalon/2005" > xmlns:x="http://schemas.microsoft.com/winfx/xaml/2005" > Title="ContactPersonDetail" > xmlns:Local="Local"> > <Grid> > </Grid> > </Local etailPageBase>> _________ > 3rd file ContactPersonDetail.xaml.cs: > --- > using System; > using System.Windows; > using System.Windows.Controls; > using System.Windows.Data; > using System.Windows.Documents; > using System.Windows.Media; > using System.Windows.Media.Imaging; > using System.Windows.Navigation; > using System.Windows.Shapes; > using Common.WinFX.Pages; > > namespace Contact.WinFX > { > /// <summary> > /// Interaction logic for ContactPersonDetail.xaml > /// </summary> > > public partial class ContactPersonDetail : DetailPageBase > { > public ContactPersonDetail() > { > InitializeComponent(); > } > } > } > > Hope you can figure out the example. > > -- > Best regards, > Thomas Andersen > > > "Michael Latta" <lattam@mac.com> wrote in message > news:OkDb9fjEGHA.532@TK2MSFTNGP15.phx.gbl... >> Rob, >> >> My attempts so far to define a page or in my case a window with a base >> class other than the WPF class have failed. It complains that the >> generated .g.cs partial class has a different base class than my code >> behind partial class. Can you point me at a sample that does this? >> >> Michael >> >> >> "Rob Relyea [MSFT]" <Rob.Relyea@microsoft.nospam.com> wrote in message >> news:uTCUflVEGHA.1288@TK2MSFTNGP09.phx.gbl... >>> Yes that is a by design limitation for v1. >>> >>> If we do enable this in the future, how would you like the content of >>> the first page to work in the subclassed page? >>> We'd like to understand your scenario. >>> >>> Today, you can make the base class in a programming language and then >>> build the subclasses with markup. >>> >>> Thanks, >>> Rob Relyea >>> WPF Program Manager >>> http://longhornblogs.com/rrelyea >>> >>> <Thomas Andersen> wrote in message >>> news:e4FQrVTEGHA.336@TK2MSFTNGP14.phx.gbl... >>>> <Thomas Andersen> wrote in message >>>> news:%23bI8$QTEGHA.2036@TK2MSFTNGP14.phx.gbl... >>>>> Can this be try? That seems like a wierd limitation? >>>> >>>> Ups, should say: >>>> Can this be right? That seems like a wierd limitation? >>>> >>>> -- >>>> Thomas Andersen >>>> >>> >>> >> >> > > |
| |
| |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| custom panel with xaml+codebehind in designer | Robert Ludig | Avalon | 0 | 03-16-2007 07:15 AM |
| Custom Window as a XAML root element! | deepforest | Avalon | 2 | 11-23-2006 10:16 AM |
| How to pass object to XAML page | Lorenzo Soncini | Avalon | 0 | 10-23-2006 12:05 PM |
| Can Xaml attach a custom attribute? | John Melville, MD | Avalon | 0 | 05-13-2006 07:10 PM |
| Reference a xaml window from a WinFX Custom Control Library ? | Peter Fitzgibbons | Avalon | 3 | 02-24-2006 04:11 PM |