private void Window_KeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.F3) { txtSearch.Visibility = (txtSearch.Visibility == Visibility.Visible ? Visibility.Collapsed : Visibility.Visible); if (txtSearch.Visibility == System.Windows.Visibility.Visible) { txtSearch.Focus(); } } if (e.Key == Key.F5) { if (PoeSorter.SelectedTab != null && PoeSorter.SelectedTab.Items != null) { PoeSorter.SelectedTab.Items.ForEach(c => { if (PoeSorter.ItemCanvas.Children.Contains(c.Image)) { PoeSorter.ItemCanvas.Children.Remove(c.Image); } }); PoeSorter.SelectedTab.Items = null; PoeSorter.SetSelectedTab(PoeSorter.SelectedTab); // trigger download } } }
private void ddlSortMode_SelectionChanged(object sender, SelectionChangedEventArgs e) { PoeSorter.SelectSortingAlgoritm((SortingAlgorithm)ddlSortMode.SelectedItem); if (PoeSorter.SelectedSortingAlgorithm != null) { ddlSortOption.ItemsSource = PoeSorter.SelectedSortingAlgorithm.SortOption.Options; ddlSortOption.SelectedItem = PoeSorter.SelectedSortingAlgorithm.SortOption.SelectedOption; } }
public MainWindow() { InitializeComponent(); PoeSorter.Initialize(stashPanel, Dispatcher, ddlSortMode, ddlSortOption); txtSearch.Visibility = System.Windows.Visibility.Hidden; StashTabs.DisplayMemberPath = "Name"; ddlSortMode.DisplayMemberPath = "Name"; PopulateLeagueDDL(); PopulateSpeedSlider(); PopulateSortingDDL(); this.Activated += OnFocus; }
private void StartSorting_Click(object sender, RoutedEventArgs e) { PoeSorter.StartSorting(); }
private void StashTabs_SelectionChanged(object sender, SelectionChangedEventArgs e) { PoeSorter.SetSelectedTab((Tab)StashTabs.SelectedItem); }
private void ddlLeague_SelectionChanged(object sender, SelectionChangedEventArgs e) { PoeSorter.ChangeLeague((League)ddlLeague.SelectedItem); StashTabs.ItemsSource = PoeSorter.SelectedLeague.Tabs; StashTabs.SelectedItem = PoeSorter.SelectedLeague.Tabs.FirstOrDefault(); }
private void OnFocus(object sender, EventArgs e) { PoeSorter.ReloadAlgorithms(); }
private void ReloadAlgorithms(object sender, RoutedEventArgs e) { PoeSorter.ReloadAlgorithms(); }
private void ddlSortOption_SelectionChanged(object sender, SelectionChangedEventArgs e) { PoeSorter.SelectSortOption((string)(ddlSortOption.SelectedItem)); }