Beispiel #1
0
        private static void LineColorChangedCallBack(DependencyObject obj,
                                                     DependencyPropertyChangedEventArgs ea)
        {
            ParameterDisplaySettingsControl cbControl =
                obj as ParameterDisplaySettingsControl;

            if (cbControl != null)
            {
                cbControl.OnPropertyChanged("LineColor");
                cbControl.OnLineColorPropertyChanged(ea);
            }
        }
Beispiel #2
0
        private static void IsCheckedChangedCallBack(DependencyObject obj,
                                                     DependencyPropertyChangedEventArgs ea)
        {
            ParameterDisplaySettingsControl cbControl =
                obj as ParameterDisplaySettingsControl;

            if (cbControl != null)
            {
                cbControl.OnPropertyChanged("IsChecked");
                cbControl.OnIsCheckedPropertyChanged(ea);
            }
        }
 private void InitializeCheckBoxes(IPsaParametersSetViewModel vm)
 {
     checkboxesStackPanel.Children.Clear();
     DataContext = vm;
     foreach (PsaParameterDataViewModel paramDataViewModel in vm.Parameters)
     {
         ParameterDisplaySettingsViewModel cbViewModel =
             new ParameterDisplaySettingsViewModel(paramDataViewModel);
         cbViewModel.GraphControl = graph;
         cbViewModel.Text         = paramDataViewModel.Type;
         ParameterDisplaySettingsControl cbControl =
             new ParameterDisplaySettingsControl();
         cbControl.DataContext         = cbViewModel;
         cbControl.Text                = cbViewModel.Text;
         cbControl.LineColor           = cbViewModel.StrokeColor;
         cbControl.IsChecked           = false;
         cbControl.Checked            += SomeCheckBoxChecked;
         cbControl.Unchecked          += SomeCheckBoxUnChecked;
         cbViewModel.ColorChanged     += SomeCheckBoxColorChanged;
         cbControl.HorizontalAlignment = HorizontalAlignment.Left;
         checkboxesStackPanel.Children.Add(cbControl);
     }
 }