I have a C# WPF project, namespaced test. How should I name sub-namespaces in XAML?
<Window x:Class="test.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:test"
xmlns:local.c="clr-namespace:test.Converters"
xmlns:local.v="clr-namespace:test.Validators"
Title="MainWindow" Height="360" Width="640"> ....
Here I have a convention of separating the sub-packages with a period.. Is it okay?
Kind regards,
e.
The typical WPF application really doesn’t have a namespace convention for the XAML, other than the default
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml", the Blend design time namespace andxmlns:localwhich will typically refer to the current namespace.In the scenario you described above, I’ve seen/used a few variants, i.e.,
or
In the end, it’s really up to whatever you and your team agree upon.