public int ShowDW([In] bool fShow) { VisibilityChanged?.Invoke(this, new VisibilityChangedEventArgs { IsVisible = fShow }); return(HRESULT.S_OK); }
protected override void OnPropertyChanged(string name) { switch (name) { case nameof(Color): ActionSetsDataHelper.SetPresentationDefault(model, Color); Icon = model.Icon; model.Color = Color; break; case nameof(Description): model.Description = Description; break; case nameof(Name): model.Name = Name; break; case nameof(IsVisible): model.Visibility = IsVisible; VisibilityChanged?.Invoke(this, IsVisible); break; case nameof(Id): model.Id = Id; break; default: break; } base.OnPropertyChanged(name); }
public ForwardAppBarButton() { this.Label = "Forward"; this.Content = new FontIcon { FontFamily = new FontFamily("Segoe MDL2 Assets"), Glyph = Common.Mdl2.ArrowRight }; this.DefaultStyleKey = typeof(AppBarButton); Loaded += (s, e) => { if (this.Frame == null) { throw new NullReferenceException("Please set Frame property"); } this.Visibility = CalculateOnCanvasBackVisibility(); }; this.RenderTransform = new ScaleTransform { ScaleX = -1 }; if (Windows.ApplicationModel.DesignMode.DesignModeEnabled) { this.Visibility = Visibility.Visible; return; } this.Click += (s, e) => Frame.GoForward(); Window.Current.SizeChanged += (s, arg) => this.Visibility = CalculateOnCanvasBackVisibility(); RegisterPropertyChangedCallback(VisibilityProperty, (s, e) => VisibilityChanged?.Invoke(this, EventArgs.Empty)); }
/// <summary> /// Raises event 'VisibilityChanged' /// </summary> protected virtual void OnVisibilityChanged() { if (VisibilityChanged != null) { VisibilityChanged.Invoke(this, System.EventArgs.Empty); } }
public ForwardButton() { this.RenderTransform = new ScaleTransform { ScaleX = -1 }; this.Style = this.Resources["NavigationBackButtonNormalStyle"] as Style; this.DefaultStyleKey = typeof(ForwardButton); Loaded += (s, e) => { DependencyObject item = this; while (!((item = VisualTreeHelper.GetParent(item)) is Page)) { } Page page = item as Page; this.Frame = page.Frame; this.Visibility = CalculateOnCanvasBackVisibility(); }; if (Windows.ApplicationModel.DesignMode.DesignModeEnabled) { this.Visibility = Visibility.Visible; return; } this.Click += (s, e) => Frame.GoForward(); Window.Current.SizeChanged += (s, arg) => this.Visibility = CalculateOnCanvasBackVisibility(); RegisterPropertyChangedCallback(VisibilityProperty, (s, e) => VisibilityChanged?.Invoke(this, EventArgs.Empty)); }
/// <summary> /// Handles the menu's visiblility changing. /// Called after <code>CurrentVisibility</code> has already changed. /// </summary> /// <param name="from">The last state.</param> /// <param name="to">The new state the menu is changing to.</param> /// <seealso cref="CurrentVisibility"/> protected virtual void OnStateChanged(VisibilityState from, VisibilityState to) { // Update the animator Animator.SetInteger(stateField, (int)to); // Check to see if we're visible if (to == VisibilityState.Visible) { // Run setup when made visible OnVisibilityChangedToVisible(from, true); } // Check if this is managed if (MenuType != Type.UnmanagedMenu) { // Update the menu manager UpdateMenuManager(this, from, to); } // Stop listening to managed events if this menu is made to be hidden onStateChangedWhileManaged?.Invoke(this, from, to); if ((to == VisibilityState.Hidden) && (onStateChangedWhileManaged != null)) { onStateChangedWhileManaged = null; } }
public virtual void Hide() { // Debug.Log($"Hiding {gameObject.name}"); _canvasGroup.alpha = 0; _canvasGroup.interactable = false; _canvasGroup.blocksRaycasts = false; IsShown = false; VisibilityChanged?.Invoke(false); }
public virtual void Show() { // Debug.Log($"Showing {gameObject.name}"); _canvasGroup.alpha = 1; _canvasGroup.interactable = true; _canvasGroup.blocksRaycasts = true; IsShown = true; VisibilityChanged?.Invoke(true); }
public void InvokeVisibilityChanged(bool isAcceptingText) { try { VisibilityChanged?.Invoke(new SoftKeyboardEventArgs(isAcceptingText)); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex); } }
public Task HandleAsync(VisibilityChanged payload) { log.Debug($"Got event '{nameof(VisibilityChanged)}' is value '{payload.IsVisible}'."); if (payload.IsVisible && apiHub.Status != ApiHubStatus.Connected) { log.Debug("Starting connection."); return(apiHub.StartAsync()); } return(Task.CompletedTask); }
/// <summary> /// Makes the menu visible. Also provides one to assign a method to /// listen to the menu changing states until it's made hidden. /// </summary> /// <param name="stateChangedWhileManaged"><code>Action</code></param> /// <seealso cref="Show()"/> /// <seealso cref="Hide()"/> /// <seealso cref="Action<IMenu>"/> public void Show(VisibilityChanged stateChangedWhileManaged = null) { // Make sure the menu is Hidden if (CurrentVisibility == VisibilityState.Hidden) { // Set the run-once action onStateChangedWhileManaged = stateChangedWhileManaged; // Make the menu visible CurrentVisibility = VisibilityState.Visible; } }
protected override void OnPropertyChanged(string propertyName = null) { base.OnPropertyChanged(propertyName); if (propertyName == null) { return; } if (propertyName.Equals(nameof(IsVisible))) { VisibilityChanged?.Invoke(IsVisible); } }
protected void SetVisibility(Visibility visibility) { switch (visibility) { case Visibility.Collapsed: case Visibility.Hidden: horizLine.Visibility = horizGrid.Visibility = Visibility.Hidden; vertLine.Visibility = vertGrid.Visibility = Visibility.Hidden; break; case Visibility.Visible: horizLine.Visibility = horizGrid.Visibility = GetHorizontalVisibility(); vertLine.Visibility = vertGrid.Visibility = GetVerticalVisibility(); break; } VisibilityChanged?.Invoke(this, EventArgs.Empty); }
public BackButton() { this.InitializeComponent(); Loaded += (s, e) => { DependencyObject item = this; while (!((item = VisualTreeHelper.GetParent(item)) is Page)) { } Page page = item as Page; this.Frame = page.Frame; this.Visibility = CalculateOnCanvasBackVisibility(); }; MyBackButton.Click += (s, e) => Frame.GoBack(); Window.Current.SizeChanged += (s, arg) => this.Visibility = CalculateOnCanvasBackVisibility(); RegisterPropertyChangedCallback(VisibilityProperty, (s, e) => VisibilityChanged?.Invoke(this, EventArgs.Empty)); }
private void LaunchVisibilityChanged(Visibility visibility) { VisibilityChanged?.Invoke(_control, visibility); }
private void hideAnimation_Completed(object sender, object e) { VisibilityChanged?.Invoke(false); }
public void InvokeVisibilityChanged(SoftwareKeyboardEventArgs args) { VisibilityChanged?.Invoke(this, args); }
public void Show() { window.Visible = true; VisibilityChanged?.Invoke(this); }
internal static void OnVisibilityChanged(bool isVisible) { VisibilityChanged?.Invoke(null, isVisible); }
protected virtual void OnVisibilityChanged() { VisibilityChanged.SafeInvoke(this, EventArgs.Empty); }
protected virtual void OnVisibilityChanged() => VisibilityChanged?.Invoke(this, EventArgs.Empty);
public static void InvokeVisibilityChanged(object sender, bool val) { VisibilityChanged?.Invoke(sender, val); }
public void Hide() { window.Visible = false; VisibilityChanged?.Invoke(this); }
public void RaiseVisibilityChanged(object sender, EventArgs e) { VisibilityChanged?.Invoke(sender, e); }
/// <summary> /// Gets called whenever the visibility of the window changes. /// </summary> /// <param name="isVisible">A Boolean indicating the new visibility of the window.</param> protected virtual void OnVisibilityChanged(bool isVisible) { VisibilityChanged?.Invoke(this, new OverlayVisibilityEventArgs(isVisible)); }
private void tabItem_InternalVisibilityChanged(object sender, DependencyPropertyChangedEventArgs e) { VisibilityChanged?.Invoke(this, e); }
protected void OnVisiblityChanged(object sender, EventArgs e) { VisibilityChanged?.Invoke(sender, e); LastVisibleState = Visible; }
private static unsafe int OnMessage(UOMessage msg, int arg1, int arg2, int arg3, byte *data) { try { switch (msg) { case UOMessage.Ready: Ready = true; hooks.Send(UOMessage.ConnectionInfo, (int)ServerIP, ServerPort); hooks.Send(UOMessage.GameSize, Width, Height); OnInit(); break; case UOMessage.Connected: Connected.Raise(); break; case UOMessage.Disconnecting: Disconnecting.Raise(); break; case UOMessage.Closing: Closing.Raise(); break; case UOMessage.Focus: FocusChanged.Raise(arg1 != 0); break; case UOMessage.Visibility: VisibilityChanged.Raise(arg1 != 0); break; case UOMessage.KeyDown: UOKeyEventArgs keyArgs = new UOKeyEventArgs(arg1, arg2); KeyDown.Raise(keyArgs); if (keyArgs.Filter) { return(1); } break; case UOMessage.PacketToClient: Packet toClient = new Packet(data, arg1); PacketToClient.Raise(toClient); if (toClient.Filter) { return(1); } if (toClient.Changed) { return(2); } break; case UOMessage.PacketToServer: Packet toServer = new Packet(data, arg1); PacketToServer.Raise(toServer); if (toServer.Filter) { return(1); } if (toServer.Changed) { return(2); } break; } } catch (Exception ex) { OnException(ex); } return(0); }
protected void RaiseVisibilityChanged(EventArgs e) { VisibilityChanged?.Invoke(this, e); }