private static void OnActiveRallyPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            //Debug.WriteLine("SmallTableView: new active rally! was: {0}, is: {1}", e.OldValue == null ? "[none]" : ((Rally)e.OldValue).Number.ToString(), ((Rally)e.NewValue).Number);

            SmallTableView smallTableView = (SmallTableView)sender;

            if (smallTableView.thisRally.Number == smallTableView.ActiveRally.Number)
            {
                ((Grid)smallTableView.Parent).Background = (Brush)matchPlayerToBrushConverter.Convert(smallTableView.thisRally.Winner, typeof(Brush), 2, System.Globalization.CultureInfo.CurrentCulture);
            }
            else
            {
                ((Grid)smallTableView.Parent).Background = Brushes.Transparent;
            }
        }
        private static void OnDisplayTypePropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            SmallTableView view = (SmallTableView)sender;

            if (e.Property == ShowNumbersProperty)
            {
                if ((bool)e.NewValue)
                {
                    foreach (Stroke s in view.StrokeShapes.Keys)
                    {
                        view.AddStrokeNumbers(s);
                    }
                }
                else
                {
                    view.HideElementsByTag(ElementType.StrokeNumber);
                }
            }
            else if (e.Property == ShowStroke1Property)
            {
                if ((bool)e.NewValue)
                {
                    view.thisRally.Strokes.Apply(s => { if (s.Number == 1 && view.ShowStroke1)
                                                        {
                                                            view.AddStroke(s);
                                                        }
                                                 });
                }
                else
                {
                    view.HideStrokeByNumber(1);
                }
            }
            else if (e.Property == ShowStroke2Property)
            {
                if ((bool)e.NewValue)
                {
                    view.thisRally.Strokes.Apply(s => { if (s.Number == 2 && view.ShowStroke2)
                                                        {
                                                            view.AddStroke(s);
                                                        }
                                                 });
                }
                else
                {
                    view.HideStrokeByNumber(2);
                }
            }
            else if (e.Property == ShowStroke3Property)
            {
                if ((bool)e.NewValue)
                {
                    view.thisRally.Strokes.Apply(s => { if (s.Number == 3 && view.ShowStroke3)
                                                        {
                                                            view.AddStroke(s);
                                                        }
                                                 });
                }
                else
                {
                    view.HideStrokeByNumber(3);
                }
            }
            else if (e.Property == ShowStroke4Property)
            {
                if ((bool)e.NewValue)
                {
                    view.thisRally.Strokes.Apply(s => { if (s.Number == 4 && view.ShowStroke4)
                                                        {
                                                            view.AddStroke(s);
                                                        }
                                                 });
                }
                else
                {
                    view.HideStrokeByNumber(4);
                }
            }
        }