public async void OnDropEnabledPacks(ListBox _, DragEventArgs e) { var paths = (e.Data.GetData(DataFormats.FileDrop) as string[]) .Where(path => path.EndsWith(".zip")); EnabledPacks.AddRange(await _resourcePackService.MoveLoadAllAsync(paths, true)); }
public async void Reload() { await Task.Run(() => { EnabledPacks.Clear(); DisabledPacks.Clear(); var(enabledPacks, disabledPacks) = _resourcePackService.LoadAll(); EnabledPacks.AddRange(enabledPacks); DisabledPacks.AddRange(disabledPacks); }); }
public async void OnDrop(ListBox listBox, DragEventArgs e) { string[] paths = e.Data.GetData(DataFormats.FileDrop) as string[]; if (listBox.Name.StartsWith("Enabled")) { EnabledPacks.AddRange(await _resourcePackService.MoveLoadAllAsync(paths, true, IsCopy)); } else { DisabledPacks.AddRange(await _resourcePackService.MoveLoadAllAsync(paths, false, IsCopy)); } }