public MainPage() { InitializeComponent(); FloatingWindow window = new FloatingWindow(); //can also create floating windows directly in the XAML (see MainPage.xaml) window.Title = "Centered Window"; window.IconText = "Centered Window"; host.Add(window); window.Show(); }
public MainPage() { InitializeComponent(); FloatingWindow window = new FloatingWindow(); window.Title = "Centered Window"; window.IconText = "Centered Window"; host.Add(window); window.Show(); }
public MainWindow() { InitializeComponent(); this.Width = System.Windows.SystemParameters.WorkArea.Width - 200; this.Height = System.Windows.SystemParameters.WorkArea.Height - 200; FloatingWindow window = new FloatingWindow(); window.Title = "Centered Window"; window.IconText = "Centered Window"; host.Add(window); window.Show(); }
private void ShowNewWindow_Click(object sender, RoutedEventArgs e) { FloatingWindow window = new FloatingWindow(); host.Add(window); string title = "Window " + nWindows++; window.Title = title; window.IconText = title; window.Activated += (s, a) => { Debug.WriteLine("Activated: {0}", window.IconText); }; window.Deactivated += (s, a) => { Debug.WriteLine("Deactivated: {0}", window.IconText); }; window.Show(startPoint); startPoint = startPoint.Add(20, 20); }
/// <summary> /// Initializes a new instance of the <see cref="ActiveWindowChangedEventArgs"/> class. /// </summary> /// <param name="oldWindow">The old active FloatingWindow.</param> /// <param name="newWindow">The new active FloatingWindow.</param> public ActiveWindowChangedEventArgs(FloatingWindow oldWindow, FloatingWindow newWindow) { this.Old = oldWindow; this.New = newWindow; }
private void UnsubscribeFromFloatingWindowEvents(FloatingWindow w) { //w.RemoveHandler(MouseLeftButtonDownEvent, new MouseButtonEventHandler(FloatingWindow_MouseLeftButtonDown)); //w.RemoveHandler(MouseRightButtonDownEvent, new MouseButtonEventHandler(FloatingWindow_MouseRightButtonDown)); w.RemoveHandler(MouseLeftButtonUpEvent, new MouseButtonEventHandler(FloatingWindow_MouseLeftButtonUp)); w.RemoveHandler(MouseRightButtonUpEvent, new MouseButtonEventHandler(FloatingWindow_MouseRightButtonUp)); //w.MouseMove -= FloatingWindow_MouseMove; w.MouseWheel -= FloatingWindow_MouseWheel; }
private void SubscribeToFloatingWindowEvents(FloatingWindow w) { //w.AddHandler(MouseLeftButtonDownEvent, new MouseButtonEventHandler(FloatingWindow_MouseLeftButtonDown), true); //passing true to get handled events too //w.AddHandler(MouseRightButtonDownEvent, new MouseButtonEventHandler(FloatingWindow_MouseRightButtonDown), true); w.AddHandler(MouseLeftButtonUpEvent, new MouseButtonEventHandler(FloatingWindow_MouseLeftButtonUp), true); w.AddHandler(MouseRightButtonUpEvent, new MouseButtonEventHandler(FloatingWindow_MouseRightButtonUp), true); //w.MouseMove += FloatingWindow_MouseMove; w.MouseWheel += FloatingWindow_MouseWheel; }