You cannot for the same reason that it {Binding Path=a:b.c}works, but it {Binding a:b.c}does not work: the PropertyPath constructor does not have a namespace context.
Unfortunately, with SortDescription, there is little you can do. You should find a way to sort without using attached properties.
I usually tell people that using a tag is an indicator of bad coding, but in this case, the tag may be your best option: you can create an object in the tag that has properties that return the properties you want.
In your PropertyChangedCallback, create an instance tag of the inner class:
public class TestClass : DependencyObject
{
... TestProperty declaration ...
PropertyChangedCallback = (obj, e) =>
{
...
if(obj.Tag==null) obj.Tag = new PropertyProxy { Container = obj };
});
public class PropertyProxy
{
DependencyObject Container;
public SomeType TestProperty { get { return GetTestProperty(Container); } }
}
}
Now you can use the Tag sub-property in your SortDescription:
<SortDescription PropertyName="Tag.TestProperty" />
If there is only one property to sort, you can simply use the tag for it.
, Tag , . , - DependencyProperty , , .