Esempio n. 1
0
 internal void Load()
 {
     appResizeSubscription = Application.LayoutRoot.SubscribeUnmanaged(nameof(ConsoleControl.Bounds), HandleResize);
     Application.FocusManager.GlobalKeyHandlers.PushForLifetime(ConsoleKey.Escape, null, EscapeKeyHandler, this.LifetimeManager);
     Application.FocusManager.GlobalKeyHandlers.PushForLifetime(ConsoleKey.Backspace, null, BackspaceHandler, this.LifetimeManager);
     OnLoad();
     if (Loaded != null) Loaded();
 }
 private void OnAddedToVisualTree()
 {
     focusSubscription = Application.FocusManager.SubscribeUnmanaged(nameof(FocusManager.FocusedControl), FocusChanged);
     SynchronizeForLifetime(nameof(HorizontalScrollUnits), UpdateScrollbars, this.LifetimeManager);
     SynchronizeForLifetime(nameof(VerticalScrollUnits), UpdateScrollbars, this.LifetimeManager);
     ScrollableContent.Controls.SynchronizeForLifetime(ScrollableControls_Added, (c)=> { }, () => { }, this.LifetimeManager);
 }