Anyone got any neat solutions to prevent a Silverlight ChildWindow being moved?
thanks, Mark
Anyone got any neat solutions to prevent a Silverlight ChildWindow being moved?
thanks, Mark
I'm not sure you'd call this neat but...
ImmovableChildWindow. ChildWindow.ImmoveableChildWindowImmovableChildWindow style.TargetType for this copy to the same value as the exiting ImmovaleChildWindow style.ImmovableChildWindow.Template setter change the TargetType of to the same value as the style TargetTypeBorder with the name Chrome. Delete the x: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 from ImmovableChildWindow instead (change the base type in the code-behind and the root tag name in the xaml).
The ChildWindow attaches events to the FrameWorkElement with the name "Chrome" which enables the child window to be moved about. However being a well-behaved templated control, if it can't find a FrameworkElement called "Chrome" it just continues to work without that feature.