private void OnScaleChanged(DependencyPropertyChangedEventArgs e) { MonitorWidth = XMax - XMin; MonitorHeight = YMax - YMin; AspectRatio = (double)MonitorWidth / MonitorHeight; HorizontalSizeText.Text = MonitorWidth.ToString(); VerticalSizeText.Text = MonitorHeight.ToString(); }
public override string ToString() { var sb = new StringBuilder(); // using CultureInfo.InvariantCulture since this is internal data sb.Append("Monitor: "); sb.AppendLine(Monitor); sb.Append("Virtual desktop: "); sb.AppendLine(VirtualDesktop); sb.Append("DPI: "); sb.AppendLine(Dpi.ToString(CultureInfo.InvariantCulture)); sb.Append("X: "); sb.AppendLine(LeftCoordinate.ToString(CultureInfo.InvariantCulture)); sb.Append("Y: "); sb.AppendLine(TopCoordinate.ToString(CultureInfo.InvariantCulture)); sb.Append("Width: "); sb.AppendLine(MonitorWidth.ToString(CultureInfo.InvariantCulture)); sb.Append("Height: "); sb.AppendLine(MonitorHeight.ToString(CultureInfo.InvariantCulture)); return(sb.ToString()); }