Exemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="WindowLayoutItem"/> class.
        /// </summary>
        /// <param name="layoutExtensions">The layout extensions.</param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="layoutExtensions"/> is <see langword="null"/>.
        /// </exception>
        public WindowLayoutItem(LayoutExtension layoutExtensions)
        {
            if (layoutExtensions == null)
            {
                throw new ArgumentNullException(nameof(layoutExtensions));
            }

            _layoutExtensions = layoutExtensions;
            Command           = new DelegateCommand <WindowLayout>(_layoutExtensions.SwitchLayout);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ManageLayoutsViewModel"/> class.
        /// </summary>
        /// <param name="layoutExtension">The <see cref="LayoutExtension"/>.</param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="layoutExtension"/> is <see langword="null"/>.
        /// </exception>
        public ManageLayoutsViewModel(LayoutExtension layoutExtension)
        {
            if (layoutExtension == null)
            {
                throw new ArgumentNullException(nameof(layoutExtension));
            }

            DisplayName = "Manage Layouts";

            _layoutExtension = layoutExtension;

            // Initial selection in the list box is the active window layout.
            _selectedLayout = _layoutExtension.ActiveLayout;

            RenameCommand = new DelegateCommand(Rename, CanRename);
            DeleteCommand = new DelegateCommand(Delete, CanDelete);
            CloseCommand  = new DelegateCommand(Close);
        }