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