红线是桌面,窗口位置左侧偏移7px,顶部偏移7px。如何将窗口向右移动7px并向下移动7px?
我在XAML中设置窗口的最大宽度和高度:
MaxWidth = "{Binding Source={x:Static SystemParameters.WorkArea}, Path=Width}"
MaxHeight = "{Binding Source={x:Static SystemParameters.WorkArea}, Path=Height}"
编辑:
private void BTN_Maximize_MouseUp(object sender, MouseButtonEventArgs e)
{
if (IsMaximized)
{
WindowState = WindowState.Normal;
}
else
{
WindowState = WindowState.Maximized;
}
}
bool IsMaximized
{
get
{
if (WindowState == WindowState.Maximized)
return true;
else
return false;
}
}