update msg window

This commit is contained in:
qianlifeng 2014-01-08 19:08:48 +08:00
parent 70339423d0
commit 881d265579
2 changed files with 12 additions and 10 deletions

View File

@ -7,7 +7,7 @@
ResizeMode="NoResize"
WindowStyle="None"
ShowInTaskbar="False"
Title="Msg" Height="60" Width="382.978">
Title="Msg" Height="60" Width="420">
<Window.Triggers>
<EventTrigger RoutedEvent="Window.Loaded">
<BeginStoryboard>
@ -22,7 +22,7 @@
<Grid.ColumnDefinitions>
<ColumnDefinition Width="32"></ColumnDefinition>
<ColumnDefinition/>
<ColumnDefinition Width="32"></ColumnDefinition>
<ColumnDefinition Width="16"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Image x:Name="imgIco" Width="32" Height="32" HorizontalAlignment="Left" ></Image>
<Grid HorizontalAlignment="Stretch" Margin="5 0 0 0" Grid.Column="1" VerticalAlignment="Stretch">

View File

@ -69,14 +69,16 @@ namespace WinAlfred
}
imgIco.Source = new BitmapImage(new Uri(icopath));
Show();
new Timer(o =>
{
if (!closing)
{
closing = true;
Dispatcher.Invoke(new Action(fadeOutStoryboard.Begin));
}
}, null, TimeSpan.FromSeconds(3), TimeSpan.FromMilliseconds(-1));
Dispatcher.DelayInvoke("ShowMsg",
o =>
{
if (!closing)
{
closing = true;
Dispatcher.Invoke(new Action(fadeOutStoryboard.Begin));
}
}, TimeSpan.FromSeconds(3));
}
}
}