![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
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 | Custom Window as a XAML root element! Hi, How can I define a custom Window as the root element of a XAML file? For example: <WPFWindow x:Class="Namespace.DerivedWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:my="clr-namespace:Custom;assembly=Custom"> .... </WPFWindow> Where WPFWindow is a custom Window which is defined in the Custom assembly: public class WPFWindow : Window {...} Thanks. |
My System Specs![]() |
| | #2 (permalink) |
| Guest | RE: Custom Window as a XAML root element! Ok, I've found the answer!!! I just need to define: [assembly: XmlnsDefinitionAttribute( "http://schemas.microsoft.com/winfx/2006/xaml/presentation", "Custom")] This will "combine" the types under Custom into "http://schemas.microsoft.com/winfx/2006/xaml/presentation" Now, the XAML compiler knows what is WPFWindow. :-) "deepforest" wrote: > Hi, > > How can I define a custom Window as the root element of a XAML file? > For example: > > <WPFWindow x:Class="Namespace.DerivedWindow" > xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" > xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" > xmlns:my="clr-namespace:Custom;assembly=Custom"> > ... > </WPFWindow> > > Where WPFWindow is a custom Window which is defined in the Custom assembly: > public class WPFWindow : Window {...} > > Thanks. |
My System Specs![]() |
| | #3 (permalink) |
| Guest | RE: Custom Window as a XAML root element! Ok, I've found the answer!!! I just need to define: [assembly: XmlnsDefinitionAttribute( "http://schemas.microsoft.com/winfx/2006/xaml/presentation", "Custom")] This will "combine" the types under Custom into "http://schemas.microsoft.com/winfx/2006/xaml/presentation" Now, the XAML compiler knows what is WPFWindow. :-) "deepforest" wrote: > Hi, > > How can I define a custom Window as the root element of a XAML file? > For example: > > <WPFWindow x:Class="Namespace.DerivedWindow" > xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" > xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" > xmlns:my="clr-namespace:Custom;assembly=Custom"> > ... > </WPFWindow> > > Where WPFWindow is a custom Window which is defined in the Custom assembly: > public class WPFWindow : Window {...} > > Thanks. |
My System Specs![]() |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Trouble with resize ratio of XAML element | Mike D | Avalon | 0 | 02-18-2008 03:03 AM |
| Accessing an Array element(i) from a XAML "binding path" | iterationx | Avalon | 1 | 03-23-2007 11:17 AM |
| How to reference another element in the same XAML file? | TyraelTong | Avalon | 2 | 09-27-2006 08:20 AM |
| 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 |