Tech Off Post

Single Post Permalink

View Thread: Get Name of Dependency Property
  • User profile image
    LotharV

    Hi

    For a project I need to get the Name of a DependencyProperty. but I can't figure out how. It is a WinRt project.

    I need some way to retrieve the name "VerticalLines" I used in the following RegisterAttached.

     public static Dictionary<int, int> GetVerticalLines(DependencyObject obj)
            {
                return (Dictionary<int, int>)obj.GetValue(VerticalLinesProperty);
            }
            public static void SetVerticalLines(DependencyObject obj, Dictionary<int, int> value)
            {
                obj.SetValue(VerticalLinesProperty, value);
            }
            public static readonly DependencyProperty VerticalLinesProperty =
                DependencyProperty.RegisterAttached("VerticalLines", typeof(Dictionary<int, int>), typeof(ResizeBehavior), new PropertyMetadata(new Dictionary<int, int>()));
    

    Thanks in advance,

    Lothar