Exemplo n.º 1
0
 public WindowBase(IWindowBaseImpl impl, IAvaloniaDependencyResolver dependencyResolver) : base(impl, dependencyResolver)
 {
     impl.Activated       = HandleActivated;
     impl.Deactivated     = HandleDeactivated;
     impl.PositionChanged = HandlePositionChanged;
     this.GetObservable(ClientSizeProperty).Skip(1).Subscribe(x => PlatformImpl?.Resize(x));
 }
Exemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Window"/> class.
 /// </summary>
 /// <param name="impl">The window implementation.</param>
 public Window(IWindowImpl impl)
     : base(impl)
 {
     impl.Closing            = HandleClosing;
     impl.WindowStateChanged = HandleWindowStateChanged;
     _maxPlatformClientSize  = PlatformImpl?.MaxClientSize ?? default(Size);
     this.GetObservable(ClientSizeProperty).Skip(1).Subscribe(x => PlatformImpl?.Resize(x));
 }
Exemplo n.º 3
0
        /// <summary>
        /// Carries out the arrange pass of the window.
        /// </summary>
        /// <param name="finalSize">The final window size.</param>
        /// <returns>The <paramref name="finalSize"/> parameter unchanged.</returns>
        protected override Size ArrangeOverride(Size finalSize)
        {
            using (BeginAutoSizing())
            {
                PlatformImpl?.Resize(finalSize);
            }

            return(base.ArrangeOverride(PlatformImpl?.ClientSize ?? default(Size)));
        }
Exemplo n.º 4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Window"/> class.
        /// </summary>
        /// <param name="impl">The window implementation.</param>
        public Window(IWindowImpl impl)
            : base(impl)
        {
            impl.Closing = HandleClosing;
            impl.GotInputWhenDisabled = OnGotInputWhenDisabled;
            impl.WindowStateChanged   = HandleWindowStateChanged;
            _maxPlatformClientSize    = PlatformImpl?.MaxClientSize ?? default(Size);
            this.GetObservable(ClientSizeProperty).Skip(1).Subscribe(x => PlatformImpl?.Resize(x));

            PlatformImpl?.ShowTaskbarIcon(ShowInTaskbar);
        }