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/ItemListView.cs

    r10089 r10093  
    245245        var item = (T)itemsListView.SelectedItems[0].Tag;
    246246        var mainForm = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>();
    247         var outermostViewHost = mainForm.GetOutermostViewOfType<ViewHost>(this);
    248         if (outermostViewHost != null && outermostViewHost.HotlinkingEnabled) {
    249           var oldCrumbs = outermostViewHost.Breadcrumbs;
    250           var newCrumbs = BuildBreadcrumbTrail();
    251           mainForm.ShowContentInSpecificViewHost(item, outermostViewHost);
    252           outermostViewHost.UpdateBreadcrumbTrail(oldCrumbs, newCrumbs.Concat(new[] { item }));
     247        var outermostViewHost = mainForm.ShowContentInOutermostViewHost(item, this, true);
     248        if (outermostViewHost.HotlinkingEnabled) {
    253249          outermostViewHost.ActiveView.ReadOnly = ReadOnly;
    254250          outermostViewHost.ActiveView.Locked = Locked;
     
    278274        var item = (T)itemsListView.SelectedItems[0].Tag;
    279275        var mainForm = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>();
    280         var outermostViewHost = mainForm.GetOutermostViewOfType<ViewHost>(this);
    281         var oldCrumbs = outermostViewHost.Breadcrumbs;
    282         var newCrumbs = BuildBreadcrumbTrail();
    283         mainForm.ShowContentInSpecificViewHost(item, outermostViewHost);
    284         outermostViewHost.UpdateBreadcrumbTrail(oldCrumbs, newCrumbs.Concat(new[] { item }));
     276        var outermostViewHost = mainForm.ShowContentInOutermostViewHost(item, this);
    285277        outermostViewHost.ActiveView.ReadOnly = ReadOnly;
    286278        outermostViewHost.ActiveView.Locked = Locked;
     
    516508      }
    517509    }
    518     protected virtual IEnumerable<IContent> BuildBreadcrumbTrail() {
    519       var l = new LinkedList<IContent>();
    520       for (var control = (Control)this; control != null; control = control.Parent) {
    521         var vh = control as ViewHost;
    522         if (vh != null && vh.Content != null)
    523           l.AddFirst(vh.Content);
    524       }
    525       return l;
    526     }
    527510    #endregion
    528511  }
Note: See TracChangeset for help on using the changeset viewer.