I would like to have the modal background fade away instead of "pop" away when the modal window is closed. I created a storyboard with a color animation, and tried running it on the Closed event, as well as in an overridden OnClosed method, but no go.
How can I do this? Code below:
Thanks
Jonathan
Main page has just a button that creates a new instance of my "modalDialog" and then runs a .ShowDialog() on it.
RadWindow XAML:
RadWindow Code Behind:
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Net;
using
System.Windows;
using
System.Windows.Controls;
using
System.Windows.Documents;
using
System.Windows.Input;
using
System.Windows.Media;
using
System.Windows.Media.Animation;
using
System.Windows.Shapes;
using
Telerik.Windows.Controls;
namespace
SilverlightApplication2
{
public
partial
class
modalPopup : RadWindow
{
WindowClosedEventArgs _args;
public
modalPopup()
{
InitializeComponent();
StoryBoard1.Completed +=
new
EventHandler(StoryBoard1_Completed);
this
.Closed +=
new
EventHandler<WindowClosedEventArgs>(modalPopup_Closed);
SolidColorBrush br = (SolidColorBrush)
this
.Resources[
"Brush1"
];
this
.ModalBackground = br;
// Below so can test storyboards on init and prove that they are "good" storyboards
// (ie they change the desired properties in the desired way)
//StoryBoard1.Begin();
StoryBoard2.Begin();
}
protected
override
void
OnClosed(WindowClosedEventArgs args)
{
StoryBoard1.Begin();
_args = args;
}
void
StoryBoard1_Completed(
object
sender, EventArgs e)
{
base
.OnClosed(_args);
}
// Tried running the storyboard on this.Closed event. Didn't work
void
modalPopup_Closed(
object
sender, WindowClosedEventArgs e)
{
//StoryBoard1.Begin();
}
}
}