Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Problems.GrammaticalOptimization/DynamicDataDisplay/Charts/Legend items/LegendItemsHelper.cs @ 12503

Last change on this file since 12503 was 12503, checked in by aballeit, 9 years ago

#2283 added GUI and charts; fixed MCTS

File size: 911 bytes
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using System.Windows.Data;
6using System.Windows;
7
8namespace Microsoft.Research.DynamicDataDisplay.Charts.Legend_items
9{
10  public static class LegendItemsHelper
11  {
12    public static LegendItem BuildDefaultLegendItem(IPlotterElement chart)
13    {
14      DependencyObject dependencyChart = (DependencyObject)chart;
15
16      LegendItem result = new LegendItem();
17      SetCommonBindings(result, chart);
18      return result;
19    }
20
21    public static void SetCommonBindings(LegendItem legendItem, object chart)
22    {
23      legendItem.DataContext = chart;
24      legendItem.SetBinding(Legend.VisualContentProperty, new Binding { Path = new PropertyPath("(0)", Legend.VisualContentProperty) });
25      legendItem.SetBinding(Legend.DescriptionProperty, new Binding { Path = new PropertyPath("(0)", Legend.DescriptionProperty) });
26    }
27
28  }
29}
Note: See TracBrowser for help on using the repository browser.