private void Button_be_contentCreator_Click(object sender, RoutedEventArgs e)
        {
            FloatingWindow floating = new FloatingWindow(new CreateArtistPage());

            floating.ShowDialog();
            LoadProfile();
        }
Ejemplo n.º 2
0
        private void OnFloatingWindowMove(object sender, EventArgs e)
        {
            _moveTimer.Stop();

            // Position the floating window relative to the screen position
            if (FloatingWindow != null)
            {
                if (_offset.X > (FloatingWindow.Width - 20))
                {
                    _offset.X = FloatingWindow.Width - 20;
                }

                if (_offset.Y > (FloatingWindow.Height - 20))
                {
                    _offset.Y = FloatingWindow.Height - 20;
                }


                FloatingWindow.SetBounds(_screenPt.X - FloatingWindowOffset.X,
                                         _screenPt.Y - FloatingWindowOffset.Y,
                                         FloatingWindow.Width,
                                         FloatingWindow.Height,
                                         BoundsSpecified.Location);
            }
        }
        private void Button_add_playlist_Click(object sender, RoutedEventArgs e)
        {
            Button         button   = sender as Button;
            Track          track    = button.DataContext as Track;
            FloatingWindow floating = new FloatingWindow(new AddToPlaylist(track));

            floating.ShowDialog();
        }
Ejemplo n.º 4
0
            protected virtual void OnEnable()
            {
                SceneView.duringSceneGui   += OnSceneGUI;
                Selection.selectionChanged += Close;
                Tools.hidden    = true;
                _activeInstance = this;

                selectedTool = 0;
            }
Ejemplo n.º 5
0
            protected virtual void OnDisable()
            {
                SceneView.duringSceneGui   -= OnSceneGUI;
                Selection.selectionChanged -= Close;
                Tools.hidden    = false;
                _activeInstance = null;

                UnityEditorInternal.InternalEditorUtility.RepaintAllViews();
            }
 /// <summary>
 /// Removes the specified floating window from the collection of child elements of the host.
 /// </summary>
 /// <param name="window">The floating window.</param>
 public void Remove(FloatingWindow window)
 {
     if (window != null)
     {
         hostCanvas.Children.Remove(window);
         modalCanvas.Children.Remove(window);
         iconBar.Remove(window);
     }
 }
Ejemplo n.º 7
0
 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;
 }
Ejemplo n.º 8
0
 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;
 }
Ejemplo n.º 9
0
        public void Execute(object parameter)
        {
            if (!string.IsNullOrWhiteSpace(StyleName) && AttachmentEditorStyle == null)
            {
                return;
            }

            FeatureLayer layer = GetFeatureLayer(parameter);

            if (layer == null)
            {
                return;
            }

            Graphic graphic = layer.SelectedGraphics != null?layer.SelectedGraphics.ElementAt(0) : null;

            if (graphic == null)
            {
                return;
            }

            if (_configuration == null)
            {
                _configuration = new AttachmentEditorConfiguration();
            }

            if (_attachmentEditor == null)
            {
                _attachmentEditor             = new AttachmentEditor();
                _attachmentEditor.Width       = _configuration.Width;
                _attachmentEditor.Height      = _configuration.Height;
                _attachmentEditor.FilterIndex = _configuration.FilterIndex;
                _attachmentEditor.Filter      = _configuration.Filter;
                _attachmentEditor.Multiselect = _configuration.MultiSelect;
                if (AttachmentEditorStyle != null)
                {
                    _attachmentEditor.Style = AttachmentEditorStyle;
                }

                _window         = new FloatingWindow();
                _window.Content = _attachmentEditor;
                _window.Title   = Resources.Strings.AttachmentEditorHeader;
            }

            _attachmentEditor.DataContext   = _configuration;
            _attachmentEditor.GraphicSource = null;
            _attachmentEditor.FeatureLayer  = null;
            if (graphic != null)
            {
                _attachmentEditor.FeatureLayer  = layer;
                _attachmentEditor.GraphicSource = graphic;
                _window.Show(true);
            }
        }
Ejemplo n.º 10
0
        public void InitializeUI()
        {
            windowVideoFoscam = AddDisplayable(videoFoscam, "Video - Foscam IP Camera", new Rect(0, 0, 600, 600)); //IVideo interface extends from IDisplayable
            //windowVideoKinect = AddDisplayable(videoKinect, "Video - Kinect Color Camera", new Rect(0, 600, 1000, 150)); //IVideo interface extends from IDisplayable

            windowPTZFoscam = AddDisplayable(ptzFoscam as IDisplayable, "PTZ - Foscam IP Camera", new Rect(600, 400, 200, 200));                                      //AddDisplayable will ignore the call if null (that is if the tracker isn't an IDisplayable)

            windowTrackerKinectAudio = AddDisplayable(trackerKinectAudio as IDisplayable, "Tracking - Kinect Microphone Array", new Rect(600, 200, 200, 200), false); //AddDisplayable will ignore the call if null (that is if the tracker isn't an IDisplayable)
            windowTrackerKinectDepth = AddDisplayable(trackerKinectDepth as IDisplayable, "Tracking - Kinect Depth", new Rect(800, 200, 400, 400), false);
            windowTrackerUbisense    = AddDisplayable(trackerUbisense as IDisplayable, "Tracking - Ubisense", new Rect(600, 0, 450, 200), false);                     //AddDisplayable will ignore the call if null (that is if the tracker isn't an IDisplayable)
        }
Ejemplo n.º 11
0
        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();
        }
Ejemplo n.º 12
0
        public MainPage()
        {
            InitializeComponent();

            FloatingWindow window = new FloatingWindow();

            window.Title    = "Centered Window";
            window.IconText = "Centered Window";
            host.Add(window);
            window.Show();
        }
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     if (floatingWindow == null)
     {
         floatingWindow         = new FloatingWindow();
         floatingWindow.Owner   = this;
         floatingWindow.Closed += FloatingWindow_Closed;
     }
     floatingWindow.Show();
     floatingWindow.Activate();
 }
#pragma warning disable U2U1003 // Avoid declaring methods used in delegate constructors static
        private static void FloatingWindowVisibilityChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
#pragma warning restore U2U1003 // Avoid declaring methods used in delegate constructors static
        {
            if ((Visibility)e.NewValue == Visibility.Visible)
            {
                FloatingWindow window = (FloatingWindow)d;
                window.ChangeOwner(IntPtr.Zero);
                window.ShowInTaskbar = true;
                ActivityLog.LogInformation(nameof(FreeRangeWindows), "Making " + window.Title + " free range");
            }
        }
Ejemplo n.º 15
0
 private static void OnMakeFloatingExecuted(object sender, ExecutedRoutedEventArgs e)
 {
     DockItem dockItem = ((AutoHideWindow)sender).DockItem;
     DockControl dockControl = dockItem.DockControl;
     FloatingWindow floatingWindow = GetFloatingWindow(dockItem);
     Rect floatingWindowBounds;
     if (floatingWindow != null)
         floatingWindowBounds = new Rect(floatingWindow.Left, floatingWindow.Top, floatingWindow.Width, floatingWindow.Height);
     else
         floatingWindowBounds = new Rect(new Point(double.NaN, double.NaN), dockControl.DefaultFloatingWindowSize);
     dockItem.Show(dockItem.DockControl, floatingWindowBounds);
 }
Ejemplo n.º 16
0
        internal NativeFloatingWindow(FloatingWindow floatingWindow)
        {
            // Call BeginInit/EndInit pair to make sure the default style applied.
            //BeginInit();

            Loaded     += new RoutedEventHandler(OnLoaded);
            Unloaded   += new RoutedEventHandler(OnUnloaded);
            Owner       = Window.GetWindow(floatingWindow.DockControl);
            DataContext = floatingWindow;

            //EndInit();
        }
Ejemplo n.º 17
0
 // Workaround Issue #1 https://github.com/DevZest/WpfDocking/issues/1
 private void OnFloatingWindowChanged(FloatingWindow oldValue, FloatingWindow newValue)
 {
     if (oldValue != null)
     {
         DetachIsVisibleChangedHandler(oldValue);
     }
     if (newValue != null)
     {
         RefreshVisibility();
         AttachIsVisibleChangedHandler(newValue);
     }
 }
Ejemplo n.º 18
0
        private void OnDockingFloatspaceDisposed(object sender, EventArgs e)
        {
            // Cast to correct type and unhook event handlers so garbage collection can occur
            KryptonDockingFloatspace floatspaceElement = (KryptonDockingFloatspace)sender;

            floatspaceElement.Disposed -= new EventHandler(OnDockingFloatspaceDisposed);

            // Kill the floatspace window
            if (!FloatingWindow.IsDisposed)
            {
                FloatingWindow.Dispose();
            }
        }
Ejemplo n.º 19
0
        private void OnViewHeaderDragDelta(object sender, DragDeltaEventArgs args)
        {
            DragUndockHeader dragUndockHeader = (DragUndockHeader)args.OriginalSource;

            if (!dragUndockHeader.IsWindowTitleBar)
            {
                return;
            }
            FloatingWindow ancestor = Microsoft.VisualStudio.PlatformUI.ExtensionMethods.FindAncestor <FloatingWindow>((Visual)dragUndockHeader);

            DpiHelper.SetDeviceLeft((Window)ancestor, DpiHelper.GetDeviceLeft((Window)ancestor) + args.HorizontalChange);
            DpiHelper.SetDeviceTop((Window)ancestor, DpiHelper.GetDeviceTop((Window)ancestor) + args.VerticalChange);
        }
Ejemplo n.º 20
0
 private void OnFloatingWindowsChanged(object sender, NotifyCollectionChangedEventArgs e)
 {
     if (e.Action == NotifyCollectionChangedAction.Add)
     {
         FloatingWindow floatingWindow = (FloatingWindow)e.NewItems[0];
         NativeFloatingWindow.SetNativeFloatingWindow(floatingWindow, new NativeFloatingWindow(floatingWindow));
     }
     else if (e.Action == NotifyCollectionChangedAction.Remove)
     {
         FloatingWindow floatingWindow = (FloatingWindow)e.OldItems[0];
         NativeFloatingWindow.SetNativeFloatingWindow(floatingWindow, null);
     }
 }
Ejemplo n.º 21
0
        /// <summary>
        /// Moves the window to the "modal" layer.
        /// </summary>
        /// <param name="modalWindow">The modal window.</param>
        private void MoveWindowToModalLayer(FloatingWindow modalWindow)
        {
            FloatingWindow window = this.ModalWindow;

            if (window != null && window != modalWindow)
            {
                // If there is already a modal window - move it to the HostCanvas
                window.MoveToContainer(hostCanvas);
                SetTopmost(window);
            }

            modalWindow.MoveToContainer(modalCanvas);
        }
Ejemplo n.º 22
0
        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();
        }
Ejemplo n.º 23
0
        private void ShowFloat(FloatSite floatSite)
        {
            FloatingWindow floatingControl = this.GetFloatingControl(floatSite);

            floatingControl.DataContext = (object)floatSite;
            this.EnsureFloatingSiteInVisibleBounds(floatSite);
            if (this.CanShowFloatingWindows)
            {
                floatingControl.Show();
            }
            else
            {
                this.DelayShowElement(floatingControl);
            }
        }
Ejemplo n.º 24
0
        private void ShowNewWindow_Click(object sender, RoutedEventArgs e)
        {
            FloatingWindow window = new FloatingWindow();
            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);

            host.Add(window);
            window.Show(startPoint);
            startPoint = startPoint.Add(20, 20);
        }
Ejemplo n.º 25
0
            protected virtual void OnEnable()
            {
                SceneView.
#if UNITY_2019_2_OR_NEWER
                    duringSceneGui
#else
                onSceneGUIDelegate
#endif
                    += OnSceneGUI;
                Selection.selectionChanged += Close;
                Tools.hidden    = true;
                _activeInstance = this;

                selectedTool = 0;
            }
Ejemplo n.º 26
0
            protected virtual void OnDisable()
            {
                SceneView.
#if UNITY_2019_2_OR_NEWER
                    duringSceneGui
#else
                onSceneGUIDelegate
#endif
                    -= OnSceneGUI;
                Selection.selectionChanged -= Close;
                Tools.hidden    = false;
                _activeInstance = null;

                UnityEditorInternal.InternalEditorUtility.RepaintAllViews();
            }
Ejemplo n.º 27
0
        /// <summary>
        /// Removes the specified window from the IconBar.
        /// </summary>
        /// <param name="window">The window to remove from the IconBar.</param>
        public void Remove(FloatingWindow window)
        {
            if (window != null)
            {
                var icon = (from windowIcon in carousel.Children.OfType <WindowIcon>()
                            where windowIcon.Window == window
                            select windowIcon).FirstOrDefault();

                if (icon != null)
                {
                    icon.Click -= new RoutedEventHandler(Icon_Click);
                    carousel.Children.Remove(icon);
                }
            }
        }
        /// <summary>
        /// Hides the dialog window
        /// </summary>
        /// <param name="windowContents">Contents of the window displayed earlier using ShowWindow</param>
        public void HideWindow(FrameworkElement windowContents)
        {
            if (windowContents == null)
            {
                throw new ArgumentNullException("windowContents");
            }

            int            hashCode       = windowContents.GetHashCode();
            FloatingWindow floatingWindow = null;

            if (m_FloatingWindows.TryGetValue(hashCode, out floatingWindow))
            {
                floatingWindow.Hide();
                // close will automatically remove the window from the hash table in floatingWindow_Closed
            }
        }
Ejemplo n.º 29
0
        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";

            //TODO: is this needed?
            window.Scale = 1d / host.ZoomHost.ContentScale; //TODO: !!! don't use host.ContentScale, has bug and is always 1

            host.Add(window);
            window.Show();
        }
Ejemplo n.º 30
0
        internal static void SetNativeFloatingWindow(FloatingWindow floatingWindow, NativeFloatingWindow value)
        {
            NativeFloatingWindow oldValue = GetNativeFloatingWindow(floatingWindow);

            if (oldValue != null)
            {
                oldValue.DataContext = null; // this should fix "Cannot set Visibility or call Show or ShowDialog after window has closed." exception
                oldValue.Close();
            }
            if (value == null)
            {
                floatingWindow.ClearValue(NativeFloatingWindowProperty);
            }
            else
            {
                floatingWindow.SetValue(NativeFloatingWindowProperty, value);
            }
        }