xxe hace 2 años
padre
commit
40c685d2e1
Se han modificado 1 ficheros con 4 adiciones y 5 borrados
  1. +4
    -5
      HKCardOUT/Views/AdWindow.xaml.cs

+ 4
- 5
HKCardOUT/Views/AdWindow.xaml.cs Ver fichero

@@ -74,18 +74,17 @@ namespace HKCardOUT.Views

public async void InitView2(string input)
{
var height = this.content.RowDefinitions[1].ActualHeight - 10;
var width = this.content.ActualWidth - 9.5;
var height = this.content.RowDefinitions[1].ActualHeight - 12;
var width = this.content.ActualWidth - 11;
input = input.Replace("style=\"width: 100%;\"", "");

StringBuilder sb = new StringBuilder();
sb.Append("<html><style>body {width: " + width + "px;height: " + height + "px;margin: 0;padding:0;}body p {width: " + width + "px;height: " + height + "px;}body p img {width: 100%;height: 100%;}</style><script>function Set(width, height) { var body = document.getElementsByTagName('body')[0]; body.style.width = width + 'px';body.style.height = height + 'px';var p = document.getElementsByTagName('p')[0]; p.style.width = width + 'px';p.style.height = height + 'px';}</script><body>" + input + "</body></html>");
var html = sb.ToString();
await view2.EnsureCoreWebView2Async(null);
view2.CoreWebView2.Settings.AreDefaultContextMenusEnabled = true;
view2.CoreWebView2.Settings.AreDevToolsEnabled = true;
view2.CoreWebView2.Settings.AreDefaultContextMenusEnabled = false;
view2.CoreWebView2.Settings.AreDevToolsEnabled = false;
view2.CoreWebView2.NavigateToString(html);
view2.CoreWebView2.Settings.IsStatusBarEnabled = false;
}

private void InitControl()


Cargando…
Cancelar
Guardar