예제 #1
0
        private void Rebuild()
        {
            _containerCanvas.Children.Clear();

            var horizontalStep = HorizontalStep;
            var verticalStep   = VerticalStep;
            var brush          = LineBrush ?? ThemeHelper.GetThemeColorBrush(ThemeColorStyle.AccentColor4);

            for (double x = 0; x < ActualWidth; x += horizontalStep)
            {
                var line = new Rectangle {
                    Width = 1, Height = ActualHeight, Fill = brush
                };

                Canvas.SetLeft(line, x);

                _containerCanvas.Children.Add(line);
            }

            for (double y = 0; y < ActualHeight; y += verticalStep)
            {
                var line = new Rectangle {
                    Width = ActualWidth, Height = 1, Fill = brush
                };

                Canvas.SetTop(line, y);

                _containerCanvas.Children.Add(line);
            }
        }
예제 #2
0
 protected override object ProvideDynamicValue(IServiceProvider serviceProvider)
 {
     return(ThemeHelper.GetThemeColorBrush(ThemeColorStyle));
 }