public static WinMsg GetMsg() { if (win == null) { win = new WinMsg(); } return(win); }
void da_Completed(object sender, EventArgs e) { AnimationTimeline timeline = (sender as AnimationClock).Timeline; /* !!! 通过附加属性把UI对象取回 !!! */ object uiElement = Storyboard.GetTarget(timeline); TextBlock t = uiElement as TextBlock; StackPanel sp = t.Parent as StackPanel; sp.Children.Remove(t); if (sp.Children.Count <= 0) { win.Close(); win = null; return; } win.Left = SystemParameters.WorkArea.Width - win.Width; win.Top = SystemParameters.WorkArea.Height - win.Height - 20; }
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { win = null; }
public static void ShowMsg(string msg, Color c) { WinMsg w = WinMsg.GetMsg(); w.ShowMsg(msg, c); }