コード例 #1
0
ファイル: NavigationViewModel.cs プロジェクト: girish66/REM
        /// <summary>
        /// Initializes a new instance of the <see cref="NavigationViewModel"/> class.
        /// </summary>
        /// <param name="accessControlManager">The access control manager.</param>
        /// <param name="commandFactory">The command factory.</param>
        protected NavigationViewModel(
            IAccessControlManager accessControlManager,
            ICommandFactory commandFactory)
        {
            _accessControlManager = accessControlManager;

            var commandFactoryHelper = CreateCommandFactoryHelper(commandFactory);

            CloseViewCommand = commandFactoryHelper.BuildDelegateCommand(() => CloseViewCommand, ExecuteCloseViewCommand);

            _commandsList = new Dictionary <string, INavigationCommand> ();

            NavigationCommandManager = new NavigationCommandManager(_commandsList);

            DefaultCommand = NavigationCommandManager.BuildCommand(() => DefaultCommand, NavigateToDefaultCommand, CanNavigateToDefaultCommand);
        }
コード例 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NavigationViewModel"/> class.
        /// </summary>
        /// <param name="accessControlManager">The access control manager.</param>
        /// <param name="commandFactory">The command factory.</param>
        protected NavigationViewModel (
            IAccessControlManager accessControlManager,
            ICommandFactory commandFactory )
        {
            _accessControlManager = accessControlManager;

            var commandFactoryHelper = CreateCommandFactoryHelper ( commandFactory );

            CloseViewCommand = commandFactoryHelper.BuildDelegateCommand ( () => CloseViewCommand, ExecuteCloseViewCommand );

            _commandsList = new Dictionary<string, INavigationCommand> ();

            NavigationCommandManager = new NavigationCommandManager ( _commandsList );

            DefaultCommand = NavigationCommandManager.BuildCommand ( () => DefaultCommand, NavigateToDefaultCommand, CanNavigateToDefaultCommand );
        }