Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WCF and WF
  4. Intellisense for Attached Property values?

Intellisense for Attached Property values?

Scheduled Pinned Locked Moved WCF and WF
tutorialquestionvisual-studiowpfalgorithms
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Q Offline
    Q Offline
    quetzilla
    wrote on last edited by
    #1

    A lot of the articles on attached properties use DockPanel.Dock as an example, yet DockPanel.Dock does something that I haven't seen explained in all my searching so far: In the XAML editor, there is an intellisense dropdown that displays the four possible options (Top, Left, etc). I've been searching high and low but I can't figure out how to set up my property to display a set of options like that in intellisense. Obviously it's not absolutely required for my current project, but I'd really like to know how to get those to show up. Do I need some kind of converter, and if so how do I link that to the property?

    G 1 Reply Last reply
    0
    • Q quetzilla

      A lot of the articles on attached properties use DockPanel.Dock as an example, yet DockPanel.Dock does something that I haven't seen explained in all my searching so far: In the XAML editor, there is an intellisense dropdown that displays the four possible options (Top, Left, etc). I've been searching high and low but I can't figure out how to set up my property to display a set of options like that in intellisense. Obviously it's not absolutely required for my current project, but I'd really like to know how to get those to show up. Do I need some kind of converter, and if so how do I link that to the property?

      G Offline
      G Offline
      Gideon Engelberth
      wrote on last edited by
      #2

      My guess is that it's because the property is of an enum type.

      Q 1 Reply Last reply
      0
      • G Gideon Engelberth

        My guess is that it's because the property is of an enum type.

        Q Offline
        Q Offline
        quetzilla
        wrote on last edited by
        #3

        I tried creating an enum type for an attached property, but the enum names didn't show up in the xaml editor, and entering them manually results in an error message saying 'Cannot convert "foo" to string'. Maybe I will try using Reflector to figure it out.

        A 1 Reply Last reply
        0
        • Q quetzilla

          I tried creating an enum type for an attached property, but the enum names didn't show up in the xaml editor, and entering them manually results in an error message saying 'Cannot convert "foo" to string'. Maybe I will try using Reflector to figure it out.

          A Offline
          A Offline
          AspDotNetDev
          wrote on last edited by
          #4

          quetzilla wrote:

          I will try using Reflector to figure it out

          I imagine there is some sort of attribute decorating the property. That is what is typically done when there needs to be options for the designer.

          [Forum Guidelines]

          Q 1 Reply Last reply
          0
          • A AspDotNetDev

            quetzilla wrote:

            I will try using Reflector to figure it out

            I imagine there is some sort of attribute decorating the property. That is what is typically done when there needs to be options for the designer.

            [Forum Guidelines]

            Q Offline
            Q Offline
            quetzilla
            wrote on last edited by
            #5

            I found it, it's AttachedPropertyBrowsableForChildren: http://msdn.microsoft.com/en-us/library/system.windows.attachedpropertybrowsableforchildrenattribute.aspx[^] Will be nice to have that working now!

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups