Skip to content

it3xl/close_childwindow_by_overlay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Close the ChildWindow by its Overlay

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:

  1. Silverlight Behaviour,
  2. simple inheritance from the tweaked CildWindow,
  3. instantiating of the tweaked CildWindow class,
  4. or both.

The main idea of this project is to deliver the following things:

  1. Guarantee closing of your ChildWindow by a first tap on its overlay.
  2. Resolve the locking problem of RootVisual's controls after a ChildWindow will be closed.
  3. Get a complete and proven solution at once00.
  4. Save the own time.
  5. and I humbly hope that this common in the world of WEB 2.0 approach will be included to the Silverlight ChildWindow control.

How to use

Add .dll files of this project to your project.
Use one of next code approaches:

By the behavior

<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>
<!-- ... -->

By the inheritance or instantiating

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();

Silverlight's live example

ChildWindow Closed By Overlay solution

The example's screenshort:

Close the ChildWindow by its Overlay screenshort

it3xl.ru

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published