class GridEx : Grid
{
public static string GetLocation(DependencyObject obj) => (string)obj.GetValue(LocationProperty);
public static void SetLocation(DependencyObject obj, string value) => obj.SetValue(LocationProperty, value);
public static readonly DependencyProperty LocationProperty =
DependencyProperty.RegisterAttached(
"Location", typeof(string), typeof(GridEx),
new PropertyMetadata(string.Empty, (o, args) => EnsureParentSubscription((FrameworkElement)o)));