|
|
@@ -30,46 +30,35 @@ namespace HKCardOUT.Views |
|
|
|
/// </summary> |
|
|
|
public partial class AdWindow : Window |
|
|
|
{ |
|
|
|
private int BindScreen = -1; |
|
|
|
public AdWindow(string input, int bindScreen) |
|
|
|
public AdWindow(string input) |
|
|
|
{ |
|
|
|
InitializeComponent(); |
|
|
|
|
|
|
|
this.Loaded += (sender, ev) => |
|
|
|
{ |
|
|
|
this.WindowState = WindowState.Maximized; |
|
|
|
if (BindScreen != -1) |
|
|
|
{ |
|
|
|
int[] NotchNum = new int[2]; |
|
|
|
if (bindScreen == 0) { NotchNum[0] = 1; NotchNum[1] = 2; } |
|
|
|
if (bindScreen == 1) { NotchNum[0] = 5; NotchNum[1] = 6; } |
|
|
|
if (bindScreen == 2) { NotchNum[0] = 3; NotchNum[1] = 4; } |
|
|
|
(this.DataContext as AdWindowViewModel).InitData(NotchNum); |
|
|
|
(this.DataContext as AdWindowViewModel).InitData(); |
|
|
|
|
|
|
|
ThreadManage.GetInstance().StartLong(new Action(() => |
|
|
|
ThreadManage.GetInstance().StartLong(new Action(() => |
|
|
|
{ |
|
|
|
if (DataBus.saleLogDtos.Count > 0) |
|
|
|
{ |
|
|
|
if (DataBus.saleLogDtos.Count > 0) |
|
|
|
if (DataBus.saleLogDtos.TryDequeue(out SaleLogDto info)) |
|
|
|
{ |
|
|
|
if (DataBus.saleLogDtos.TryDequeue(out SaleLogDto info)) |
|
|
|
{ |
|
|
|
if (!DataBus.SaleLogDtoList.ContainsKey(info.Location)) |
|
|
|
DataBus.SaleLogDtoList.TryAdd(info.Location, new ConcurrentQueue<SaleLogDto>()); |
|
|
|
DataBus.SaleLogDtoList[info.Location].Enqueue(info); |
|
|
|
} |
|
|
|
if (!DataBus.SaleLogDtoList.ContainsKey(info.Location)) |
|
|
|
DataBus.SaleLogDtoList.TryAdd(info.Location, new ConcurrentQueue<SaleLogDto>()); |
|
|
|
DataBus.SaleLogDtoList[info.Location].Enqueue(info); |
|
|
|
} |
|
|
|
Thread.Sleep(100); |
|
|
|
}), "刷卡队列分配"); |
|
|
|
} |
|
|
|
} |
|
|
|
Thread.Sleep(100); |
|
|
|
}), "刷卡队列分配"); |
|
|
|
InitView2(input); |
|
|
|
|
|
|
|
//InitControl(); |
|
|
|
}; |
|
|
|
this.Closed += (sender, ev) => |
|
|
|
{ |
|
|
|
App.Current.Shutdown(0); |
|
|
|
}; |
|
|
|
|
|
|
|
BindScreen = bindScreen; |
|
|
|
} |
|
|
|
|
|
|
|
public async void InitView2(string input) |
|
|
@@ -92,341 +81,115 @@ 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.FirstOrDefault(t => t.GateId == GateId).Locs; |
|
|
|
var GateId = DataBus.StoreInfo.Devices.Where(t => t.Address == "05" || t.Address == "06").Select(t => t.GateId).FirstOrDefault(); |
|
|
|
var area = DataBus.RangeCtrl.FirstOrDefault(t => t.GateId == GateId).Locs; |
|
|
|
|
|
|
|
foreach (var item in area) |
|
|
|
foreach (var item in area) |
|
|
|
{ |
|
|
|
if (item.Key.ToLower().Equals("top")) |
|
|
|
{ |
|
|
|
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) |
|
|
|
{ |
|
|
|
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})"); |
|
|
|
}); |
|
|
|
} |
|
|
|
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})"); |
|
|
|
}); |
|
|
|
} |
|
|
|
if (item.Key.ToLower().Equals("right")) |
|
|
|
else |
|
|
|
{ |
|
|
|
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})"); |
|
|
|
}); |
|
|
|
} |
|
|
|
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 (BindScreen == 1) |
|
|
|
{ |
|
|
|
var GateId = DataBus.StoreInfo.Devices.Where(t => t.Address == "01" || t.Address == "02").Select(t => t.GateId).FirstOrDefault(); |
|
|
|
var area = DataBus.RangeCtrl.FirstOrDefault(t => t.GateId == GateId).Locs; |
|
|
|
|
|
|
|
foreach (var item in area) |
|
|
|
if (item.Key.ToLower().Equals("bottom")) |
|
|
|
{ |
|
|
|
if (item.Key.ToLower().Equals("top")) |
|
|
|
if (item.IsShow) |
|
|
|
{ |
|
|
|
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})"); |
|
|
|
}); |
|
|
|
} |
|
|
|
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})"); |
|
|
|
}); |
|
|
|
} |
|
|
|
if (item.Key.ToLower().Equals("bottom")) |
|
|
|
else |
|
|
|
{ |
|
|
|
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})"); |
|
|
|
}); |
|
|
|
} |
|
|
|
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 (BindScreen == 2) |
|
|
|
{ |
|
|
|
var GateId = DataBus.StoreInfo.Devices.Where(t => t.Address == "05" || t.Address == "06").Select(t => t.GateId).FirstOrDefault(); |
|
|
|
var area = DataBus.RangeCtrl.FirstOrDefault(t => t.GateId == GateId).Locs; |
|
|
|
|
|
|
|
foreach (var item in area) |
|
|
|
if (item.Key.ToLower().Equals("left")) |
|
|
|
{ |
|
|
|
if (item.Key.ToLower().Equals("top")) |
|
|
|
if (item.IsShow) |
|
|
|
{ |
|
|
|
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})"); |
|
|
|
}); |
|
|
|
} |
|
|
|
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})"); |
|
|
|
}); |
|
|
|
} |
|
|
|
if (item.Key.ToLower().Equals("bottom")) |
|
|
|
else |
|
|
|
{ |
|
|
|
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})"); |
|
|
|
}); |
|
|
|
} |
|
|
|
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("left")) |
|
|
|
} |
|
|
|
if (item.Key.ToLower().Equals("right")) |
|
|
|
{ |
|
|
|
if (item.IsShow) |
|
|
|
{ |
|
|
|
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})"); |
|
|
|
}); |
|
|
|
} |
|
|
|
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})"); |
|
|
|
}); |
|
|
|
} |
|
|
|
if (item.Key.ToLower().Equals("right")) |
|
|
|
else |
|
|
|
{ |
|
|
|
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})"); |
|
|
|
}); |
|
|
|
} |
|
|
|
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); |
|
|
|
}, $"区域控制", true); |
|
|
|
} |
|
|
|
} |
|
|
|
} |