Exemplo n.º 1
0
            internal void SetOwner(ICoreWindow wnd)
            {
                _owner = wnd;

                _owner.Window.Opened += (s, e) =>
                {
                    //_owner.Resized(new Size(_owner.Window.Width += 32, _owner.Window.Height += 16), PlatformResizeReason.Layout);

                    _owner.Window.GetObservable(Window.WindowStateProperty)
                    .Subscribe(x =>
                    {
                        if (x == WindowState.Normal)
                        {
                            _owner.Resized(new Size(_owner.Window.Width += 32, _owner.Window.Height += 16), PlatformResizeReason.Layout);
                        }
                    });
                };

                if (OperatingSystem2.IsWindows11AtLeast)
                {
                    ((IPseudoClasses)_owner.Classes).Set(":windows11", true);
                }
                else
                {
                    ((IPseudoClasses)_owner.Classes).Set(":windows10", true);
                }
            }
        public void SetWindow(CoreWindow window)
        {
            _window = window;

            InitializeCompositor();

            BuildVisualTree();
        }
        public void SetWindow(CoreWindow window)
        {
            _window = window;

            InitializeCompositor();

            BuildVisualTree();
        }
Exemplo n.º 4
0
        /// <summary>
        /// This invokes the actions when the event is raised.
        /// </summary>
        /// <param name="eventArgs"></param>
        protected override void OnEvent(object eventArgs)
        {
            _targetElement = Window.Current.CoreWindow;
            if (_targetElement == null)
            {
                return;
            }

            if (FiredOn == KeyTriggerFiredOn.KeyDown)
            {
                _targetElement.KeyDown += OnKeyPress;
            }
            else
            {
                _targetElement.KeyUp += OnKeyPress;
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// This method hooks into the keyboard events for the window.
        /// </summary>
        private bool HookEvents()
        {
            this._targetElement = Window.Current.CoreWindow;
            if (this._targetElement == null)
            {
                return(false);
            }

            if (this.FiredOn == KeyTriggerFiredOn.KeyDown)
            {
                this._targetElement.KeyDown += this.OnKeyPress;
            }
            else
            {
                this._targetElement.KeyUp += this.OnKeyPress;
            }

            return(true);
        }
 public void Uninitialize()
 {
     _window = null;
 }
 public void Uninitialize()
 {
     _window = null;
 }
 public ICoreWindowEvents(ICoreWindow This)
 {
     this.This = This;
 }