private Thickness calculateThickness(SudokuPresenter host) { var sudoku = host.Sudoku; if (host.Sudoku == null) { return(new Thickness()); } return(new Thickness(host.ElementBorderWidth)); }
public BorderThicknessUpdator(SudokuPresenter host) { if (host == null) { throw new ArgumentNullException("host"); } this.host = host; DependencyPropertyDescriptor.FromProperty( SudokuPresenter.SudokuBorderWidthProperty, typeof(SudokuPresenter)) .AddValueChanged(host, UpdateNeeded); DependencyPropertyDescriptor.FromProperty( SudokuPresenter.SudokuProperty, typeof(SudokuPresenter)) .AddValueChanged(host, UpdateNeeded); }
private void updateElementBorderThickness(SudokuPresenter host) { host.SetSudokuBorderThickness(calculateThickness(host)); }