public void ShowVerticalGuideline(int zIndex) { int numRows = MaximumVolumeInTrace; Brush brush = TwBrushes.BrushFromColor(Properties.Settings.Default.GraphVerticalGuidelineColor); double width = EventsViewer.ScrollViewer.HorizontalOffset + EventsViewer.ViewportWidth / 2; double height = MaximumVolumeInTrace * HeightMultiplier; RectangleGeometry rect = new RectangleGeometry(new Rect(width, 0, 0, height)); rect.SetValue(RenderOptions.EdgeModeProperty, EdgeMode.Aliased); rect.Freeze(); pathVerticalGuideline = new Path(); pathVerticalGuideline.Stroke = brush; pathVerticalGuideline.StrokeThickness = 1; pathVerticalGuideline.SnapsToDevicePixels = false; pathVerticalGuideline.Data = rect; Canvas.SetZIndex(pathVerticalGuideline, zIndex); this.Children.Add(pathVerticalGuideline); }
void ShowRows(bool showTwentyFiveVolumeRows, bool showFiveVolumeRows, bool showOneVolumeRows) { int numRows = MaximumVolumeInTrace; Brush brush = TwBrushes.BrushFromColor(Properties.Settings.Default.GraphHorizontalGuidelineColor); for (int i = 1; i < numRows; i++) { if (showTwentyFiveVolumeRows && i % 25 == 0) { pathHorizontalGuidelines.Add(RenderRow(i, brush, 3.0, -1)); } else if (showFiveVolumeRows && i % 5 == 0) { pathHorizontalGuidelines.Add(RenderRow(i, brush, 2.0, -1)); } else if (showOneVolumeRows) { pathHorizontalGuidelines.Add(RenderRow(i, brush, 1.0, -1)); } } }
public void Initialize() { this.Background = TwBrushes.BrushFromColor(Properties.Settings.Default.GraphRulerColor); }