コード例 #1
0
ファイル: ExtendedWindow.cs プロジェクト: StevenThuriot/Nova
        /// <summary>
        ///     Initializes a new instance of the <see cref="ExtendedWindow&lt;TView, TViewModel&gt;" /> class.
        /// </summary>
        protected ExtendedWindow()
        {
            SnapsToDevicePixels = true;

            TextOptions.SetTextRenderingMode(this, TextRenderingMode.ClearType);
            TextOptions.SetTextFormattingMode(this, TextFormattingMode.Display);
            RenderOptions.SetBitmapScalingMode(this, BitmapScalingMode.HighQuality);
            VisualTextRenderingMode = TextRenderingMode.ClearType;

            WindowStartupLocation = WindowStartupLocation.CenterScreen;

            _actionQueueManager = new ActionQueueManager();

            ViewModel = ViewModel <TView, TViewModel> .Create((TView)this, _actionQueueManager);

            Closing += (sender, args) => ViewModel.InvokeAction <LeaveAction <TView, TViewModel> >();
        }
コード例 #2
0
ファイル: ExtendedWindow.cs プロジェクト: StevenThuriot/Nova
        /// <summary>
        ///     Releases unmanaged and - optionally - managed resources
        /// </summary>
        /// <param name="disposing">
        ///     <c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.
        /// </param>
        private void Dispose(bool disposing)
        {
            if (_disposed)
            {
                return;
            }

            if (disposing)
            {
                if (ViewModel != null)
                {
                    ViewModel.Dispose();
                }

                if (_actionQueueManager != null)
                {
                    _actionQueueManager.Dispose();
                    _actionQueueManager = null;
                }
            }

            _disposed = true;
        }