Click here to Skip to main content
15,867,488 members
Articles / Desktop Programming / WPF

A Guide to Cleaner XAML with Custom Namespaces and Prefixes (WPF/Silverlight)

Rate me:
Please Sign up or sign in to vote.
4.76/5 (35 votes)
22 Sep 2010Ms-PL4 min read 97.5K   894   48  
Clean up and manage your XAML references. This can be done using custom namespaces (scheme URLs) and custom prefixes.
using System;
using System.Windows;
using System.Windows.Controls;

namespace Sandworks.Silverlight.NamespaceExample.Controls
{
    public partial class CoolUserControl : UserControl
    {
        public CoolUserControl()
        {
            InitializeComponent();
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            MessageBox.Show("Yes, cool!");
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Microsoft Public License (Ms-PL)


Written By
Technical Lead RealDolmen
Belgium Belgium
I'm a Technical Consultant at RealDolmen, one of the largest players on the Belgian IT market: http://www.realdolmen.com

All posts also appear on my blogs: http://blog.sandrinodimattia.net and http://blog.fabriccontroller.net

Comments and Discussions