コード例 #1
0
        private void RecentMenuItemViewModel_RecentChanged(object sender, RecentEventArgs e)
        {
            ICommandManager commands = _containerWeak.Get().Resolve<ICommandManager>();
            switch (e.Action)
            {
                case RecentAction.Added:
                    ICommand openRecentCmd = commands.GetCommand("OPENRECENT");
                    var newVM = new MenuItemViewModel(e.Item, Children.Count + 1, null, openRecentCmd);
                    newVM.CommandParameter = newVM.Header;
                    Add(newVM);
                    break;
                case RecentAction.Removed:
                    Remove(e.Item);
                    break;

                case RecentAction.None:
                default:
                    break;
            }
            commands = null;
        }
コード例 #2
0
        private void RecentMenuItemViewModel_RecentChanged(object sender, RecentEventArgs e)
        {
            ICommandManager commands = _containerWeak.Get().Resolve <ICommandManager>();

            switch (e.Action)
            {
            case RecentAction.Added:
                ICommand openRecentCmd = commands.GetCommand("OPENRECENT");
                var      newVM         = new MenuItemViewModel(e.Item, Children.Count + 1, null, openRecentCmd);
                newVM.CommandParameter = newVM.Header;
                Add(newVM);
                break;

            case RecentAction.Removed:
                Remove(e.Item);
                break;

            case RecentAction.None:
            default:
                break;
            }
            commands = null;
        }