Tech Off Thread

3 posts

Get Name of Dependency Property

Back to Forum: Tech Off
  • 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

  • User profile image
    Sven Groot

    How about VerticalLinesProperty.Name?

  • User profile image
    LotharV

    @Sven Groot: The Name property isn't supported in winrt...

Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.