public FeedFilterPopup(FilterSelection filterSelection) { InitializeComponent(); NotFireChangeEvent = true; ConfigureFilter(filterSelection); NotFireChangeEvent = false; }
public ItemsViewModel(FilterSelection filterSelection) { Title = "Jogos filtrados"; _filterSelection = filterSelection; Items = new ObservableCollection <BoardGame>(); LoadItemsCommand = new Command(async() => await ExecuteLoadItemsCommand()); }
public override void DisplayContent(object data) { base.DisplayContent(data); ToolbarItems.Clear(); ToolbarItems.Add(new ToolbarItem("Filtres", null, new Action(async delegate { FilterSelection page = new FilterSelection(this) { BindingContext = Filters }; await Navigation.PushModalAsync(new NavigationPage(page), true); DisplayContent(data); }))); List <Calendar> calendar = (List <Calendar>)data; EventSorting sorted = new EventSorting(Filters, calendar); ListView listView = new ListView { IsPullToRefreshEnabled = true, ItemTemplate = new DataTemplate(typeof(TextCell)) { Bindings = { { TextCell.TextProperty, new Binding("ActiTitle") }, { TextCell.DetailProperty, new Binding("Start") { StringFormat = "{0:dd/MM/yyyy - HH:mm}" } } } }, GroupDisplayBinding = new Binding("GroupTitle"), Header = new HeaderPlaning(calendar), IsGroupingEnabled = true, ItemsSource = sorted.GetGroupedList() }; listView.Refreshing += async(sender, e) => { await RefreshData(true); listView.IsRefreshing = false; }; listView.ItemSelected += async(sender, e) => { if (e.SelectedItem != null) { await Navigation.PushAsync(new Activity ((Calendar)e.SelectedItem)); ((ListView)sender).SelectedItem = null; } }; Content = new StackLayout { VerticalOptions = LayoutOptions.FillAndExpand, Children = { listView } }; }
public async void OnNextPageClick(object sender, EventArgs e) { if (numberOfPlayer.Text != null) { FilterSelection filterSelection = new FilterSelection(); filterSelection.NumberOfPlayers = int.Parse(numberOfPlayer.Text); await Navigation.PushAsync(new PlayingTimePage(filterSelection)); } else { await DisplayAlert("Alerta", "Informe o número de jogadores", "Cancelar"); } }
public List <ToDoItem> FilterItemsByStatus(FilterSelection filter, List <ToDoItem> items) { List <ToDoItem> filteredList = items.ToList(); switch (filter) { case FilterSelection.Completed: filterSelection = FilterSelection.Completed; foreach (ToDoItem item in items) { if (item.itemStatus != Status.Completed.ToString()) { filteredList.Remove(item); } } break; case FilterSelection.NotCompleted: filterSelection = FilterSelection.NotCompleted; foreach (ToDoItem item in items) { if (item.itemStatus != Status.NotCompleted.ToString()) { filteredList.Remove(item); } } break; case FilterSelection.Expired: filterSelection = FilterSelection.Expired; foreach (ToDoItem item in items) { if (item.itemStatus != Status.Expired.ToString()) { filteredList.Remove(item); } } break; case FilterSelection.Default: filterSelection = FilterSelection.Default; filteredList = GetItems(selectedList); orderedItemsList.Clear(); break; default: break; } return(filteredList); }
public IEnumerable <BoardGame> GetBoardGamesDatabase(FilterSelection filter) { int maxPlayingTime = GetTimeInMinutes(filter.PlayingTime); bool orderMorePlayed = NumberOfPlaysEnum.MorePlayed.Equals(filter.NumberOfPlays); var data = _repository.GetAll() .Where(g => g.Owned && (filter.NumberOfPlayers >= g.MinPlayers && filter.NumberOfPlayers <= g.MaxPlayers) && g.PlayingTime <= maxPlayingTime); return(orderMorePlayed ? data.OrderByDescending(g => g.NumPlays) : data.OrderBy(g => g.NumPlays)); }
public void ConfigureFilter(FilterSelection filterSelection) { //date if (filterSelection.FilterDate == "All") { RadDateAll.IsChecked = true; } else if (filterSelection.FilterDate == "Last Month") { RadDateLastMonth.IsChecked = true; } else if (filterSelection.FilterDate == "Last Week") { RadDateLastWeek.IsChecked = true; } else if (filterSelection.FilterDate == "Today") { RadDateToday.IsChecked = true; } else if (filterSelection.FilterDate == "Yesterday") { RadDateYesterday.IsChecked = true; } //type if (filterSelection.FilteType == "All") { RadTypeAll.IsChecked = true; } else if (filterSelection.FilteType == "Event") { RadTypeEvent.IsChecked = true; } else if (filterSelection.FilteType == "Announcement") { RadTypeAnnouncement.IsChecked = true; } else if (filterSelection.FilteType == "Daily Chart") { RadTypeDailyChart.IsChecked = true; } else if (filterSelection.FilteType == "Wellness") { RadTypeWellness.IsChecked = true; } }
private async void FilterPopupRequest_Clicked(object sender, EventArgs e) { FilterSelection selectedOptions = new FilterSelection(); if (filterSelection != null) { selectedOptions = filterSelection; } else { selectedOptions = new FilterSelection { FilterDate = "All", FilteType = "All" } }; await PopupNavigation.Instance.PushAsync(new FeedFilterPopup(selectedOptions)); }
void FeedFilterDateCheckedChanged(object sender, CheckedChangedEventArgs e) { RadioButton button = sender as RadioButton; string typefilter = string.Empty; if (button.IsChecked && NotFireChangeEvent == false) { typefilter = GetFilterType(); FilterSelection filterSelection = new FilterSelection { FilterDate = button.Content.ToString(), FilteType = typefilter }; MessagingCenter.Send <DashboardView, FilterSelection>(new DashboardView(isNeedToFilterSubsciberRegistered: false), MessageCenterAuthenticator.FeedFilter.ToString(), filterSelection); } }
private static void AddRulesToRepository(Repository repository, string instance, ServerInfo serverInfo) { try { var filter = new DataCollectionFilter(instance, "Default rule", "Rule created when the server was imported"); var filterSelector = new FilterSelection(); filterSelector.Initialize(filter, serverInfo); filterSelector.GetFilter(out filter); filter.CreateFilter(repository.ConnectionString, serverInfo.connectionName); } catch (Exception ex) { logX.loggerX.Error(ex.Message); throw; } }
public PlayingTimePage(FilterSelection filterSelection) { InitializeComponent(); _filterSelection = filterSelection; }
public NumberOfPlaysPage(FilterSelection filterSelection) { InitializeComponent(); _filterSelection = filterSelection; }
public Process() { this.orderedItemsList = new List <ToDoItem>(); this.filterSelection = FilterSelection.Default; }
public IEnumerable <BoardGame> GetAllBoardGamesOffline(FilterSelection filter) { return(_boardGameService.GetBoardGamesDatabase(filter)); }
private void SetPushFilter(FilterSelection filter) { CurrentPushFilterValue = filter.Value; CallEvent(); }
public ItemsPage(FilterSelection filterSelection) { InitializeComponent(); BindingContext = viewModel = new ItemsViewModel(filterSelection); }