Пример #1
0
 void titlebar_CloseEvent()
 {
     if (CloseFrameEvent != null)
     {
         CloseFrameEvent(this.title);
     }
     if (childControl is IFrameChild)
     {
         IFrameChild child = (IFrameChild)childControl;
         child.FrameClose();
     }
     this.Close();
     //DoubleAnimation rotation = new DoubleAnimation(0, TimeSpan.FromSeconds(0.2));
     //rotation.Completed += new EventHandler(rotation_Completed);
     //rotation.AutoReverse = false;
     //rotation.FillBehavior = FillBehavior.HoldEnd;
     //this.Background = Brushes.Transparent;
     //this.rotate.BeginAnimation(RotateTransform.AngleProperty, rotation, HandoffBehavior.SnapshotAndReplace);
 }
Пример #2
0
 public Frame(string title, UserControl control)
 {
     InitializeComponent();
     this.title              = title;
     this.childControl       = control;
     titlebar.Title          = title;
     titlebar.CloseEvent    += new TitleBarControl.CloseFrameEventHandler(titlebar_CloseEvent);
     titlebar.MinFrameEvent += new TitleBarControl.MinFrameEventHandler(titlebar_MinFrameEvent);
     titlebar.MaxFrameEvent += new TitleBarControl.MaxFrameEventHandler(titlebar_MaxFrameEvent);
     this.Top = 100;
     usercontrol.Children.Add(control);
     if (control is IFrameChild)
     {
         IFrameChild frameChild = (IFrameChild)control;
         frameChild.FrameCloseEvent += new FrameCloseEventHandler(frameChild_FrameCloseEvent);
     }
     this.Loaded               += new RoutedEventHandler(Frame_Loaded);
     this.ShowInTaskbar         = false;
     this.ResizeMode            = ResizeMode.NoResize;
     this.Topmost               = true;
     this.WindowStartupLocation = WindowStartupLocation.CenterScreen;
 }