コード例 #1
0
 private void fireShowing()
 {
     if (Showing != null)
     {
         Showing.Invoke(this, EventArgs.Empty);
     }
 }
コード例 #2
0
ファイル: Popup.cs プロジェクト: xamarinua/FormsPopup
        protected virtual PopupShowingEventArgs OnShowing()
        {
            var args = new PopupShowingEventArgs();

            Showing?.Invoke(this, args);
            return(args);
        }
コード例 #3
0
 public IAsyncAction ShowAsync()
 {
     return(AsyncAction.FromTask(async ct =>
     {
         CoreDispatcher.CheckThreadAccess();
         UIApplication.SharedApplication.StatusBarHidden = false;
         Showing?.Invoke(this, null);
     }));
 }
コード例 #4
0
 public IAsyncAction ShowAsync()
 {
     return(AsyncAction.FromTask(async ct =>
     {
         CoreDispatcher.CheckThreadAccess();
         _isShown = true;
         UpdateSystemUiVisibility();
         Showing?.Invoke(this, null);
     }));
 }
コード例 #5
0
 private void OnIsOpenChanged()
 {
     if (IsOpen)
     {
         Showing?.Invoke(this, new CalloutEventArgs(this));
     }
     else
     {
         Hiding?.Invoke(this, new CalloutEventArgs(this));
     }
 }
コード例 #6
0
        public virtual void Show()
        {
            if (Visible)
            {
                return;
            }

            gameObject.SetActive(true);
            OnShown();

            Showing?.Invoke();
            AnyViewShowing?.Invoke(this);
        }
コード例 #7
0
ファイル: PopupMenu.cs プロジェクト: jjg0519/OA
        public void Open(Point mousePos, int showDelayPeriod, object sender, MouseEventArgs e)
        {
            if (!MenuPopup.IsOpen)
            {
                if (!OpenMenuList.Contains(this))
                {
                    OpenMenuList.Add(this);
                }
                UIElement LayoutRoot = GetRootLayoutElement((FrameworkElement)sender);
                ClickedElements       = VisualTreeHelper.FindElementsInHostCoordinates(mousePos, LayoutRoot);
                RootGrid.Margin       = new Thickness(mousePos.X - 200 + OffsetX, mousePos.Y + OffsetY, 0, 0);
                ListBox.SelectedIndex = -1; // Reset selected item

                // Invoking the event via a dispatcher to make sure the visual tree for our listbox is created before the event handler is called
                if (Opening != null)
                {
                    ListBox.Dispatcher.BeginInvoke(() => Opening.Invoke(sender, e));
                }

                RootGrid.Width = 0;

                _timerOpen          = new DispatcherTimer();
                _timerOpen.Interval = TimeSpan.FromMilliseconds(showDelayPeriod);
                _timerOpen.Tick    += delegate
                {
                    _timerOpen.Stop();
                    // If menu has not already been closed by hovering on the outergrid
                    if (MenuPopup.IsOpen)
                    {
                        // Remove Width = 0 constraint set originally
                        RootGrid.Width = double.NaN;
                        if (Showing != null)
                        {
                            Showing.Invoke(sender, e);
                        }
                        Animate(RootGrid, "UIElement.Opacity", 0, 1, TimeSpan.FromMilliseconds(HoverShowDelay));
                        //Animate(ListBox, "(UIElement.Projection).(PlaneProjection.RotationY)", 90, 0, TimeSpan.FromMilliseconds(200));
                        if (Shown != null)
                        {
                            Shown.Invoke(sender, e);
                        }
                    }
                };
                _timerOpen.Start();

                MenuPopup.IsOpen = true;
            }
        }
コード例 #8
0
ファイル: GoToWindowContext.cs プロジェクト: hanw3/GoToWindow
        public void Show()
        {
            lock (_lock)
            {
                if (_mainWindow != null)
                {
                    Log.Debug("Sending Tab Again to Main Window.");
                    _mainWindow.ShortcutAgain();
                    return;
                }

                _mainViewModel = new MainViewModel();

                SetAvailableWindowSize(SystemParameters.PrimaryScreenWidth, SystemParameters.PrimaryScreenHeight);

                _mainWindow = new MainWindow {
                    DataContext = _mainViewModel
                };
                _mainWindow.Closing  += _mainWindow_Closing;
                _mainViewModel.Close += _mainViewModel_Close;

                Showing?.Invoke(this, new EventArgs());

                _mainWindow.Left  = SystemParameters.PrimaryScreenWidth / 2f - _mainViewModel.AvailableWindowWidth / 2f;
                _mainWindow.Top   = SystemParameters.PrimaryScreenHeight / 2f - (_mainViewModel.AvailableWindowHeight + 56) / 2f;
                _mainWindow.Width = _mainViewModel.AvailableWindowWidth;

                _mainWindow.Show();

                var interopHelper = new WindowInteropHelper(_mainWindow);
                _mainWindowEntry = WindowEntryFactory.Create(interopHelper.Handle);

                Log.DebugFormat("GoToWindow main window created with hWnd {0}", _mainWindowEntry.HWnd);

                _mainWindow.SetFocus();
                _mainWindowEntry.Focus();

                Application.Current.Dispatcher.InvokeAsync(LoadViewModel, DispatcherPriority.Input);
            }
        }
コード例 #9
0
 protected virtual void OnShowing()
 {
     Showing?.Invoke(this, EventArgs.Empty);
 }
コード例 #10
0
 private void OnCalloutShowing(object sender, CalloutEventArgs e)
 {
     Showing?.Invoke(this, e);
 }
コード例 #11
0
 /// <summary>
 /// Raises the <see cref="E:Showing" /> event.
 /// </summary>
 /// <param name="args">The <see cref="ConsoleWindowShowingEventArgs"/> instance containing the event data.</param>
 protected internal virtual void OnShowing(ConsoleWindowShowingEventArgs args)
 => Showing?.Invoke(this, args);