private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     if (PenSettings == null)
         PenSettings = new DrawingPenSettings();
     mainPanel.DataContext = PenSettings;
 }
Ejemplo n.º 2
0
 private void graphColorSettingButton_Click(object sender, RoutedEventArgs e)
 {
     GraphColorSettingDialog gcsd = new GraphColorSettingDialog();
     DrawingPenSettings dps = new DrawingPenSettings();
     dps.AxisLineBrush = gd.AxisLineBrush;
     dps.AxisLineThickness = gd.AxisLineThickness;
     dps.GraphBrush = gd.GraphBrush;
     dps.GraphThickness = gd.GraphThickness;
     dps.GridLineBrush = gd.GridLineBrush;
     dps.GridLineThickness = gd.GridLineThickness;
     dps.SubGridLineBrush = gd.SubGridLineBrush;
     dps.SubGridLineThickness = gd.SubGridLineThickness;
     gcsd.PenSettings = dps;
     if (gcsd.ShowDialog() == true)
     {
         gd.AxisLineBrush = gcsd.PenSettings.AxisLineBrush;
         gd.AxisLineThickness = gcsd.PenSettings.AxisLineThickness;
         gd.GraphBrush = gcsd.PenSettings.GraphBrush;
         gd.GraphThickness = gcsd.PenSettings.GraphThickness;
         gd.GridLineBrush = gcsd.PenSettings.GridLineBrush;
         gd.GridLineThickness = gcsd.PenSettings.GridLineThickness;
         gd.SubGridLineBrush = gcsd.PenSettings.SubGridLineBrush;
         gd.SubGridLineThickness = gcsd.PenSettings.SubGridLineThickness;
         UpdateCanvas();
     }
 }