public void Create(SwipeMenu menu) { // create "open" item SwipeMenuItem openItem = new SwipeMenuItem( this); // set item background openItem.Background = new ColorDrawable(Android.Graphics.Color.Green); // set item width openItem.Width = dp2px(90); // set item title openItem.Title = "Open"; // set item title fontsize openItem.TitleSize = 18; // set item title font color openItem.TitleColor = Color.White.ToArgb(); // add to menu menu.AddMenuItem(openItem); // create "delete" item SwipeMenuItem deleteItem = new SwipeMenuItem( this); // set item background deleteItem.Background = new ColorDrawable(); // set item width deleteItem.Width = dp2px(90); // set a icon deleteItem.Icon = new ColorDrawable(Android.Graphics.Color.Red); // add to menu menu.AddMenuItem(deleteItem); }
protected override void OnNavigatedTo(NavigationEventArgs e) { PageCanvas = new SwipeMenu(this, PageCanvas, LayoutRoot, MoveAnimation, LeftMenu); Container.Height = App.Current.RootVisual.RenderSize.Height; DateTime currentDate = DateTime.Now; if (DateTime.Now.DayOfWeek == DayOfWeek.Saturday) { currentDate = currentDate.AddDays(2); } else if (DateTime.Now.DayOfWeek == DayOfWeek.Sunday) { currentDate = currentDate.AddDays(1); } if (Database.FoodLists == null || Database.FoodLists.SingleOrDefault(x => x.Date.ToShortDateString() == currentDate.ToShortDateString()) == null) { if (Database.FoodLists == null) { if (Microsoft.Phone.Net.NetworkInformation.NetworkInterface.NetworkInterfaceType == Microsoft.Phone.Net.NetworkInformation.NetworkInterfaceType.None) { MessageBox.Show("İnternet bağlantınızı kontrol ediniz!"); } } else { FoodLists.ItemsSource = Database.FoodLists; FoodLists.SelectedIndex = Database.FoodLists.Count - 1; } if (Microsoft.Phone.Net.NetworkInformation.NetworkInterface.NetworkInterfaceType != Microsoft.Phone.Net.NetworkInformation.NetworkInterfaceType.None) { try { ProgressIndicator indicator = new ProgressIndicator(); indicator.IsIndeterminate = true; indicator.IsVisible = true; indicator.Text = "Yemekler güncelleniyor.."; ObisisMobileServiceClient client = new ObisisMobileServiceClient(); client.GetFoodListsAsync(); client.GetFoodListsCompleted += client_GetFoodListsCompleted; SystemTray.SetProgressIndicator(this, indicator); } catch (Exception) { if (SystemTray.ProgressIndicator != null) { SystemTray.ProgressIndicator.IsVisible = false; } } } else if (Database.FoodLists != null) { FoodLists.ItemsSource = Database.FoodLists; FoodLists.SelectedIndex = Database.FoodLists.Count - 1; } } else { FoodLists.ItemsSource = Database.FoodLists; FoodLists.SelectedIndex = Database.FoodLists.FindIndex(x => x.Date.ToShortDateString() == currentDate.ToShortDateString()); } base.OnNavigatedTo(e); }
public void Create(SwipeMenu menu) { menu.AddMenuItems(itemsFunc.Invoke(menu)); }
public bool OnMenuItemClick(int position, SwipeMenu menu, int index) { Toast.MakeText(Activity.BaseContext, "The Position is " + position + " And Index Is" + index, ToastLength.Short).Show(); return(true); }
private void ListView_MenuItemClick(int position, SwipeMenu menu, int index) { }
public bool OnMenuItemClick(int position, SwipeMenu menu, int index) { throw new System.NotImplementedException(); }
protected override void OnNavigatedTo(NavigationEventArgs e) { PageCanvas = new SwipeMenu(this, PageCanvas, LayoutRoot, MoveAnimation, LeftMenu); Container.Height = App.Current.RootVisual.RenderSize.Height; base.OnNavigatedTo(e); }
protected override void OnNavigatedTo(NavigationEventArgs e) { PageCanvas = new SwipeMenu(this, PageCanvas, LayoutRoot, MoveAnimation, LeftMenu); Container.Height = App.Current.RootVisual.RenderSize.Height; ApplicationBar.MatchOverriddenTheme(); if (Database.Student == null) { MessageBox.Show("Giriş yapmanız gerekiyor.."); NavigationService.Navigate(new Uri("/LoginPage.xaml", UriKind.Relative)); } else { MondayPlan.ItemsSource = Database.LessonPlan.Where(x => x.Day == DayOfWeek.Monday).OrderBy(x => x.BeginDateTime.Hour).ToList(); TuesdayPlan.ItemsSource = Database.LessonPlan.Where(x => x.Day == DayOfWeek.Tuesday).OrderBy(x => x.BeginDateTime.Hour).ToList(); WednesdayPlan.ItemsSource = Database.LessonPlan.Where(x => x.Day == DayOfWeek.Wednesday).OrderBy(x => x.BeginDateTime.Hour).ToList(); ThursdayPlan.ItemsSource = Database.LessonPlan.Where(x => x.Day == DayOfWeek.Thursday).OrderBy(x => x.BeginDateTime.Hour).ToList(); FridayPlan.ItemsSource = Database.LessonPlan.Where(x => x.Day == DayOfWeek.Friday).OrderBy(x => x.BeginDateTime.Hour).ToList(); if (MondayPlan.ItemsSource.Count == 0) { MondayPlan.Visibility = Visibility.Collapsed; MondayEmptyMessage.Visibility = Visibility.Visible; } if (TuesdayPlan.ItemsSource.Count == 0) { TuesdayPlan.Visibility = Visibility.Collapsed; TuesdayEmptyMessage.Visibility = Visibility.Visible; } if (WednesdayPlan.ItemsSource.Count == 0) { WednesdayPlan.Visibility = Visibility.Collapsed; WednesdayEmptyMessage.Visibility = Visibility.Visible; } if (ThursdayPlan.ItemsSource.Count == 0) { ThursdayPlan.Visibility = Visibility.Collapsed; ThursdayEmptyMessage.Visibility = Visibility.Visible; } if (FridayPlan.ItemsSource.Count == 0) { FridayPlan.Visibility = Visibility.Collapsed; FridayEmptyMessage.Visibility = Visibility.Visible; } if (NavigationContext.QueryString.ContainsKey("index")) { LessonPlan.SelectedIndex = Convert.ToInt32(NavigationContext.QueryString["index"].ToString()); } else { DateTime currentDate = DateTime.Now; switch (DateTime.Now.DayOfWeek) { case DayOfWeek.Monday: LessonPlan.SelectedIndex = 0; break; case DayOfWeek.Tuesday: LessonPlan.SelectedIndex = 1; break; case DayOfWeek.Wednesday: LessonPlan.SelectedIndex = 2; break; case DayOfWeek.Thursday: LessonPlan.SelectedIndex = 3; break; case DayOfWeek.Friday: LessonPlan.SelectedIndex = 4; break; case DayOfWeek.Saturday: LessonPlan.SelectedIndex = 0; break; case DayOfWeek.Sunday: LessonPlan.SelectedIndex = 0; break; } } } base.OnNavigatedTo(e); }