private void UpdateHeightOrWidth() { if (IsHorizontal) { Height = Thickness; Width = double.NaN; } else { Width = Thickness; Height = double.NaN; } }