private void LightWindow_SizeChanged(object sender, SizeChangedEventArgs e) { HeightTextBox.Value = (int)Math.Round(Height, MidpointRounding.AwayFromZero); WidthTextBox.Value = (int)Math.Round(Width, MidpointRounding.AwayFromZero); AutoFitButtons(); }