private void fireShowing() { if (Showing != null) { Showing.Invoke(this, EventArgs.Empty); } }
protected virtual PopupShowingEventArgs OnShowing() { var args = new PopupShowingEventArgs(); Showing?.Invoke(this, args); return(args); }
public IAsyncAction ShowAsync() { return(AsyncAction.FromTask(async ct => { CoreDispatcher.CheckThreadAccess(); UIApplication.SharedApplication.StatusBarHidden = false; Showing?.Invoke(this, null); })); }
public IAsyncAction ShowAsync() { return(AsyncAction.FromTask(async ct => { CoreDispatcher.CheckThreadAccess(); _isShown = true; UpdateSystemUiVisibility(); Showing?.Invoke(this, null); })); }
private void OnIsOpenChanged() { if (IsOpen) { Showing?.Invoke(this, new CalloutEventArgs(this)); } else { Hiding?.Invoke(this, new CalloutEventArgs(this)); } }
public virtual void Show() { if (Visible) { return; } gameObject.SetActive(true); OnShown(); Showing?.Invoke(); AnyViewShowing?.Invoke(this); }
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; } }
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); } }
protected virtual void OnShowing() { Showing?.Invoke(this, EventArgs.Empty); }
private void OnCalloutShowing(object sender, CalloutEventArgs e) { Showing?.Invoke(this, e); }
/// <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);