Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/29/13 13:47:35 (11 years ago)
Author:
jkarder
Message:

#2116:

  • refactored breadcrumb navigation
  • added possibility to navigate to the first invisible breadcrumb via the ellipsis
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/Breadcrumbs/HeuristicLab.Core.Views/3.3/ItemCollectionView.cs

    r10089 r10093  
    224224        var item = (T)itemsListView.SelectedItems[0].Tag;
    225225        var mainForm = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>();
    226         var outermostViewHost = mainForm.GetOutermostViewOfType<ViewHost>(this);
    227         if (outermostViewHost != null && outermostViewHost.HotlinkingEnabled) {
    228           var oldCrumbs = outermostViewHost.Breadcrumbs;
    229           var newCrumbs = BuildBreadcrumbTrail();
    230           mainForm.ShowContentInSpecificViewHost(item, outermostViewHost);
    231           outermostViewHost.UpdateBreadcrumbTrail(oldCrumbs, newCrumbs.Concat(new[] { item }));
    232         } else {
     226        var outermostViewHost = mainForm.ShowContentInOutermostViewHost(item, this, true);
     227        if (!outermostViewHost.HotlinkingEnabled) {
    233228          if (showDetailsCheckBox.Checked) {
    234229            detailsGroupBox.Enabled = true;
     
    256251        var item = (T)itemsListView.SelectedItems[0].Tag;
    257252        var mainForm = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>();
    258         var outermostViewHost = mainForm.GetOutermostViewOfType<ViewHost>(this);
    259         var oldCrumbs = outermostViewHost.Breadcrumbs;
    260         var newCrumbs = BuildBreadcrumbTrail();
    261         mainForm.ShowContentInSpecificViewHost(item, outermostViewHost);
    262         outermostViewHost.UpdateBreadcrumbTrail(oldCrumbs, newCrumbs.Concat(new[] { item }));
     253        var outermostViewHost = mainForm.ShowContentInOutermostViewHost(item, this);
    263254        outermostViewHost.ActiveView.ReadOnly = ReadOnly;
    264255        outermostViewHost.ActiveView.Locked = Locked;
     
    449440      }
    450441    }
    451     protected virtual IEnumerable<IContent> BuildBreadcrumbTrail() {
    452       var l = new LinkedList<IContent>();
    453       for (var control = (Control)this; control != null; control = control.Parent) {
    454         var vh = control as ViewHost;
    455         if (vh != null && vh.Content != null)
    456           l.AddFirst(vh.Content);
    457       }
    458       return l;
    459     }
    460442    #endregion
    461443  }
Note: See TracChangeset for help on using the changeset viewer.