Anyone got any neat solutions to prevent a Silverlight ChildWindow being moved?
thanks,
Mark
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’m not sure you’d call this neat but…
ImmovableChildWindow.ChildWindow.ImmoveableChildWindowImmovableChildWindowstyle.TargetTypefor this copy to the same value as the exitingImmovaleChildWindowstyle.ImmovableChildWindow.Templatesetter change theTargetTypeof to the same value as the styleTargetTypeBorderwith the name Chrome. Delete thex:Name="Chrome"attribute. (This is what we are really after).Now when you create a new ChildWindow item it will by default inherit form
ChildWindow, if you want it to be immovable you need modify it to inherit fromImmovableChildWindowinstead (change the base type in the code-behind and the root tag name in the xaml).The
ChildWindowattaches events to theFrameWorkElementwith the name “Chrome” which enables the child window to be moved about. However being a well-behaved templated control, if it can’t find aFrameworkElementcalled “Chrome” it just continues to work without that feature.