|
|
@@ -44,7 +44,8 @@ namespace HKCardOUT.Views |
|
|
|
if (bindScreen == 1) { NotchNum[0] = 1; NotchNum[1] = 2; } |
|
|
|
if (bindScreen == 2) { NotchNum[0] = 5; NotchNum[1] = 6; } |
|
|
|
if (bindScreen == 0) { NotchNum[0] = 3; NotchNum[1] = 4; } |
|
|
|
(this.DataContext as AdWindowViewModel).InitData(NotchNum); |
|
|
|
var vm = (this.DataContext as AdWindowViewModel); |
|
|
|
vm.InitData(NotchNum); |
|
|
|
|
|
|
|
ThreadManage.GetInstance().StartLong(new Action(() => |
|
|
|
{ |
|
|
@@ -60,21 +61,6 @@ namespace HKCardOUT.Views |
|
|
|
Thread.Sleep(100); |
|
|
|
}), "刷卡队列分配"); |
|
|
|
} |
|
|
|
//if (bindScreen == 2) |
|
|
|
//{ |
|
|
|
// //this.one.Text = "4号档口"; |
|
|
|
// //this.two.Text = "3号档口"; |
|
|
|
//} |
|
|
|
//if (bindScreen == 1) |
|
|
|
//{ |
|
|
|
// //this.one.Text = "2号档口"; |
|
|
|
// //this.two.Text = "1号档口"; |
|
|
|
//} |
|
|
|
//if (bindScreen == 0) |
|
|
|
//{ |
|
|
|
// //this.one.Text = "6号档口"; |
|
|
|
// //this.two.Text = "5号档口"; |
|
|
|
//} |
|
|
|
InitView2(input); |
|
|
|
|
|
|
|
InitControl(); |
|
|
@@ -89,17 +75,16 @@ namespace HKCardOUT.Views |
|
|
|
|
|
|
|
public async void InitView2(string input) |
|
|
|
{ |
|
|
|
var height = this.content.RowDefinitions[3].ActualHeight; |
|
|
|
var width = this.content.ActualWidth; |
|
|
|
input = input.Replace("100%", $"{width - 35};height:{height - 35}px;margin:0px 0px 0px 0px;"); |
|
|
|
//input = input.Replace("100%", $"{width-25}px;height:{height-25}px;margin:1px 0px 0px 1px;"); |
|
|
|
StringBuilder sb = new StringBuilder(); |
|
|
|
var height = this.content.RowDefinitions[1].ActualHeight - 10; |
|
|
|
var width = this.content.ActualWidth - 9.5; |
|
|
|
input = input.Replace("style=\"width: 100%;\"", ""); |
|
|
|
|
|
|
|
sb.Append($"<html><body>{input}</body></html>"); |
|
|
|
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 = false; |
|
|
|
view2.CoreWebView2.Settings.AreDevToolsEnabled = false; |
|
|
|
view2.CoreWebView2.Settings.AreDefaultContextMenusEnabled = true; |
|
|
|
view2.CoreWebView2.Settings.AreDevToolsEnabled = true; |
|
|
|
view2.CoreWebView2.NavigateToString(html); |
|
|
|
view2.CoreWebView2.Settings.IsStatusBarEnabled = false; |
|
|
|
} |
|
|
@@ -108,125 +93,338 @@ namespace HKCardOUT.Views |
|
|
|
{ |
|
|
|
ThreadManage.GetInstance().StartLong(() => |
|
|
|
{ |
|
|
|
if (BindScreen == 0) |
|
|
|
{ |
|
|
|
var GateId = DataBus.StoreInfo.Devices.Where(t => t.Address == "05" || t.Address == "06").Select(t => t.GateId).FirstOrDefault(); |
|
|
|
var area = DataBus.RangeCtrl.GateSetUp.FirstOrDefault(t => t.GateId == GateId).Locs; |
|
|
|
|
|
|
|
//if (BindScreen == 0) |
|
|
|
//{ |
|
|
|
// var GateId = DataBus.StoreInfo.Devices.Where(t => t.Address == "03" || t.Address == "04").Select(t => t.GateId).FirstOrDefault(); |
|
|
|
// var area = DataBus.RangeCtrl.GateSetUp.FirstOrDefault(t => t.GateId == GateId).Locs; |
|
|
|
|
|
|
|
// foreach (var item in area) |
|
|
|
// { |
|
|
|
// switch (item.Key.ToLower()) |
|
|
|
// { |
|
|
|
// case "left": |
|
|
|
// if (item.IsShow) |
|
|
|
// this.alls.ColumnDefinitions[0].Width = new GridLength(0.2, GridUnitType.Star); |
|
|
|
// else |
|
|
|
// this.alls.ColumnDefinitions[0].Width = new GridLength(0, GridUnitType.Star); |
|
|
|
// break; |
|
|
|
// case "top": |
|
|
|
// if (item.IsShow) |
|
|
|
// this.area3.ColumnDefinitions[0].Width = new GridLength(0.3, GridUnitType.Star); |
|
|
|
// else |
|
|
|
// this.area3.ColumnDefinitions[0].Width = new GridLength(0, GridUnitType.Star); |
|
|
|
// break; |
|
|
|
// case "right": |
|
|
|
// if (item.IsShow) |
|
|
|
// this.alls.ColumnDefinitions[0].Width = new GridLength(0.2, GridUnitType.Star); |
|
|
|
// else |
|
|
|
// this.alls.ColumnDefinitions[0].Width = new GridLength(0, GridUnitType.Star); |
|
|
|
// break; |
|
|
|
// case "bottom": |
|
|
|
// if (item.IsShow) |
|
|
|
// this.area3.ColumnDefinitions[1].Width = new GridLength(0.7, GridUnitType.Star); |
|
|
|
// else |
|
|
|
// this.area3.ColumnDefinitions[1].Width = new GridLength(0, GridUnitType.Star); |
|
|
|
// break; |
|
|
|
// default: |
|
|
|
// break; |
|
|
|
// } |
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
//} |
|
|
|
foreach (var item in area) |
|
|
|
{ |
|
|
|
if (item.Key.ToLower().Equals("top")) |
|
|
|
{ |
|
|
|
if (item.IsShow) |
|
|
|
{ |
|
|
|
var height = this.content.RowDefinitions[1].ActualHeight - 10; |
|
|
|
var width = this.content.ActualWidth - 9.5; |
|
|
|
this.content.Dispatcher.Invoke(async () => |
|
|
|
{ |
|
|
|
content.RowDefinitions[0].Height = new GridLength(0.239, GridUnitType.Star); |
|
|
|
if (view2.CoreWebView2 != null) |
|
|
|
await view2.CoreWebView2.ExecuteScriptAsync($"Set({width},{height})"); |
|
|
|
}); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
var height = this.content.RowDefinitions[1].ActualHeight - 10; |
|
|
|
var width = this.content.ActualWidth - 10; |
|
|
|
this.content.Dispatcher.Invoke(async () => |
|
|
|
{ |
|
|
|
content.RowDefinitions[0].Height = new GridLength(0, GridUnitType.Star); |
|
|
|
if (view2.CoreWebView2 != null) |
|
|
|
await view2.CoreWebView2.ExecuteScriptAsync($"Set({width},{height})"); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
if (item.Key.ToLower().Equals("bottom")) |
|
|
|
{ |
|
|
|
if (item.IsShow) |
|
|
|
{ |
|
|
|
var height = this.content.RowDefinitions[1].ActualHeight - 10; |
|
|
|
var width = this.content.ActualWidth - 9.5; |
|
|
|
this.content.Dispatcher.Invoke(async () => |
|
|
|
{ |
|
|
|
content.RowDefinitions[1].Height = new GridLength(0.5, GridUnitType.Star); |
|
|
|
if (view2.CoreWebView2 != null) |
|
|
|
await view2.CoreWebView2.ExecuteScriptAsync($"Set({width},{height})"); |
|
|
|
}); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
var height = this.content.RowDefinitions[1].ActualHeight - 10; |
|
|
|
var width = this.content.ActualWidth - 10; |
|
|
|
this.content.Dispatcher.Invoke(async () => |
|
|
|
{ |
|
|
|
content.RowDefinitions[1].Height = new GridLength(0, GridUnitType.Star); |
|
|
|
if (view2.CoreWebView2 != null) |
|
|
|
await view2.CoreWebView2.ExecuteScriptAsync($"Set({width},{height})"); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
if (item.Key.ToLower().Equals("left")) |
|
|
|
{ |
|
|
|
if (item.IsShow) |
|
|
|
{ |
|
|
|
var height = this.content.RowDefinitions[1].ActualHeight - 10; |
|
|
|
var width = this.content.ActualWidth - 9.5; |
|
|
|
this.alls.Dispatcher.Invoke(async () => |
|
|
|
{ |
|
|
|
alls.ColumnDefinitions[0].Width = new GridLength(0.2, GridUnitType.Star); |
|
|
|
if (view2.CoreWebView2 != null) |
|
|
|
await view2.CoreWebView2.ExecuteScriptAsync($"Set({width},{height})"); |
|
|
|
}); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
var height = this.content.RowDefinitions[1].ActualHeight - 10; |
|
|
|
var width = alls.ColumnDefinitions[0].ActualWidth + this.content.ActualWidth - 10; |
|
|
|
this.alls.Dispatcher.Invoke(async () => |
|
|
|
{ |
|
|
|
alls.ColumnDefinitions[0].Width = new GridLength(0, GridUnitType.Star); |
|
|
|
if (view2.CoreWebView2 != null) |
|
|
|
await view2.CoreWebView2.ExecuteScriptAsync($"Set({width},{height})"); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
if (item.Key.ToLower().Equals("right")) |
|
|
|
{ |
|
|
|
if (item.IsShow) |
|
|
|
{ |
|
|
|
var height = this.content.RowDefinitions[1].ActualHeight - 10; |
|
|
|
var width = this.content.ActualWidth - 9.5; |
|
|
|
this.alls.ColumnDefinitions[2].Width = new GridLength(0.2, GridUnitType.Star); |
|
|
|
this.alls.Dispatcher.Invoke(async () => |
|
|
|
{ |
|
|
|
alls.ColumnDefinitions[2].Width = new GridLength(0.2, GridUnitType.Star); |
|
|
|
if (view2.CoreWebView2 != null) |
|
|
|
await view2.CoreWebView2.ExecuteScriptAsync($"Set({width},{height})"); |
|
|
|
}); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
var height = this.content.RowDefinitions[1].ActualHeight - 10; |
|
|
|
var width = alls.ColumnDefinitions[2].ActualWidth + this.content.ActualWidth - 10; |
|
|
|
this.alls.Dispatcher.Invoke(async () => |
|
|
|
{ |
|
|
|
alls.ColumnDefinitions[2].Width = new GridLength(0, GridUnitType.Star); |
|
|
|
if (view2.CoreWebView2 != null) |
|
|
|
await view2.CoreWebView2.ExecuteScriptAsync($"Set({width},{height})"); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//if (BindScreen == 1) |
|
|
|
//{ |
|
|
|
// var GateId = DataBus.StoreInfo.Devices.Where(t => t.Address == "01" || t.Address == "02").Select(t => t.GateId).FirstOrDefault(); |
|
|
|
// var area = DataBus.RangeCtrl.GateSetUp.FirstOrDefault(t => t.GateId == GateId).Locs; |
|
|
|
if (BindScreen == 1) |
|
|
|
{ |
|
|
|
var GateId = DataBus.StoreInfo.Devices.Where(t => t.Address == "01" || t.Address == "02").Select(t => t.GateId).FirstOrDefault(); |
|
|
|
var area = DataBus.RangeCtrl.GateSetUp.FirstOrDefault(t => t.GateId == GateId).Locs; |
|
|
|
|
|
|
|
// foreach (var item in area) |
|
|
|
// { |
|
|
|
// switch (item.Key.ToLower()) |
|
|
|
// { |
|
|
|
// case "left": |
|
|
|
// if (item.IsShow) |
|
|
|
// this.alls.ColumnDefinitions[0].Width = new GridLength(0.2, GridUnitType.Star); |
|
|
|
// else |
|
|
|
// this.alls.ColumnDefinitions[0].Width = new GridLength(0, GridUnitType.Star); |
|
|
|
// break; |
|
|
|
// case "top": |
|
|
|
// if (item.IsShow) |
|
|
|
// this.area3.ColumnDefinitions[0].Width = new GridLength(0.3, GridUnitType.Star); |
|
|
|
// else |
|
|
|
// this.area3.ColumnDefinitions[0].Width = new GridLength(0, GridUnitType.Star); |
|
|
|
// break; |
|
|
|
// case "right": |
|
|
|
// if (item.IsShow) |
|
|
|
// this.alls.ColumnDefinitions[0].Width = new GridLength(0.2, GridUnitType.Star); |
|
|
|
// else |
|
|
|
// this.alls.ColumnDefinitions[0].Width = new GridLength(0, GridUnitType.Star); |
|
|
|
// break; |
|
|
|
// case "bottom": |
|
|
|
// if (item.IsShow) |
|
|
|
// this.area3.ColumnDefinitions[1].Width = new GridLength(0.7, GridUnitType.Star); |
|
|
|
// else |
|
|
|
// this.area3.ColumnDefinitions[1].Width = new GridLength(0, GridUnitType.Star); |
|
|
|
// break; |
|
|
|
// default: |
|
|
|
// break; |
|
|
|
// } |
|
|
|
// } |
|
|
|
//} |
|
|
|
foreach (var item in area) |
|
|
|
{ |
|
|
|
if (item.Key.ToLower().Equals("top")) |
|
|
|
{ |
|
|
|
if (item.IsShow) |
|
|
|
{ |
|
|
|
var height = this.content.RowDefinitions[1].ActualHeight - 10; |
|
|
|
var width = this.content.ActualWidth - 9.5; |
|
|
|
this.content.Dispatcher.Invoke(async () => |
|
|
|
{ |
|
|
|
content.RowDefinitions[0].Height = new GridLength(0.239, GridUnitType.Star); |
|
|
|
if (view2.CoreWebView2 != null) |
|
|
|
await view2.CoreWebView2.ExecuteScriptAsync($"Set({width},{height})"); |
|
|
|
}); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
var height = this.content.RowDefinitions[1].ActualHeight - 10; |
|
|
|
var width = this.content.ActualWidth - 10; |
|
|
|
this.content.Dispatcher.Invoke(async () => |
|
|
|
{ |
|
|
|
content.RowDefinitions[0].Height = new GridLength(0, GridUnitType.Star); |
|
|
|
if (view2.CoreWebView2 != null) |
|
|
|
await view2.CoreWebView2.ExecuteScriptAsync($"Set({width},{height})"); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
if (item.Key.ToLower().Equals("bottom")) |
|
|
|
{ |
|
|
|
if (item.IsShow) |
|
|
|
{ |
|
|
|
var height = this.content.RowDefinitions[1].ActualHeight - 10; |
|
|
|
var width = this.content.ActualWidth - 9.5; |
|
|
|
this.content.Dispatcher.Invoke(async () => |
|
|
|
{ |
|
|
|
content.RowDefinitions[1].Height = new GridLength(0.5, GridUnitType.Star); |
|
|
|
if (view2.CoreWebView2 != null) |
|
|
|
await view2.CoreWebView2.ExecuteScriptAsync($"Set({width},{height})"); |
|
|
|
}); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
var height = this.content.RowDefinitions[1].ActualHeight - 10; |
|
|
|
var width = this.content.ActualWidth - 10; |
|
|
|
this.content.Dispatcher.Invoke(async () => |
|
|
|
{ |
|
|
|
content.RowDefinitions[1].Height = new GridLength(0, GridUnitType.Star); |
|
|
|
if (view2.CoreWebView2 != null) |
|
|
|
await view2.CoreWebView2.ExecuteScriptAsync($"Set({width},{height})"); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
if (item.Key.ToLower().Equals("left")) |
|
|
|
{ |
|
|
|
if (item.IsShow) |
|
|
|
{ |
|
|
|
var height = this.content.RowDefinitions[1].ActualHeight - 10; |
|
|
|
var width = this.content.ActualWidth - 9.5; |
|
|
|
this.alls.Dispatcher.Invoke(async () => |
|
|
|
{ |
|
|
|
alls.ColumnDefinitions[0].Width = new GridLength(0.2, GridUnitType.Star); |
|
|
|
if (view2.CoreWebView2 != null) |
|
|
|
await view2.CoreWebView2.ExecuteScriptAsync($"Set({width},{height})"); |
|
|
|
}); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
var height = this.content.RowDefinitions[1].ActualHeight - 10; |
|
|
|
var width = alls.ColumnDefinitions[0].ActualWidth + this.content.ActualWidth - 10; |
|
|
|
this.alls.Dispatcher.Invoke(async () => |
|
|
|
{ |
|
|
|
alls.ColumnDefinitions[0].Width = new GridLength(0, GridUnitType.Star); |
|
|
|
if (view2.CoreWebView2 != null) |
|
|
|
await view2.CoreWebView2.ExecuteScriptAsync($"Set({width},{height})"); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
if (item.Key.ToLower().Equals("right")) |
|
|
|
{ |
|
|
|
if (item.IsShow) |
|
|
|
{ |
|
|
|
var height = this.content.RowDefinitions[1].ActualHeight - 10; |
|
|
|
var width = this.content.ActualWidth - 9.5; |
|
|
|
this.alls.ColumnDefinitions[2].Width = new GridLength(0.2, GridUnitType.Star); |
|
|
|
this.alls.Dispatcher.Invoke(async () => |
|
|
|
{ |
|
|
|
alls.ColumnDefinitions[2].Width = new GridLength(0.2, GridUnitType.Star); |
|
|
|
if (view2.CoreWebView2 != null) |
|
|
|
await view2.CoreWebView2.ExecuteScriptAsync($"Set({width},{height})"); |
|
|
|
}); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
var height = this.content.RowDefinitions[1].ActualHeight - 10; |
|
|
|
var width = alls.ColumnDefinitions[2].ActualWidth + this.content.ActualWidth - 10; |
|
|
|
this.alls.Dispatcher.Invoke(async () => |
|
|
|
{ |
|
|
|
alls.ColumnDefinitions[2].Width = new GridLength(0, GridUnitType.Star); |
|
|
|
if (view2.CoreWebView2 != null) |
|
|
|
await view2.CoreWebView2.ExecuteScriptAsync($"Set({width},{height})"); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//if (BindScreen == 2) |
|
|
|
//{ |
|
|
|
// var GateId = DataBus.StoreInfo.Devices.Where(t => t.Address == "05" || t.Address == "06").Select(t => t.GateId).FirstOrDefault(); |
|
|
|
// var area = DataBus.RangeCtrl.GateSetUp.FirstOrDefault(t => t.GateId == GateId).Locs; |
|
|
|
if (BindScreen == 2) |
|
|
|
{ |
|
|
|
var GateId = DataBus.StoreInfo.Devices.Where(t => t.Address == "05" || t.Address == "06").Select(t => t.GateId).FirstOrDefault(); |
|
|
|
var area = DataBus.RangeCtrl.GateSetUp.FirstOrDefault(t => t.GateId == GateId).Locs; |
|
|
|
|
|
|
|
// foreach (var item in area) |
|
|
|
// { |
|
|
|
// switch (item.Key.ToLower()) |
|
|
|
// { |
|
|
|
// case "left": |
|
|
|
// if (item.IsShow) |
|
|
|
// this.alls.ColumnDefinitions[0].Width = new GridLength(0.2, GridUnitType.Star); |
|
|
|
// else |
|
|
|
// this.alls.ColumnDefinitions[0].Width = new GridLength(0, GridUnitType.Star); |
|
|
|
// break; |
|
|
|
// case "top": |
|
|
|
// if (item.IsShow) |
|
|
|
// this.area3.ColumnDefinitions[0].Width = new GridLength(0.3, GridUnitType.Star); |
|
|
|
// else |
|
|
|
// this.area3.ColumnDefinitions[0].Width = new GridLength(0, GridUnitType.Star); |
|
|
|
// break; |
|
|
|
// case "right": |
|
|
|
// if (item.IsShow) |
|
|
|
// this.alls.ColumnDefinitions[0].Width = new GridLength(0.2, GridUnitType.Star); |
|
|
|
// else |
|
|
|
// this.alls.ColumnDefinitions[0].Width = new GridLength(0, GridUnitType.Star); |
|
|
|
// break; |
|
|
|
// case "bottom": |
|
|
|
// if (item.IsShow) |
|
|
|
// this.area3.ColumnDefinitions[1].Width = new GridLength(0.7, GridUnitType.Star); |
|
|
|
// else |
|
|
|
// this.area3.ColumnDefinitions[1].Width = new GridLength(0, GridUnitType.Star); |
|
|
|
// break; |
|
|
|
// default: |
|
|
|
// break; |
|
|
|
// } |
|
|
|
// } |
|
|
|
//} |
|
|
|
foreach (var item in area) |
|
|
|
{ |
|
|
|
if (item.Key.ToLower().Equals("top")) |
|
|
|
{ |
|
|
|
if (item.IsShow) |
|
|
|
{ |
|
|
|
var height = this.content.RowDefinitions[1].ActualHeight - 10; |
|
|
|
var width = this.content.ActualWidth - 9.5; |
|
|
|
this.content.Dispatcher.Invoke(async () => |
|
|
|
{ |
|
|
|
content.RowDefinitions[0].Height = new GridLength(0.239, GridUnitType.Star); |
|
|
|
if (view2.CoreWebView2 != null) |
|
|
|
await view2.CoreWebView2.ExecuteScriptAsync($"Set({width},{height})"); |
|
|
|
}); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
var height = this.content.RowDefinitions[1].ActualHeight - 10; |
|
|
|
var width = this.content.ActualWidth - 10; |
|
|
|
this.content.Dispatcher.Invoke(async () => |
|
|
|
{ |
|
|
|
content.RowDefinitions[0].Height = new GridLength(0, GridUnitType.Star); |
|
|
|
if (view2.CoreWebView2 != null) |
|
|
|
await view2.CoreWebView2.ExecuteScriptAsync($"Set({width},{height})"); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
if (item.Key.ToLower().Equals("bottom")) |
|
|
|
{ |
|
|
|
if (item.IsShow) |
|
|
|
{ |
|
|
|
var height = this.content.RowDefinitions[1].ActualHeight - 10; |
|
|
|
var width = this.content.ActualWidth - 9.5; |
|
|
|
this.content.Dispatcher.Invoke(async () => |
|
|
|
{ |
|
|
|
content.RowDefinitions[1].Height = new GridLength(0.5, GridUnitType.Star); |
|
|
|
if (view2.CoreWebView2 != null) |
|
|
|
await view2.CoreWebView2.ExecuteScriptAsync($"Set({width},{height})"); |
|
|
|
}); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
var height = this.content.RowDefinitions[1].ActualHeight - 10; |
|
|
|
var width = this.content.ActualWidth - 10; |
|
|
|
this.content.Dispatcher.Invoke(async () => |
|
|
|
{ |
|
|
|
content.RowDefinitions[1].Height = new GridLength(0, GridUnitType.Star); |
|
|
|
if (view2.CoreWebView2 != null) |
|
|
|
await view2.CoreWebView2.ExecuteScriptAsync($"Set({width},{height})"); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
if (item.Key.ToLower().Equals("left")) |
|
|
|
{ |
|
|
|
if (item.IsShow) |
|
|
|
{ |
|
|
|
var height = this.content.RowDefinitions[1].ActualHeight - 10; |
|
|
|
var width = this.content.ActualWidth - 9.5; |
|
|
|
this.alls.Dispatcher.Invoke(async () => |
|
|
|
{ |
|
|
|
alls.ColumnDefinitions[0].Width = new GridLength(0.2, GridUnitType.Star); |
|
|
|
if (view2.CoreWebView2 != null) |
|
|
|
await view2.CoreWebView2.ExecuteScriptAsync($"Set({width},{height})"); |
|
|
|
}); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
var height = this.content.RowDefinitions[1].ActualHeight - 10; |
|
|
|
var width = alls.ColumnDefinitions[0].ActualWidth + this.content.ActualWidth - 10; |
|
|
|
this.alls.Dispatcher.Invoke(async () => |
|
|
|
{ |
|
|
|
alls.ColumnDefinitions[0].Width = new GridLength(0, GridUnitType.Star); |
|
|
|
if (view2.CoreWebView2 != null) |
|
|
|
await view2.CoreWebView2.ExecuteScriptAsync($"Set({width},{height})"); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
if (item.Key.ToLower().Equals("right")) |
|
|
|
{ |
|
|
|
if (item.IsShow) |
|
|
|
{ |
|
|
|
var height = this.content.RowDefinitions[1].ActualHeight - 10; |
|
|
|
var width = this.content.ActualWidth - 9.5; |
|
|
|
this.alls.ColumnDefinitions[2].Width = new GridLength(0.2, GridUnitType.Star); |
|
|
|
this.alls.Dispatcher.Invoke(async () => |
|
|
|
{ |
|
|
|
alls.ColumnDefinitions[2].Width = new GridLength(0.2, GridUnitType.Star); |
|
|
|
if (view2.CoreWebView2 != null) |
|
|
|
await view2.CoreWebView2.ExecuteScriptAsync($"Set({width},{height})"); |
|
|
|
}); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
var height = this.content.RowDefinitions[1].ActualHeight - 10; |
|
|
|
var width = alls.ColumnDefinitions[2].ActualWidth + this.content.ActualWidth - 10; |
|
|
|
this.alls.Dispatcher.Invoke(async () => |
|
|
|
{ |
|
|
|
alls.ColumnDefinitions[2].Width = new GridLength(0, GridUnitType.Star); |
|
|
|
if (view2.CoreWebView2 != null) |
|
|
|
await view2.CoreWebView2.ExecuteScriptAsync($"Set({width},{height})"); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
Thread.Sleep(5000); |
|
|
|
}, $"区域控制{BindScreen}", true); |
|
|
|