I keep getting an error: visualtreehelper' does not contain a definition for 'getdpi' also this is a open source https://github.com/IntelOrca/teds-terminal i really want it to work Please help me. Code:
using System;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Interop;
using System.Windows.Media;
using MahApps.Metro.Controls;
using tterm.Ui;
using tterm.Extensions;
using tterm.Utility;
using tterm.Terminal;
using Newtonsoft.Json;
using static tterm.Native.Win32;
namespace tterm
{
public class EnhancedWindow : MetroWindow
{
private readonly WindowInteropHelper _interopHelper;
protected bool IsResizing { get; private set; }
protected IntPtr Hwnd => _interopHelper.Handle;
protected DpiScale Dpi => VisualTreeHelper.GetDpi(this);
public Size Size
{
get => RenderSize;
set
{
if (value != RenderSize)
{
var dpi = Dpi;
int width = (int)(value.Width * dpi.DpiScaleX);
int height = (int)(value.Height * dpi.DpiScaleY);
uint flags = SWP_NOMOVE | SWP_NOZORDER;
SetWindowPos(Hwnd, IntPtr.Zero, 0, 0, width, height, flags);
}
}
}
}
}