Esempio n. 1
0
        public BreadcrumbViewModel(IEventAggregator events)
        {
            _events = events;

            if (events != null)
            {
                events.Subscribe(this);
            }

            Entries = new EntriesHelper <IBreadcrumbItemViewModel>();
            var selection = new TreeRootSelector <IBreadcrumbItemViewModel, IEntryModel>(Entries)
            {
                Comparers = new[] { PathComparer.LocalDefault }
            };

            selection.SelectionChanged += (o, e) =>
            {
                BroadcastDirectoryChanged(EntryViewModel.FromEntryModel(selection.SelectedValue));
            };
            Selection = selection;
            Commands  = new BreadcrumbCommandManager(this, events);
        }
 public void Handle(DirectoryChangedEvent message)
 {
     this.DisplayName           = String.Format(WindowTitleMask, message.NewModel.Label);
     _currentDirectoryViewModel = EntryViewModel.FromEntryModel(message.NewModel);
     NotifyOfPropertyChange(() => CurrentDirectory);
 }
Esempio n. 3
0
 public IEntryViewModel Clone()
 {
     return(EntryViewModel.FromEntryModel(this.EntryModel));
 }