■ 전체 화면 설정하기

------------------------------------------------------------------------------------------------------------------------

using System.Windows;

using System.Windows.Media;

 

#region 전체 화면 설정하기 - SetFullScreen(window)

 

/// <summary>

/// 전체 화면 설정하기

/// </summary>

/// <param name="window">윈도우</param>

/// <returns>처리 결과</returns>

public bool SetFullScreen(Window window)

{

    if(window == null)

    {

        return false;

    }

 

    ScaleTransform scaleTransform = new ScaleTransform();

 

    scaleTransform.ScaleX = SystemParameters.PrimaryScreenWidth  / window.Width;

    scaleTransform.ScaleY = SystemParameters.PrimaryScreenHeight / window.Height;

 

    FrameworkElement frameworkElement = window.Content as FrameworkElement;

 

    if(frameworkElement != null)

    {

        frameworkElement.LayoutTransform = scaleTransform;    

    }

 

    window.WindowState = WindowState.Maximized;

    window.WindowStyle = WindowStyle.None;

    window.ResizeMode  = ResizeMode.NoResize;

 

    return true;

}

 

#endregion

------------------------------------------------------------------------------------------------------------------------

Posted by 사용자 icodebroker
TAG

댓글을 달아 주세요