public ChartClientForRangeControlModule()
 {
     InitializeComponent();
     lbGridAlignment.SelectedIndex = 0;
     chartClientModel = new ChartClientModel();
     chartClientModel.NumericItemsSource  = GenerateNumericData();
     chartClientModel.DateTimeItemsSource = GenerateDateTimeData();
     this.DataContext = chartClientModel;
 }
        static void DateTimeGridAlignmentChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ChartClientModel model = d as ChartClientModel;

            if (model != null && e.NewValue != null)
            {
                DateTimeGridAlignment gridAlignment = (DateTimeGridAlignment)(((ListBoxEditItem)(e.NewValue)).Tag);
                model.GridSpacingVisibility = gridAlignment.Equals(DateTimeGridAlignment.Auto) ? Visibility.Collapsed : Visibility.Visible;
                model.UpdateGridSpacing(gridAlignment);
            }
        }