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. Blocking the inheritance of a dependency property

Blocking the inheritance of a dependency property

Scheduled Pinned Locked Moved WCF and WF
comoophelpquestion
1 Posts 1 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.
  • C Offline
    C Offline
    chaiguy1337
    wrote on last edited by
    #1

    Hey all. I have a weird problem that I hope has a simple solution: I have a TextBox that gives the user a place to write a bunch of text (obviously), but I've adjusted its LineHeight by means of the attached properties TextBlock.LineHeight and TextBlock.LineStackingStrategy (since TextBox doesn't define these properties directly, yet this actually works I guess because TextBox is implemented using an internal TextBlock). Anyhow, the problem is when I open up a contextual menu on some text in the TextBox--the line height is passed onto the context menu! Bizarre. So what I end up with are some really awkwardly spaced-out menu items (since the text in the TextBox is rather large). Clearly the problem is the attached properties are being inherited by the TextBlocks inside the context menu, and I need to prevent this from happening. Is there a way to set the attached properties on the TextBox and have them non-inheriting? Logan

    “Time and space can be a bitch.” –Gushie, Quantum Leap {o,o}.oO( Looking for a great RSS reader? Try FeedBeast! ) |)””’)            Built with home-grown CodeProject components! -”-”-

    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