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" ResizeMode="NoResize"
WindowStyle="None" WindowStyle="None"
ShowInTaskbar="False" ShowInTaskbar="False"
Title="Msg" Height="60" Width="382.978"> Title="Msg" Height="60" Width="420">
<Window.Triggers> <Window.Triggers>
<EventTrigger RoutedEvent="Window.Loaded"> <EventTrigger RoutedEvent="Window.Loaded">
<BeginStoryboard> <BeginStoryboard>
@ -22,7 +22,7 @@
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="32"></ColumnDefinition> <ColumnDefinition Width="32"></ColumnDefinition>
<ColumnDefinition/> <ColumnDefinition/>
<ColumnDefinition Width="32"></ColumnDefinition> <ColumnDefinition Width="16"></ColumnDefinition>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Image x:Name="imgIco" Width="32" Height="32" HorizontalAlignment="Left" ></Image> <Image x:Name="imgIco" Width="32" Height="32" HorizontalAlignment="Left" ></Image>
<Grid HorizontalAlignment="Stretch" Margin="5 0 0 0" Grid.Column="1" VerticalAlignment="Stretch"> <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)); imgIco.Source = new BitmapImage(new Uri(icopath));
Show(); Show();
new Timer(o =>
Dispatcher.DelayInvoke("ShowMsg",
o =>
{ {
if (!closing) if (!closing)
{ {
closing = true; closing = true;
Dispatcher.Invoke(new Action(fadeOutStoryboard.Begin)); Dispatcher.Invoke(new Action(fadeOutStoryboard.Begin));
} }
}, null, TimeSpan.FromSeconds(3), TimeSpan.FromMilliseconds(-1)); }, TimeSpan.FromSeconds(3));
} }
} }
} }