Inheritance: Microsoft.Practices.Prism.ViewModel.NotificationObject
コード例 #1
0
		public EntryItemViewModel(Entry entry, TreeViewItemViewModel parent, ManifestEditorViewModel editor, Descriptor descriptor)
			: base(parent)
		{
			if (entry == null)
				throw new ArgumentNullException("entry", "entry is null.");
			if (parent == null)
				throw new ArgumentNullException("parent", "parent is null.");
			if (editor == null)
				throw new ArgumentNullException("editor", "editor is null.");
			if (descriptor == null)
				throw new ArgumentNullException("descriptor", "descriptor is null.");


			_descriptor = descriptor;
			Entry = entry;
			_editor = editor;
			_entryEditor = new EntryEditorViewModel(entry, editor);
		    TreeItemLabel = entry.Name;
		    _entryEditor.PropertyChanged += (_, args) => { if (args.PropertyName == "Name") TreeItemLabel = entry.Name; };
			_collection = parent as IEntryItemCollection;
			if (_collection != null)
			{
				MenuItems = new List<MenuItemViewModel> { new MenuItemViewModel("Remove CI", new DelegateCommand(DoRemove), null) };
			}
			IsExpanded = true;
		}
コード例 #2
0
		protected TreeViewItemViewModel(TreeViewItemViewModel parent)
		{
			_parent = parent;

			_lazyLoadChildren = true;
			_childrenInitialized = false;
			_childrenLoaded = false;
		}
コード例 #3
0
        public EntryItemViewModel(Entry entry, TreeViewItemViewModel parent, ManifestEditorViewModel editor, Descriptor descriptor)
            : base(parent)
        {
            if (entry == null)
            {
                throw new ArgumentNullException("entry", "entry is null.");
            }
            if (parent == null)
            {
                throw new ArgumentNullException("parent", "parent is null.");
            }
            if (editor == null)
            {
                throw new ArgumentNullException("editor", "editor is null.");
            }
            if (descriptor == null)
            {
                throw new ArgumentNullException("descriptor", "descriptor is null.");
            }


            _descriptor   = descriptor;
            Entry         = entry;
            _editor       = editor;
            _entryEditor  = new EntryEditorViewModel(entry, editor);
            TreeItemLabel = entry.Name;
            _entryEditor.PropertyChanged += (_, args) => { if (args.PropertyName == "Name")
                                                           {
                                                               TreeItemLabel = entry.Name;
                                                           }
            };
            _collection = parent as IEntryItemCollection;
            if (_collection != null)
            {
                MenuItems = new List <MenuItemViewModel> {
                    new MenuItemViewModel("Remove CI", new DelegateCommand(DoRemove), null)
                };
            }
            IsExpanded = true;
        }
コード例 #4
0
		private void TreeViewEx_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs<object> e)
		{
		    SelectedTreeViewItem = e.NewValue as TreeViewItemViewModel;
		}
コード例 #5
0
		protected virtual void OnSelectedTreeViewItemChanged(TreeViewItemViewModel oldValue, TreeViewItemViewModel newValue)
		{

		}