Initial Commit
This commit is contained in:
29
Charts/Legend items/LegendItemsHelper.cs
Normal file
29
Charts/Legend items/LegendItemsHelper.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Data;
|
||||
using System.Windows;
|
||||
|
||||
namespace Microsoft.Research.DynamicDataDisplay.Charts.Legend_items
|
||||
{
|
||||
public static class LegendItemsHelper
|
||||
{
|
||||
public static NewLegendItem BuildDefaultLegendItem(IPlotterElement chart)
|
||||
{
|
||||
DependencyObject dependencyChart = (DependencyObject)chart;
|
||||
|
||||
NewLegendItem result = new NewLegendItem();
|
||||
SetCommonBindings(result, chart);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static void SetCommonBindings(NewLegendItem legendItem, object chart)
|
||||
{
|
||||
legendItem.DataContext = chart;
|
||||
legendItem.SetBinding(NewLegend.VisualContentProperty, new Binding { Path = new PropertyPath("(0)", NewLegend.VisualContentProperty) });
|
||||
legendItem.SetBinding(NewLegend.DescriptionProperty, new Binding { Path = new PropertyPath("(0)", NewLegend.DescriptionProperty) });
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user