Пример #1
0
        /// <inheritdoc />
        protected override void OnStateChanged(EventArgs e)
        {
            base.OnStateChanged(e);

            // todo: remove fix if we update to ControlzEx 4.0
            if (WindowState == WindowState.Maximized &&
                SizeToContent != SizeToContent.Manual)
            {
                SizeToContent = SizeToContent.Manual;
            }

            this.RunInDispatcherAsync(() => TitleBar?.ForceMeasureAndArrange(), DispatcherPriority.Background);
        }
Пример #2
0
        private void OnLoaded(object sender, RoutedEventArgs e)
        {
            if (SizeToContent == SizeToContent.Manual)
            {
                return;
            }

            this.RunInDispatcherAsync(() =>
            {
                // Fix for #454 while also keeping #473
                var availableSize = new Size(TitleBar.ActualWidth, TitleBar.ActualHeight);
                TitleBar.Measure(availableSize);
                TitleBar.ForceMeasureAndArrange();
            }, DispatcherPriority.ApplicationIdle);
        }