Line | |
---|
1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Linq;
|
---|
4 | using System.Text;
|
---|
5 | using System.Windows.Data;
|
---|
6 | using System.Windows;
|
---|
7 |
|
---|
8 | namespace 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.