C# Класс ModernWPF.DpiEvents

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
DpiChangeEvent System.Windows.RoutedEvent

Открытые методы

Метод Описание
AddDpiChangeHandler ( DependencyObject element, EventHandler handler ) : void

Adds a handler to the DpiChange event.

GetWindowDpi ( DependencyObject obj ) : int

Gets the dpi value for the object contained in a window using Chrome.

GetWindowDpiScale ( DependencyObject obj ) : double

Gets the dpi scale value for the object contained in a window using Chrome.

RemoveDpiChangeHandler ( DependencyObject element, EventHandler handler ) : void

Removes a handler to the DpiChange event.

ScaleElement ( FrameworkElement child, double scaleFactor, bool compensateRender = false ) : void

Scales the element based on some factor.

Приватные методы

Метод Описание
GetIsDpiTransform ( DependencyObject obj ) : bool
SetIsDpiTransform ( DependencyObject obj, bool value ) : void
SetWindowDpi ( DependencyObject obj, int dpi ) : void
SetWindowDpiScale ( DependencyObject obj, double dpiScale ) : void
UnwrapDpiTransform ( Transform currentTransform ) : Transform
WrapDpiTransform ( Transform origTransform, double dpiScaleFactor ) : Transform

Описание методов

AddDpiChangeHandler() публичный статический Метод

Adds a handler to the DpiChange event.
public static AddDpiChangeHandler ( DependencyObject element, EventHandler handler ) : void
element System.Windows.DependencyObject The element.
handler EventHandler The handler.
Результат void

GetWindowDpi() публичный статический Метод

Gets the dpi value for the object contained in a window using Chrome.
public static GetWindowDpi ( DependencyObject obj ) : int
obj System.Windows.DependencyObject The object.
Результат int

GetWindowDpiScale() публичный статический Метод

Gets the dpi scale value for the object contained in a window using Chrome.
public static GetWindowDpiScale ( DependencyObject obj ) : double
obj System.Windows.DependencyObject The object.
Результат double

RemoveDpiChangeHandler() публичный статический Метод

Removes a handler to the DpiChange event.
public static RemoveDpiChangeHandler ( DependencyObject element, EventHandler handler ) : void
element System.Windows.DependencyObject The element.
handler EventHandler The handler.
Результат void

ScaleElement() публичный статический Метод

Scales the element based on some factor.
public static ScaleElement ( FrameworkElement child, double scaleFactor, bool compensateRender = false ) : void
child System.Windows.FrameworkElement The child.
scaleFactor double The scale factor.
compensateRender bool if set to true to compensate RTL bug with render transform.
Результат void

Описание свойств

DpiChangeEvent публичное статическое свойство

Identifies the DpiChange event. This can only be listened to by a Window.
public static RoutedEvent,System.Windows DpiChangeEvent
Результат System.Windows.RoutedEvent