async void PinTile() { var item = tileSlider; TileManager.SaveAndPin(tile, tileSmall, self.ID); }
void MainPage_Loaded(object sender, RoutedEventArgs e) { search.KeyDown += (a, b) => { resultItems.Clear(); foreach (ProgressItem item in Core.items) { if (item.Name.Contains(search.Text) || item.Units.Contains(search.Text.ToLower()) || item.Tags.Contains(search.Text.ToLower()) || search.Text == "") { resultItems.Add(item); } } }; tagChooser.ItemsSource = tags; firstTileChoice.ItemsSource = Core.items; secondTileChoice.ItemsSource = Core.items; tagChooser.ItemsPicked += (a, b) => { if (tagChooser.SelectedValue.ToString() == "All") { list.DataContext = Core.items; resultItems.Clear(); } else { resultItems.Clear(); list.DataContext = resultItems; foreach (ProgressItem item in Core.items) { if (item.Tags.Replace(" ", "").ToLower().Contains(tagChooser.SelectedValue.ToString())) { resultItems.Add(item); } } } }; tags.Clear(); tags.Add("All"); foreach (ProgressItem item in Core.items) { if (item.Tags == null) { break; } foreach (String tag in item.Tags.Split(',')) { if (!tags.Contains(tag.Replace(" ", "").ToLower())) { tags.Add(tag.Replace(" ", "").ToLower()); } } } pinGroupBtn.IsEnabled = false; firstTileChoice.SelectionChanged += (a, b) => { largeTileFirst.DataContext = firstTileChoice.SelectedValue; smallTileFirst.DataContext = firstTileChoice.SelectedValue; if (firstTileChoice.SelectedValue != null && secondTileChoice.SelectedValue != null) { pinGroupBtn.IsEnabled = true; } }; secondTileChoice.SelectionChanged += (a, b) => { largeTileSecond.DataContext = secondTileChoice.SelectedValue; smallTileSecond.DataContext = secondTileChoice.SelectedValue; if (firstTileChoice.SelectedValue != null && secondTileChoice.SelectedValue != null) { pinGroupBtn.IsEnabled = true; } }; pinGroupBtn.Tapped += (a, b) => { TileManager.SaveAndPin(tile, tileSmall, (firstTileChoice.SelectedValue as ProgressItem).ID.Substring(0, 5) + (secondTileChoice.SelectedValue as ProgressItem).ID.Substring(0, 5)); }; }
private void AppBarButton_Click_2(object sender, RoutedEventArgs e) { TileManager.SaveAndPin(tile, tileSmall, (detailsHub.DataContext as ProgressItem).ID); }