public void InitializeazFormulare() { AdminFormularService courses = new AdminFormularService(); var formulars = courses.GetFormulars(); foreach (var formular in formulars) { var student = courses.GetStudent(formular.studentID); InfoFrame card = new InfoFrame(formular, student); //do not forget FormulareExploreCount++; if (FormulareExploreCount % 3 == 0) { FormulareGrid.Height = 500 * (FormulareExploreCount / 3) + 200; } else { FormulareGrid.Height = 300 * (FormulareExploreCount / 3 + 1) + 100; } card.formular = formular; FormulareGrid.Children.Add(card); card.MouseDoubleClick += new MouseButtonEventHandler(DoubleClickExploreCourseHandler); card.MenuItemEdit.Click += new RoutedEventHandler((sender, e) => EditCourseHandler(sender, e, card)); } }
private async void Load(User model) { if (model.Description != null) { ProfileLayout.Children.Add(InfoFrame.Create("info.png", "Descripció", model.Description)); } if (model.RepositoryUrl != null) { ProfileLayout.Children.Add(InfoFrame.Create("repo.png", "Repositori", model.RepositoryUrl)); } if (model.WebsiteUrl != null) { ProfileLayout.Children.Add(InfoFrame.Create("web.png", "Pàgina web", model.WebsiteUrl)); } if (model.FacebookUrl != null) { ProfileLayout.Children.Add(InfoFrame.Create("facebook.png", "Facebook", model.FacebookUrl)); } if (model.TwitterUrl != null) { ProfileLayout.Children.Add(InfoFrame.Create("twitter.png", "twitter", model.TwitterUrl)); } }
private void Info_MouseLeave(object sender, MouseEventArgs e) { if (Info.IsSelected) { InfoFrame.Navigate(InfoPage); } }
public void EditCourseHandler(object sender, RoutedEventArgs e, InfoFrame card) { EditFormUI editCourseWindow = new EditFormUI(card.formular); editCourseWindow.ShowDialog(); card.formular = editCourseWindow.Formular; UpdateEditedCard(card); }
public MainWindow() { InitializeComponent(); FillCardGrid(); InfoFrame.Navigate(InfoPage); AutomaticIncomeSchedule(); ShowCards(); }
private async void Load() { Title = Model.Title; await ApiService.Projects.AddView(Model.Id); if (Model.Forum != null) { Frame forumframe = InfoFrame.Create("book_b.png", "Fòrum", Model.Forum.Title); TapGestureRecognizer forumTap = new TapGestureRecognizer(); forumTap.Tapped += ForumTap_Tapped; forumframe.GestureRecognizers.Add(forumTap); ProjectStackLayout.Children.Add(forumframe); } if (Model.TotalMoney > 0) { string money = Model.TotalMoney + " €"; ProjectStackLayout.Children.Add(InfoFrame.Create("loading.png", "Progrès", money)); } if (Model.WebsiteUrl != null) { ProjectStackLayout.Children.Add(InfoFrame.Create("web.png", "Pàgina web", Model.WebsiteUrl)); } if (Model.RepositoryUrl != null) { ProjectStackLayout.Children.Add(InfoFrame.Create("repo.png", "Repositori", Model.RepositoryUrl)); } if (Model.Owner.Id == Settings.GetLoggedUser().Id) { ToolbarItem edit = new ToolbarItem { Icon = "edit_w.png", Text = "Editar" }; edit.Clicked += Edit_Clicked; ToolbarItem delete = new ToolbarItem { Icon = "cross_w.png", Text = "Eliminar" }; delete.Clicked += Delete_Clicked; ToolbarItems.Add(edit); ToolbarItems.Add(delete); } else if (Subscribed) { GenerateContributions(); } }
public async Task SendInfoFrame(string receiverAddress, int timeOut) { InfoFrame infoFrame = new InfoFrame(GetNextFrameId(), _address, receiverAddress, timeOut); try { await SubmitLoRaFrameAsync(infoFrame, timeOut).ConfigureAwait(false); } catch (AckNotReceivedTimeoutException) { //TimeOut are handle via Event } }
private void MagazineComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (MagazineComboBox.SelectedIndex == 0) { InfoFrame.Navigate(new SaleInfoPage()); } else if (MagazineComboBox.SelectedIndex == 1) { InfoFrame.Navigate(new DeliveryInfoPage()); } else if (MagazineComboBox.SelectedIndex == 2) { InfoFrame.Navigate(new ShiftInfoPage()); } }
/// <summary> /// Handles a click on the items in the navigation view and navigates correspondingly. /// </summary> /// <param name="sender">The sender.</param> /// <param name="args">The arguments of the invoked item.</param> private void MenuItem_Clicked(object sender, TappedRoutedEventArgs args) { var menuItem = sender as MenuMainItem; var menuText = menuItem.FindChildByName("menuText") as TextBlock; switch (menuText.Text) { case "Home": InfoFrame.Navigate(typeof(HomeMenu)); break; case "Match": InfoFrame.Navigate(typeof(MatchMenu)); break; case "Cricket": InfoFrame.Navigate(typeof(HomeMenu)); break; case "History": InfoFrame.Navigate(typeof(HomeMenu)); break; case "Profiles": InfoFrame.Navigate(typeof(HomeMenu)); break; case "Purchases": InfoFrame.Navigate(typeof(HomeMenu)); break; case "About": InfoFrame.Navigate(typeof(HomeMenu)); break; default: return; } }
public void UpdateEditedCard(InfoFrame card) { //Conversie valoare tip int din category box in String, nu am solutie card.CourseCategory.Text = card.formular.StareFormular.ToString(); }
/// <summary> /// Initializing the mainpage. By default show the home menu. /// </summary> public MainPage() { this.InitializeComponent(); InfoFrame.Navigate(typeof(HomeMenu)); }