|
|
|
@ -64,7 +64,7 @@ namespace v2rayN.Desktop.Views
|
|
|
|
|
this.BindCommand(ViewModel, vm => vm.SetDefaultLoadBalanceServerCmd, v => v.menuSetDefaultLoadBalanceServer).DisposeWith(disposables); |
|
|
|
|
|
|
|
|
|
//servers move |
|
|
|
|
this.OneWayBind(ViewModel, vm => vm.SubItems, v => v.cmbMoveToGroup.ItemsSource).DisposeWith(disposables); |
|
|
|
|
//this.OneWayBind(ViewModel, vm => vm.SubItems, v => v.cmbMoveToGroup.ItemsSource).DisposeWith(disposables); |
|
|
|
|
this.Bind(ViewModel, vm => vm.SelectedMoveToGroup, v => v.cmbMoveToGroup.SelectedItem).DisposeWith(disposables); |
|
|
|
|
|
|
|
|
|
this.BindCommand(ViewModel, vm => vm.MoveTopCmd, v => v.menuMoveTop).DisposeWith(disposables); |
|
|
|
@ -86,9 +86,9 @@ namespace v2rayN.Desktop.Views
|
|
|
|
|
this.BindCommand(ViewModel, vm => vm.Export2ShareUrlBase64Cmd, v => v.menuExport2ShareUrlBase64).DisposeWith(disposables); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
//RestoreUI(); |
|
|
|
|
RestoreUI(); |
|
|
|
|
ViewModel?.RefreshServers(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//#region Event |
|
|
|
|
|
|
|
|
@ -194,6 +194,7 @@ namespace v2rayN.Desktop.Views
|
|
|
|
|
{ |
|
|
|
|
ViewModel?.EditServerAsync(EConfigType.Custom); |
|
|
|
|
} |
|
|
|
|
StorageUI(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void LstProfiles_LoadingRow(object? sender, DataGridRowEventArgs e) |
|
|
|
@ -301,6 +302,7 @@ namespace v2rayN.Desktop.Views
|
|
|
|
|
{ |
|
|
|
|
it.Width = new DataGridLength(1, DataGridLengthUnitType.Auto); |
|
|
|
|
} |
|
|
|
|
StorageUI(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void TxtServerFilter_KeyDown(object? sender, KeyEventArgs e) |
|
|
|
@ -315,61 +317,61 @@ namespace v2rayN.Desktop.Views
|
|
|
|
|
|
|
|
|
|
//#region UI |
|
|
|
|
|
|
|
|
|
//private void RestoreUI() |
|
|
|
|
//{ |
|
|
|
|
// var lvColumnItem = _config.uiItem.mainColumnItem.OrderBy(t => t.Index).ToList(); |
|
|
|
|
// var displayIndex = 0; |
|
|
|
|
// foreach (var item in lvColumnItem) |
|
|
|
|
// { |
|
|
|
|
// foreach (MyDGTextColumn item2 in lstProfiles.Columns) |
|
|
|
|
// { |
|
|
|
|
// if (item2.ExName == item.Name) |
|
|
|
|
// { |
|
|
|
|
// if (item.Width < 0) |
|
|
|
|
// { |
|
|
|
|
// item2.IsVisible = false; |
|
|
|
|
// } |
|
|
|
|
// else |
|
|
|
|
// { |
|
|
|
|
// item2.Width = item.Width; |
|
|
|
|
// item2.DisplayIndex = displayIndex++; |
|
|
|
|
// } |
|
|
|
|
// } |
|
|
|
|
// } |
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
// if (!_config.guiItem.enableStatistics) |
|
|
|
|
// { |
|
|
|
|
// colTodayUp.IsVisible = |
|
|
|
|
// colTodayDown.IsVisible = |
|
|
|
|
// colTotalUp.IsVisible = |
|
|
|
|
// colTotalDown.IsVisible = false; |
|
|
|
|
// } |
|
|
|
|
// else |
|
|
|
|
// { |
|
|
|
|
// colTodayUp.IsVisible = |
|
|
|
|
// colTodayDown.IsVisible = |
|
|
|
|
// colTotalUp.IsVisible = |
|
|
|
|
// colTotalDown.IsVisible = true; |
|
|
|
|
// } |
|
|
|
|
//} |
|
|
|
|
private void RestoreUI() |
|
|
|
|
{ |
|
|
|
|
var lvColumnItem = _config.uiItem.mainColumnItem.OrderBy(t => t.Index).ToList(); |
|
|
|
|
var displayIndex = 0; |
|
|
|
|
foreach (var item in lvColumnItem) |
|
|
|
|
{ |
|
|
|
|
foreach (var item2 in lstProfiles.Columns) |
|
|
|
|
{ |
|
|
|
|
if (item2.Tag == null) |
|
|
|
|
{ |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
if (item2.Tag.Equals(item.Name)) |
|
|
|
|
{ |
|
|
|
|
if (item.Width < 0) |
|
|
|
|
{ |
|
|
|
|
item2.IsVisible = false; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
item2.Width = new DataGridLength(item.Width, DataGridLengthUnitType.Pixel); ; |
|
|
|
|
item2.DisplayIndex = displayIndex++; |
|
|
|
|
} |
|
|
|
|
if (item.Name.StartsWith("to")) |
|
|
|
|
{ |
|
|
|
|
if (!_config.guiItem.enableStatistics) |
|
|
|
|
{ |
|
|
|
|
item2.IsVisible = false; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//private void StorageUI() |
|
|
|
|
//{ |
|
|
|
|
// List<ColumnItem> lvColumnItem = new(); |
|
|
|
|
// for (int k = 0; k < lstProfiles.Columns.Count; k++) |
|
|
|
|
// { |
|
|
|
|
// var item2 = (MyDGTextColumn)lstProfiles.Columns[k]; |
|
|
|
|
// lvColumnItem.Add(new() |
|
|
|
|
// { |
|
|
|
|
// Name = item2.ExName, |
|
|
|
|
// Width = item2.IsVisible == true ? Utils.ToInt(item2.ActualWidth) : -1, |
|
|
|
|
// Index = item2.DisplayIndex |
|
|
|
|
// }); |
|
|
|
|
// } |
|
|
|
|
// _config.uiItem.mainColumnItem = lvColumnItem; |
|
|
|
|
// ConfigHandler.SaveConfig(_config); |
|
|
|
|
//} |
|
|
|
|
private void StorageUI() |
|
|
|
|
{ |
|
|
|
|
List<ColumnItem> lvColumnItem = new(); |
|
|
|
|
for (int k = 0; k < lstProfiles.Columns.Count; k++) |
|
|
|
|
{ |
|
|
|
|
var item2 = lstProfiles.Columns[k]; |
|
|
|
|
if (item2.Tag == null) |
|
|
|
|
{ |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
lvColumnItem.Add(new() |
|
|
|
|
{ |
|
|
|
|
Name = (string)item2.Tag, |
|
|
|
|
Width = item2.IsVisible == true ? Utils.ToInt(item2.ActualWidth) : -1, |
|
|
|
|
Index = item2.DisplayIndex |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
_config.uiItem.mainColumnItem = lvColumnItem; |
|
|
|
|
ConfigHandler.SaveConfig(_config); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//#endregion UI |
|
|
|
|
|
|
|
|
|