public void Disable() { BlockNavigator.SetIsDisabled(this, false); WpfGamePad.RemoveThumbLeftChangeHandler(this, OnLeftThumbChanged); WpfGamePad.RemoveButtonADownHandler(this, OnButtonA); WpfGamePad.RemoveButtonBDownHandler(this, OnButtonB); WpfGamePad.SetIsFocused(this, false); WpfGamePad.SetRegistered(this, false); CenterHighlight.Visibility = Visibility.Collapsed; }
public void Enable() { BlockNavigator.SetIsDisabled(this, true); WpfGamePad.AddThumbLeftChangeHandler(this, OnLeftThumbChanged); WpfGamePad.AddButtonADownHandler(this, OnButtonA); WpfGamePad.AddButtonBDownHandler(this, OnButtonB); WpfGamePad.SetRegistered(this, true); WpfGamePad.SetIsFocused(this, true); CenterHighlight.Visibility = Visibility.Visible; HighlightKnob.Visibility = Visibility.Collapsed; _activeButtonIndex = -1; Canvas.SetLeft(CenterHighlight, _centerHighlightCanvasSize.X / 2 - CenterHighlight.Width / 2); Canvas.SetTop(CenterHighlight, _centerHighlightCanvasSize.Y / 2 - CenterHighlight.Height / 2); }