Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/15/13 16:11:27 (9 years ago)
Author:
jkarder
Message:

#2116: added prototype of a breadcrumb navigation

File:
1 edited

Legend:

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

    r9456 r10042  
    2727using HeuristicLab.Collections;
    2828using HeuristicLab.MainForm;
     29using HeuristicLab.MainForm.WindowsForms;
    2930
    3031namespace HeuristicLab.Core.Views {
     
    152153    protected override void itemsListView_DoubleClick(object sender, EventArgs e) {
    153154      if (itemsListView.SelectedItems.Count == 1) {
    154         IParameter item = itemsListView.SelectedItems[0].Tag as IParameter;
     155        var item = itemsListView.SelectedItems[0].Tag as IParameter;
    155156        if (item != null) {
    156           IContentView view = MainFormManager.MainForm.ShowContent(item);
    157           if (view != null) {
    158             view.ReadOnly = ReadOnly || (item.Hidden && !AllowEditingOfHiddenParameters);
    159             view.Locked = Locked;
     157          ViewHost outmostViewHost = null;
     158          for (var control = Parent; control != null; control = control.Parent) {
     159            var vh = control as ViewHost;
     160            if (vh != null) outmostViewHost = vh;
     161          }
     162          if (outmostViewHost != null) {
     163            var oldCrumbs = outmostViewHost.Breadcrumbs;
     164            var newCrumbs = BuildBreadcrumbTrail();
     165            outmostViewHost.Content = null;
     166            var viewType = MainFormManager.GetDefaultViewType(item.GetType());
     167            outmostViewHost.ViewType = viewType;
     168            outmostViewHost.Content = item;
     169            outmostViewHost.UpdateBreadcrumbTrail(oldCrumbs, newCrumbs.Concat(new[] { item }));
     170            outmostViewHost.ActiveView.ReadOnly = ReadOnly;
     171            outmostViewHost.ActiveView.Locked = Locked;
    160172          }
    161173        }
Note: See TracChangeset for help on using the changeset viewer.