private void AdjustCircle(object sender, SizeChangedEventArgs e) { TicTacToeField control = sender as TicTacToeField; double width = e.NewSize.Width; double height = e.NewSize.Height; double squareSize = Math.Min(width, height); control.Width = squareSize; control.Height = squareSize; control.Shapes.TryGetValue(TicTacToe.Sign.O, out Shape Circle); Circle.Width = squareSize - 6 < 0 ? squareSize : squareSize - 6; Circle.Height = Circle.Width; Circle.StrokeThickness = 0.15 * squareSize; }
private static void OnColumnChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { TicTacToeField control = d as TicTacToeField; control.OnColumnChanged(e); }