Created Dec 24, 2013; Migrated from CodePlex
The Silverlight's fastest and proven solution to make you ChildWindows control to be closed by its overlay.
You may use:
- Silverlight Behaviour,
- simple inheritance from the tweaked CildWindow,
- instantiating of the tweaked CildWindow class,
- or both.
The main idea of this project is to deliver the following things:
- Guarantee closing of your ChildWindow by a first tap on its overlay.
- Resolve the locking problem of RootVisual's controls after a ChildWindow will be closed.
- Get a complete and proven solution at once00.
- Save the own time.
- and I humbly hope that this common in the world of WEB 2.0 approach will be included to the Silverlight ChildWindow control.
Add .dll files of this project to your project.
Use one of next code approaches:
<controls:ChildWindow
x:Class="ChildWindowClosedByOverlay.Silverlight.TestChildWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:Behaviors="clr-namespace:OverlayClosingBehaviorProject;assembly=OverlayClosingBehaviorProject"
>
<i:Interaction.Behaviors>
<Behaviors:OverlayClosingChildWindowBehavior
DisabledClosingOverlay="False"
RightMouseButtonClosingTo="False"
/>
</i:Interaction.Behaviors>
<!-- ... -->
new ChildWindowWithClosingOverlay
{
// !!! Custom settings.
DisabledClosingOverlay = false,
RightMouseButtonClosingTo = false,
Title = "ChildWindow closed by Overlay",
Content = content,
OverlayBrush = new SolidColorBrush(Colors.Gray),
OverlayOpacity = 0.4,
HasCloseButton = false,
}
.Show();
ChildWindow Closed By Overlay solution
The example's screenshort:
it3xl.ru