- March 24, 2007
- 12,073
- 7,459
- Home Country
- Germany
- Moderator
- #1
Up to now, if you open the MP2 skin files (screens, styles) inside a design tool (VisualStudio, Blend), the used elements are not known. This leads to underlining the control names and the lack of autocomplete (intellisense) feature.
Fortunately I found an solution for this issue: http://msdn.microsoft.com/en-us/library/ms747086(v=vs.110).aspx.
It is possible to make own class implementations known to the xaml world! MPF already uses an own namespace, but the control types etc. are not yet published correctly.
First step is to map CLR namespace to our MPF XAML-namespace:
This makes already all attributes visible to VS:
Next is to declare some properties as default for adding content via XAML:
I currently add more attributes to MPF classes, so that in the end we will have (nearly complete?) designer support for MPF!!! Yeah, finally!
This is useful for both @Developers and @Designers
Fortunately I found an solution for this issue: http://msdn.microsoft.com/en-us/library/ms747086(v=vs.110).aspx.
It is possible to make own class implementations known to the xaml world! MPF already uses an own namespace, but the control types etc. are not yet published correctly.
First step is to map CLR namespace to our MPF XAML-namespace:
Code:
// Register CLR namespaces for XAML
[assembly: XmlnsDefinition("www.team-mediaportal.com/2008/mpf/directx", "MediaPortal.UI.SkinEngine")]
[assembly: XmlnsDefinition("www.team-mediaportal.com/2008/mpf/directx", "MediaPortal.UI.SkinEngine.ScreenManagement")]
[assembly: XmlnsDefinition("www.team-mediaportal.com/2008/mpf/directx", "MediaPortal.UI.SkinEngine.Commands")]
[assembly: XmlnsDefinition("www.team-mediaportal.com/2008/mpf/directx", "MediaPortal.UI.SkinEngine.Controls.Animations")]
[assembly: XmlnsDefinition("www.team-mediaportal.com/2008/mpf/directx", "MediaPortal.UI.SkinEngine.Controls.Panels")]
[assembly: XmlnsDefinition("www.team-mediaportal.com/2008/mpf/directx", "MediaPortal.UI.SkinEngine.Controls.Transforms")]
[assembly: XmlnsDefinition("www.team-mediaportal.com/2008/mpf/directx", "MediaPortal.UI.SkinEngine.Controls.Brushes")]
[assembly: XmlnsDefinition("www.team-mediaportal.com/2008/mpf/directx", "MediaPortal.UI.SkinEngine.Controls.Brushes.Animation")]
[assembly: XmlnsDefinition("www.team-mediaportal.com/2008/mpf/directx", "MediaPortal.UI.SkinEngine.Controls.Visuals")]
[assembly: XmlnsDefinition("www.team-mediaportal.com/2008/mpf/directx", "MediaPortal.UI.SkinEngine.Controls.Visuals.Styles")]
[assembly: XmlnsDefinition("www.team-mediaportal.com/2008/mpf/directx", "MediaPortal.UI.SkinEngine.Controls.Visuals.Templates")]
[assembly: XmlnsDefinition("www.team-mediaportal.com/2008/mpf/directx", "MediaPortal.UI.SkinEngine.Controls.Visuals.Triggers")]
[assembly: XmlnsDefinition("www.team-mediaportal.com/2008/mpf/directx", "MediaPortal.UI.SkinEngine.MpfElements.Resources")]
[assembly: XmlnsDefinition("www.team-mediaportal.com/2008/mpf/directx", "MediaPortal.UI.SkinEngine.MarkupExtensions")]
Next is to declare some properties as default for adding content via XAML:
Code:
/// <summary>
/// Screen class respresenting a logical screen represented by a particular skin.
/// </summary>
[ContentProperty("Root")]
public class Screen : UIElement, INameScope, IAddChild<FrameworkElement>, IUnmodifiableResource
{
#region Consts
I currently add more attributes to MPF classes, so that in the end we will have (nearly complete?) designer support for MPF!!! Yeah, finally!
This is useful for both @Developers and @Designers