C# Class FirstFloor.ModernUI.Windows.Controls.DpiAwareWindow

A window instance that is capable of per-monitor DPI awareness when supported.
Inheritance: System.Windows.Window
ファイルを表示 Open project: gro-ove/actools Class Usage Examples

Public Properties

Property Type Description
ActualBottomProperty System.Windows.DependencyProperty
ActualBottomPropertyKey System.Windows.DependencyPropertyKey
ActualLeftProperty System.Windows.DependencyProperty
ActualLeftPropertyKey System.Windows.DependencyPropertyKey
ActualRightProperty System.Windows.DependencyProperty
ActualRightPropertyKey System.Windows.DependencyPropertyKey
ActualTopProperty System.Windows.DependencyProperty
ActualTopPropertyKey System.Windows.DependencyPropertyKey
IsDimmedProperty System.Windows.DependencyProperty
LocationAndSizeKeyProperty System.Windows.DependencyProperty

Public Methods

Method Description
BringToFront ( ) : void
Close ( ) : void
OnFatalError ( Exception e ) : void
SetLocationAndSizeKeyAndSave ( string key ) : void
ShowAndWaitAsync ( ) : System.Threading.Tasks.Task
ShowDialog ( ) : bool?
ShowDialogAsync ( ) : Task
ShowDialogWithoutBlocking ( ) : void

Protected Methods

Method Description
DpiAwareWindow ( ) : System

Initializes a new instance of the DpiAwareWindow class.

OnClosed ( EventArgs e ) : void

Raises the System.Windows.Window.Closed event.

OnDpiChanged ( EventArgs e ) : void

Raises the E:DpiChanged event.

OnInitialized ( EventArgs e ) : void
OnLocationChanged ( EventArgs e ) : void
OnLocationChanged ( object sender, EventArgs e ) : void
OnSizeChanged ( object sender, System.Windows.SizeChangedEventArgs e ) : void
OnStateChanged ( object sender, EventArgs e ) : void
RefreshMonitorDpi ( ) : void

Refreshes the current monitor DPI settings and update the window size and layout scale accordingly.

Private Methods

Method Description
DimOwner ( ) : void
GetWindowLong ( IntPtr hWnd, int nIndex ) : int
GetWindowRect ( IntPtr hWnd, Win32Rect &lpWindowRect ) : bool
GetWindowRectangle ( ) : Win32Rect
IsFinite ( double value ) : bool
LoadLocationAndSize ( ) : void
OnLocationAndSizeKeyChanged ( ) : void
OnLocationAndSizeKeyChanged ( DependencyObject o, System.Windows.DependencyPropertyChangedEventArgs e ) : void
OnSourceInitialized ( object sender, EventArgs e ) : void
OnSystemEventsDisplaySettingsChanged ( object sender, EventArgs e ) : void
RescaleIfNeeded ( ) : void
SaveLocationAndSize ( ) : void
SetWindowLong ( IntPtr hWnd, int nIndex, int dwNewLong ) : int
UndimOwner ( ) : void
UpdateActualLocation ( ) : void
UpdateLayoutTransform ( ) : void
UpdateWindowSize ( double width, double height ) : void
WndProc ( IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, bool &handled ) : IntPtr

Method Details

BringToFront() public method

public BringToFront ( ) : void
return void

Close() public method

public Close ( ) : void
return void

DpiAwareWindow() protected method

Initializes a new instance of the DpiAwareWindow class.
protected DpiAwareWindow ( ) : System
return System

OnClosed() protected method

Raises the System.Windows.Window.Closed event.
protected OnClosed ( EventArgs e ) : void
e System.EventArgs
return void

OnDpiChanged() protected method

Raises the E:DpiChanged event.
protected OnDpiChanged ( EventArgs e ) : void
e System.EventArgs The instance containing the event data.
return void

OnFatalError() public static method

public static OnFatalError ( Exception e ) : void
e System.Exception
return void

OnInitialized() protected method

protected OnInitialized ( EventArgs e ) : void
e System.EventArgs
return void

OnLocationChanged() protected method

protected OnLocationChanged ( EventArgs e ) : void
e System.EventArgs
return void

OnLocationChanged() protected method

protected OnLocationChanged ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void

OnSizeChanged() protected method

protected OnSizeChanged ( object sender, System.Windows.SizeChangedEventArgs e ) : void
sender object
e System.Windows.SizeChangedEventArgs
return void

OnStateChanged() protected method

protected OnStateChanged ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void

RefreshMonitorDpi() protected method

Refreshes the current monitor DPI settings and update the window size and layout scale accordingly.
protected RefreshMonitorDpi ( ) : void
return void

SetLocationAndSizeKeyAndSave() public method

public SetLocationAndSizeKeyAndSave ( string key ) : void
key string
return void

ShowAndWaitAsync() public method

public ShowAndWaitAsync ( ) : System.Threading.Tasks.Task
return System.Threading.Tasks.Task

ShowDialog() public method

public ShowDialog ( ) : bool?
return bool?

ShowDialogAsync() public method

public ShowDialogAsync ( ) : Task
return Task

ShowDialogWithoutBlocking() public method

public ShowDialogWithoutBlocking ( ) : void
return void

Property Details

ActualBottomProperty public_oe static_oe property

public static DependencyProperty,System.Windows ActualBottomProperty
return System.Windows.DependencyProperty

ActualBottomPropertyKey public_oe static_oe property

public static DependencyPropertyKey,System.Windows ActualBottomPropertyKey
return System.Windows.DependencyPropertyKey

ActualLeftProperty public_oe static_oe property

public static DependencyProperty,System.Windows ActualLeftProperty
return System.Windows.DependencyProperty

ActualLeftPropertyKey public_oe static_oe property

public static DependencyPropertyKey,System.Windows ActualLeftPropertyKey
return System.Windows.DependencyPropertyKey

ActualRightProperty public_oe static_oe property

public static DependencyProperty,System.Windows ActualRightProperty
return System.Windows.DependencyProperty

ActualRightPropertyKey public_oe static_oe property

public static DependencyPropertyKey,System.Windows ActualRightPropertyKey
return System.Windows.DependencyPropertyKey

ActualTopProperty public_oe static_oe property

public static DependencyProperty,System.Windows ActualTopProperty
return System.Windows.DependencyProperty

ActualTopPropertyKey public_oe static_oe property

public static DependencyPropertyKey,System.Windows ActualTopPropertyKey
return System.Windows.DependencyPropertyKey

IsDimmedProperty public_oe static_oe property

public static DependencyProperty,System.Windows IsDimmedProperty
return System.Windows.DependencyProperty

LocationAndSizeKeyProperty public_oe static_oe property

public static DependencyProperty,System.Windows LocationAndSizeKeyProperty
return System.Windows.DependencyProperty