Button createButton(string text, string commandProperty) { var button = new Button { Text = text, HeightRequest = _buttonHeight, Style = AppStyles.GetButtonStyle(), TextColor = Color.FromHex(Theme.Current.AboutButtonTextColor), VerticalOptions = LayoutOptions.Start, BackgroundColor = Color.FromHex(Theme.Current.AboutButtonBackgroundColor) }; button.SetBinding(Button.CommandProperty, commandProperty); return(button); }
Button saveMarksButton() { var saveButton = new Button() { FontAttributes = FontAttributes.Bold, Text = CrossLocalization.Translate("save_marks"), TextColor = Color.FromHex(Theme.Current.LoginButtonTextColor), BackgroundColor = Color.FromHex(Theme.Current.LoginButtonBackgroundColor), HeightRequest = _controlHeight, Style = AppStyles.GetButtonStyle(bold: true) }; saveButton.SetBinding(Button.CommandProperty, "SaveMarksCommand"); return(saveButton); }
Button createLoginButton() { var loginButton = new Button { Text = CrossLocalization.Translate("login_text"), FontAttributes = FontAttributes.Bold, TextColor = Color.FromHex(Theme.Current.LoginButtonTextColor), BackgroundColor = Color.FromHex(Theme.Current.LoginButtonBackgroundColor), Margin = _baseSpacing, HeightRequest = _controlHeight, Style = AppStyles.GetButtonStyle(bold: true) }; loginButton.SetBinding(Button.CommandProperty, "LoginCommand"); return(loginButton); }
Button createButton(string text, string commandString) { var button = new Button { HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.CenterAndExpand, HeightRequest = _buttonHeight, CornerRadius = (int)_buttonHeight / 2, BackgroundColor = Color.FromHex(Theme.Current.AppStatusBarBackgroundColor), TextColor = Color.FromHex(Theme.Current.TestPassingButtonTextColor), Style = AppStyles.GetButtonStyle(), Text = text }; button.SetBinding(Button.CommandProperty, commandString); return(button); }
Button createBackButton() { var backButton = new Button { HorizontalOptions = LayoutOptions.Fill, VerticalOptions = LayoutOptions.EndAndExpand, CornerRadius = (int)_buttonHeight / 2, HeightRequest = _buttonHeight, Margin = _backButtonMargin, TextColor = Color.FromHex(Theme.Current.EemcBackButtonTextColor), BackgroundColor = Color.FromHex(Theme.Current.EemcBackButtonColor), Text = CrossLocalization.Translate("eemc_back_text"), Style = AppStyles.GetButtonStyle() }; backButton.SetBinding(Button.CommandProperty, "BackCommand"); backButton.SetBinding(IsVisibleProperty, "IsBackActionPossible"); return(backButton); }
Button createParentalButton() { var parentalButton = new Button { Text = CrossLocalization.Translate("parental_login"), FontAttributes = FontAttributes.None, TextTransform = TextTransform.None, TextColor = Color.White, BackgroundColor = Color.Transparent, BorderColor = Color.White, BorderWidth = 1, Margin = _baseSpacing, HeightRequest = _controlHeight, Style = AppStyles.GetButtonStyle(bold: true) }; parentalButton.SetBinding(Button.CommandProperty, "ParentalCommand"); return(parentalButton); }
Button createAddMarksButton() { if (pageInd == 1 || pageInd == 2 || pageInd == 3) { TitleOfButton = CrossLocalization.Translate("set_visiting"); } else { TitleOfButton = CrossLocalization.Translate("set_marks"); } var addMarks = new Button { Text = TitleOfButton, FontAttributes = FontAttributes.Bold, TextColor = Color.FromHex(Theme.Current.LoginButtonTextColor), BackgroundColor = Color.FromHex(Theme.Current.LoginButtonBackgroundColor), Style = AppStyles.GetButtonStyle(bold: true) }; addMarks.SetBinding(Button.CommandProperty, "AddMarksCommand"); return(addMarks); }
public SaveSingleStudentMarkPageView(string title, string name, LabsVisitingList marks, TakedLabs prOrLabStat, int subGruop) { _title = title; if (title == CrossLocalization.Translate("practice_mark")) { foreach (var pract in prOrLabStat.Practicals) { NameOfLabOrPractice.Add(pract.ShortName); } BindingContext = new SaveSingleStudentMarkPageViewModel(new PlatformServices(), NameOfLabOrPractice.FirstOrDefault(), marks, prOrLabStat, title, name, subGruop); } else if (title == CrossLocalization.Translate("stats_page_labs_rating")) { foreach (var lab in prOrLabStat.Labs) { if (lab.SubGroup == subGruop) { NameOfLabOrPractice.Add(lab.ShortName); } } BindingContext = new SaveSingleStudentMarkPageViewModel(new PlatformServices(), NameOfLabOrPractice.FirstOrDefault(), marks, prOrLabStat, title, name, subGruop); } BackgroundColor = Color.FromHex(Theme.Current.AppBackgroundColor); Padding = _padding; NavigationPage.SetHasNavigationBar(this, false); var entryStyle = getEntryStyle(); var inicials = new Label { VerticalOptions = LayoutOptions.CenterAndExpand, TextColor = Color.FromHex(Theme.Current.StatisticsDetailsTitleColor), Style = AppStyles.GetLabelStyle(), Text = name, }; var nameOfPrOrLb = new Picker { BackgroundColor = Color.White, HeightRequest = 50, ItemsSource = NameOfLabOrPractice, HorizontalTextAlignment = TextAlignment.Center, }; nameOfPrOrLb.SetBinding(Picker.SelectedItemProperty, "SelectedShortName"); var markLabel = new Label { VerticalOptions = LayoutOptions.CenterAndExpand, TextColor = Color.FromHex(Theme.Current.StatisticsDetailsTitleColor), Style = AppStyles.GetLabelStyle(), Text = CrossLocalization.Translate("mark"), }; var dateLabel = new Label { VerticalOptions = LayoutOptions.CenterAndExpand, TextColor = Color.FromHex(Theme.Current.StatisticsDetailsTitleColor), Style = AppStyles.GetLabelStyle(), Text = CrossLocalization.Translate("date"), }; var commentLabel = new Label { VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand, TextColor = Color.FromHex(Theme.Current.StatisticsDetailsTitleColor), Style = AppStyles.GetLabelStyle(), Text = CrossLocalization.Translate("comment"), }; var showCommentLabel = new Label { VerticalOptions = LayoutOptions.CenterAndExpand, TextColor = Color.FromHex(Theme.Current.StatisticsDetailsTitleColor), Style = AppStyles.GetLabelStyle(), HeightRequest = 60, Text = CrossLocalization.Translate("show_for_student"), }; var showComment = new Switch { IsToggled = false, }; showComment.SetBinding(Switch.IsToggledProperty, "ShowForStud"); var markPicker = new Picker { BackgroundColor = Color.White, HeightRequest = 50, ItemsSource = Marks, HorizontalTextAlignment = TextAlignment.Center, }; markPicker.SetBinding(Picker.SelectedItemProperty, "Mark"); var datePicker = new Entry { Style = entryStyle, ReturnType = ReturnType.Done, Text = DateTime.Today.ToString("dd.MM.yyyy"), TextColor = Color.Black, IsReadOnly = true, }; var commentEntry = new Entry { Style = entryStyle, ReturnType = ReturnType.Done, }; commentEntry.SetBinding(Entry.TextProperty, "Comment"); var gridLayout = new Grid { BackgroundColor = Color.FromHex(Theme.Current.BaseBlockColor), Padding = _gridPadding, VerticalOptions = LayoutOptions.Start, }; var saveBut = new Button { FontAttributes = FontAttributes.Bold, Text = CrossLocalization.Translate("save_marks"), TextColor = Color.FromHex(Theme.Current.LoginButtonTextColor), BackgroundColor = Color.FromHex(Theme.Current.LoginButtonBackgroundColor), HeightRequest = _controlHeight, Style = AppStyles.GetButtonStyle(bold: true) }; saveBut.SetBinding(Button.CommandProperty, "SaveMarksButton"); gridLayout.Children.Add(inicials, 0, 0); gridLayout.Children.Add(nameOfPrOrLb, 0, 1); gridLayout.Children.Add(markLabel, 0, 2); gridLayout.Children.Add(markPicker, 2, 2); gridLayout.Children.Add(dateLabel, 0, 3); gridLayout.Children.Add(datePicker, 2, 3); gridLayout.Children.Add(commentLabel, 0, 4); gridLayout.Children.Add(commentEntry, 2, 4); gridLayout.Children.Add(showCommentLabel, 0, 5); gridLayout.Children.Add(showComment, 2, 5); gridLayout.Children.Add(saveBut, 0, 6); Grid.SetColumnSpan(inicials, 3); Grid.SetColumnSpan(showCommentLabel, 2); Grid.SetColumnSpan(commentLabel, 2); Grid.SetColumnSpan(markLabel, 2); Grid.SetColumnSpan(saveBut, 3); Grid.SetColumnSpan(nameOfPrOrLb, 3); Content = gridLayout; }