public AnalyticsPage() { this.Title = "App Analytics"; var lst = new CoreListView() { ItemTemplate = new DataTemplate(typeof(AnalyticsPageCell)) }; lst.SetBinding(CoreListView.ItemsSourceProperty, "AnalyticLogs"); var btnClear = new CoreButton() { Text = "Clear", Style = CoreStyles.LightOrange, AutomationId = "btnClear" }; btnClear.SetBinding(CoreButton.CommandProperty, "ClearAnalyticEntries"); Content = new CompressedStackLayout() { Padding = 20, Spacing = 10, Children = { lst, btnClear } }; }
public AuthenticationMain() { this.Title = "Authentications"; var googleAuth = new CoreButton() { Style = CoreStyles.LightOrange, Text = "Google Authentication", AutomationId = "googleAuth" }; googleAuth.SetBinding(CoreButton.CommandProperty, "GoogleAuth"); var facebookAuth = new CoreButton() { Style = CoreStyles.LightOrange, Text = "FaceBook Authentication", AutomationId = "facebookAuth" }; facebookAuth.SetBinding(CoreButton.CommandProperty, "FaceBookAuth"); var msAuth = new CoreButton() { Style = CoreStyles.LightOrange, Text = "Microsoft Authentication", AutomationId = "msAuth" }; msAuth.SetBinding(CoreButton.CommandProperty, "MicrosoftAuth"); var lblToken = new Label(); lblToken.SetBinding(Label.TextProperty, "AccessToken"); var stack = new StackContainer(true) { Padding = 20, Spacing = 10, Children = { googleAuth, facebookAuth, msAuth, lblToken, new StackLayout() { HeightRequest = 5 } } }; Content = new ScrollView() { Content = stack }; }
public SomePage() { this.Title = "Some Page"; var header = new Label() { Text = "Enter Text:", Margin = new Thickness(5, 5, 5, 0) }; var entry = new CoreMaskedEntry() { Margin = 5 }; entry.SetBinding(CoreMaskedEntry.TextProperty, "SomeText"); var lbl = new Label() { Margin = 5 }; lbl.SetBinding(Label.TextProperty, new Binding(path: "SomeText", converter: CoreSettings.UpperText)); var btn = new CoreButton() { Text = "Some Action", Style = CoreStyles.LightOrange, Margin = 5 }; btn.SetBinding(Button.CommandProperty, "SomeAction"); var lstCount = new Label() { Margin = 5 }; lstCount.SetBinding(Label.TextProperty, new Binding(path: "TotalItems", stringFormat: "Total count is {0}")); Content = new StackLayout() { Padding = 20, Children = { header, entry, lbl, btn, lstCount } }; }
public ErrorsPage() { this.Title = "App Errors"; var lst = new CoreListView() { ItemTemplate = new DataTemplate(typeof(ErrorsPageCell)), ItemClickCommand = new Command((obj) => { var log = (ErrorLog)obj; VM.DialogPrompt.ShowMessage(new Prompt() { Title = "Error", Message = log.ErrorMessage }); }) }; lst.SetBinding(CoreListView.ItemsSourceProperty, "ErrorLogs"); var btnAdd = new CoreButton() { Text = "Add", Style = CoreStyles.LightOrange, AutomationId = "btnAdd", }; btnAdd.SetBinding(CoreButton.CommandProperty, "CreateErrorEntry"); var btnClear = new CoreButton() { Text = "Clear", Style = CoreStyles.LightOrange, AutomationId = "btnClear" }; btnClear.SetBinding(CoreButton.CommandProperty, "ClearErrorEntries"); Content = new StackContainer(true) { Padding = 20, Spacing = 10, Children = { lst, btnAdd, btnClear } }; }
public LocalizationMain() { this.Title = "Localization"; var lblGreeting = new Label() { FontSize = 50, HorizontalTextAlignment = TextAlignment.Center, }; lblGreeting.SetBinding(Label.TextProperty, "GreetingText"); var lblUserName = new Label(); lblUserName.SetBinding(Label.TextProperty, "UserNameText"); var txtUserName = new CoreMaskedEntry(); var lblPassword = new Label(); lblPassword.SetBinding(Label.TextProperty, "PasswordText"); var txtPassword = new CoreMaskedEntry() { IsPassword = true }; var btnLogin = new CoreButton() { Style = CoreStyles.LightOrange, AutomationId = "errors", }; btnLogin.SetBinding(CoreButton.TextProperty, "LoginText"); Content = new CoreStackLayout() { StartColor = Color.White, EndColor = Color.Black, Padding = 20, Spacing = 15, Children = { lblGreeting, lblUserName, txtUserName, lblPassword, txtPassword, btnLogin } }; }
public AddPerson() { this.Title = "Add Person"; var lblFirstName = new Label() { Text = "First Name:", Margin = new Thickness(5, 5, 5, 0) }; var txtFirstName = new CoreMaskedEntry() { Margin = 5 }; txtFirstName.SetBinding(CoreMaskedEntry.TextProperty, "FirstName"); var lblLastName = new Label() { Text = "Last Name", Margin = new Thickness(5, 5, 5, 0) }; var txtLastName = new CoreMaskedEntry() { Margin = 5 }; txtLastName.SetBinding(CoreMaskedEntry.TextProperty, "LastName"); var btnAddPerson = new CoreButton() { Text = "Add Person", Style = CoreStyles.LightOrange, Margin = 5 }; btnAddPerson.SetBinding(Button.CommandProperty, "AddPerson"); Content = new StackLayout() { Padding = 20, Children = { lblFirstName, txtFirstName, lblLastName, txtLastName, btnAddPerson } }; }
public CompressedGrid CreateDataTrigger() { var box = new BoxView() { HeightRequest = 28, WidthRequest = 28, BackgroundColor = Color.Crimson }; var fadeAnimation = new CoreTriggerAction() { Animation = new CoreFadeToAnimation() { Target = box, Duration = "300", Opacity = 0 } }; var trigger = new DataTrigger(typeof(Button)) { Binding = new Binding(path: "ClickCount", mode: BindingMode.TwoWay), Value = 3, EnterActions = { fadeAnimation } }; var btn = new CoreButton() { Text = "Data Trigger (3)", Style = CoreStyles.LightOrange, Triggers = { trigger } }; btn.SetBinding(CoreButton.CommandProperty, "ClickEvent"); var grid = new CompressedGrid(); grid.AddChild(box, 0, 0); grid.AddChild(btn, 0, 1); return(grid); }
public ProfilePage() { this.Title = "Profile"; var marginEdge = 20; var img = new CachedImage() { Source = "featherimage.png", Margin = 5 }; var txtTitle = new Label() { Text = "Update your profile to include your image on the left.", FontSize = 22, Margin = 5, TextColor = Color.DarkGray }; var topPanel = new StackLayout() { Margin = new Thickness(20, 25, 20, 25), Orientation = StackOrientation.Horizontal, Children = { img, txtTitle } }; var lblFName = new Label() { Text = "First Name", Style = CoreStyles.LabelHeader, }; var txtFName = new CoreUnderlineEntry() { Style = CoreStyles.TodoEntryStyle }; txtFName.SetBinding(CoreUnderlineEntry.TextProperty, "CurrentUser.FirstName"); var lblLName = new Label() { Text = "Last Name", Style = CoreStyles.LabelHeader, }; var txtLName = new CoreUnderlineEntry() { Style = CoreStyles.TodoEntryStyle }; txtLName.SetBinding(CoreUnderlineEntry.TextProperty, "CurrentUser.LastName"); var lblPassword = new Label() { Text = "Password", Style = CoreStyles.LabelHeader }; var txtPassword = new CoreUnderlineEntry() { Style = CoreStyles.TodoEntryStyle, IsPassword = true }; txtPassword.SetBinding(CoreUnderlineEntry.TextProperty, "Password"); var lblConfirmPassword = new Label() { Text = "Confirm Password", Style = CoreStyles.LabelHeader, }; var txtConfirmPassword = new CoreUnderlineEntry() { Style = CoreStyles.TodoEntryStyle }; txtConfirmPassword.SetBinding(CoreUnderlineEntry.TextProperty, "ConfirmPassword"); var btnSave = new CoreButton() { Text = "SAVE", Style = CoreStyles.LightOrangeButton, Margin = new Thickness(marginEdge, 10, marginEdge, 25), }; btnSave.SetBinding(CoreButton.CommandProperty, "SaveProfile"); var content = new StackLayout() { Children = { topPanel, lblFName, txtFName, lblLName, txtLName, lblPassword, txtPassword, lblConfirmPassword, txtConfirmPassword, btnSave } }; Content = new ScrollView { Content = content }; }
public ServicesMain() { this.Title = "Services"; var http = new CoreButton() { Text = "Http Services", Style = CoreStyles.LightOrange, AutomationId = "http", Command = new Command(async(obj) => { await Navigation.PushAsync(new HttpServicesPage()); }) }; var httpPost = new CoreButton() { Text = "Http Post", Style = CoreStyles.LightOrange, AutomationId = "httpPost", }; httpPost.SetBinding(CoreButton.CommandProperty, "HttpPost"); var httpDownload = new CoreButton() { Text = "Http Download", Style = CoreStyles.LightOrange, AutomationId = "httpDownload", }; httpDownload.SetBinding(CoreButton.CommandProperty, "LongDownload"); var sqlite = new CoreButton() { Text = "Sqlite", Style = CoreStyles.LightOrange, AutomationId = "sqlite", Command = new Command(async(obj) => { await Navigation.PushAsync(new SqlitePage()); }) }; var encrypt = new CoreButton() { Text = "Encryption", Style = CoreStyles.LightOrange, AutomationId = "encrypt", Command = new Command(async(obj) => { await Navigation.PushAsync(new EncryptionPage()); }) }; var analytics = new CoreButton() { Text = "Analytics", Style = CoreStyles.LightOrange, AutomationId = "analytics", Command = new Command(async(obj) => { await Navigation.PushAsync(new AnalyticsPage()); }) }; var errors = new CoreButton() { Text = "Errors", Style = CoreStyles.LightOrange, AutomationId = "errors", Command = new Command(async(obj) => { await Navigation.PushAsync(new ErrorsPage()); }) }; var timerSrv = new CoreButton() { Text = "Background Timer", Style = CoreStyles.LightOrange, AutomationId = "timerSrv", }; timerSrv.SetBinding(CoreButton.TextProperty, "BackgroundButtonTitle"); timerSrv.SetBinding(CoreButton.CommandProperty, "StartBackgrounding"); var stack = new CompressedStackLayout() { Padding = 20, Spacing = 10, Children = { http, httpPost, httpDownload, sqlite, encrypt, analytics, errors, timerSrv, new StackLayout() { HeightRequest = 5 } } }; Content = new ScrollView() { Content = stack }; }
public AddTodoPage() { this.Title = "Add Todo Item"; var marginEdge = 20; var img = new CachedImage() { Source = "featherimage.png", Margin = 5 }; var txtTitle = new Label() { Text = "Create a new item and specify the date for completion.", FontSize = 22, Margin = 5, TextColor = Color.DarkGray }; var topPanel = new StackLayout() { Margin = new Thickness(20, 25, 20, 25), Orientation = StackOrientation.Horizontal, Children = { img, txtTitle } }; var lblDescription = new Label() { Text = "Description", Style = CoreStyles.LabelHeader, }; var txtDescription = new CoreUnderlineEntry() { Style = CoreStyles.TodoEntryStyle }; txtDescription.SetBinding(CoreUnderlineEntry.TextProperty, "CurrentItem.Description"); var lblDueDate = new Label() { Text = "Due Date", Style = CoreStyles.LabelHeader, }; var pickerDueDate = new CoreDatePicker() { Style = CoreStyles.TodoPickerStyle }; pickerDueDate.SetBinding(CoreDatePicker.DateProperty, new Binding(path: "CurrentItem.CompleteByDate", mode: BindingMode.TwoWay, converter: AppConverters.DateLong)); var spacer = new StackLayout() { VerticalOptions = LayoutOptions.FillAndExpand }; var btnSave = new CoreButton() { Text = "SAVE", Style = CoreStyles.LightOrangeButton, Margin = new Thickness(marginEdge, 10, marginEdge, 25), }; btnSave.SetBinding(CoreButton.CommandProperty, "SaveCurrentItem"); Content = new StackLayout() { Children = { topPanel, lblDescription, txtDescription, lblDueDate, pickerDueDate, spacer, btnSave } }; }
public CommunicationPage() { this.Title = "Communication"; var lbl = new Label() { TextColor = Color.Gray, Text = "Phone Number", FontSize = 14, Margin = new Thickness(5, 5, 5, 1) }; phoneNum = new CoreMaskedEntry() { MaskPattern = "(###) ###-####", Margin = new Thickness(5, 1, 5, 1), Keyboard = Keyboard.Telephone, Placeholder = "(000) 000-0000", }; phoneNum.SetBinding(Entry.TextProperty, "CommunicationNumber"); var lblMsg = new Label() { TextColor = Color.Gray, Text = "Message", FontSize = 14, Margin = new Thickness(5, 5, 5, 1) }; message = new Entry() { Margin = new Thickness(5, 1, 5, 1), Placeholder = "Text", }; message.SetBinding(Entry.TextProperty, "CommunicationMessage"); var lblEmail = new Label() { TextColor = Color.Gray, Text = "Email Address", FontSize = 14, Margin = new Thickness(5, 5, 5, 1) }; emailAddr = new Entry() { Margin = new Thickness(5, 1, 5, 10), Keyboard = Keyboard.Email, Placeholder = "*****@*****.**", }; emailAddr.SetBinding(Entry.TextProperty, "CommunicationEmail"); btnSMS = new CoreButton() { Text = "Send SMS", Style = CoreStyles.LightOrange, Margin = 5, }; btnSMS.SetBinding(CoreButton.CommandProperty, "SendSMS"); btnEmail = new CoreButton() { Text = "Send Email", Style = CoreStyles.LightOrange, Margin = 5, }; btnEmail.SetBinding(CoreButton.CommandProperty, "SendEmail"); btnCall = new CoreButton() { Text = "Call", Style = CoreStyles.LightOrange, Margin = 5, }; btnCall.SetBinding(CoreButton.CommandProperty, "MakeCall"); btnCallEvent = new CoreButton() { Text = "Call With Event", Style = CoreStyles.LightOrange, Margin = 5, }; btnCallEvent.SetBinding(CoreButton.CommandProperty, "MakeCallEvent"); this.SetAutomationIds(); Content = new StackContainer(true) { Padding = 15, Children = { lbl, phoneNum, lblEmail, emailAddr, lblMsg, message, btnSMS, btnEmail, btnCall, btnCallEvent } }; }
public DependeciesMain() { this.Title = "Dependencies"; var dlg = new CoreButton() { Style = CoreStyles.LightOrange, Text = "Dialog", AutomationId = "dialogButton", Command = new Command(async() => { await Navigation.PushAsync(new DialogExample()); }) }; //dlg.SetBinding(Button.CommandProperty, "DialogClick"); var not = new CoreButton() { Style = CoreStyles.LightOrange, Text = "Notification", AutomationId = "notifyButton" }; not.SetBinding(Button.CommandProperty, "NotificationClick"); var overlay = new CoreButton() { Style = CoreStyles.LightOrange, Text = "Overlay", AutomationId = "overlayButton" }; overlay.SetBinding(Button.CommandProperty, "OverlayClick"); var blur = new CoreButton() { Style = CoreStyles.LightOrange, Text = "Create Blur", AutomationId = "blurButton" }; blur.SetBinding(Button.CommandProperty, "Blur"); var snack = new CoreButton() { Style = CoreStyles.LightOrange, Text = "SnackBar", AutomationId = "snack" }; snack.SetBinding(Button.CommandProperty, "ShowSnack"); var playSound = new CoreButton() { Style = CoreStyles.LightOrange, Text = "Play Sound", AutomationId = "playSound" }; playSound.SetBinding(Button.CommandProperty, "PlaySound"); var commTest = new CoreButton() { Style = CoreStyles.LightOrange, Text = "Communication Dependencies", AutomationId = "commTest" }; commTest.SetBinding(Button.CommandProperty, "CommTest"); var cal = new CoreButton() { Style = CoreStyles.LightOrange, Text = "Create Calendar Event", AutomationId = "calendarbutton" }; cal.SetBinding(Button.CommandProperty, "CreateCalendar"); var ctxMnu = new CoreButton() { Style = CoreStyles.LightOrange, Text = "Native Context Menu", AutomationId = "contextMenu" }; ctxMnu.SetBinding(Button.CommandProperty, "ContextMenu"); var pnRegister = new CoreButton() { Style = CoreStyles.LightOrange, AutomationId = "pnRegister" }; pnRegister.SetBinding(Button.TextProperty, "PushButtonLabel"); pnRegister.SetBinding(Button.CommandProperty, "PushRegister"); var btnNav = new CoreButton() { Text = "Navigation Example", Style = CoreStyles.LightOrange, AutomationId = "btnNav", Command = new Command((obj) => { Navigation.PushNonAwaited <Nav1>(); }) }; var stack = new CompressedStackLayout() { Padding = 20, Spacing = 10, Children = { dlg, not, overlay, blur, snack, playSound, commTest, ctxMnu, cal, pnRegister, btnNav, new StackLayout() { HeightRequest = 5 } } }; Content = new ScrollView() { Content = stack }; }
public BehaviorsMain() { this.Title = "Behaviors"; var explanation = new Label() { AutomationId = "explanation", Margin = new Thickness(5, 5, 5, 15), Text = "Enter and remove content in the fields below to see behaviors work. Enter the name 'Jack Sparrow' to see custom behavior." }; var lbl = new Label() { TextColor = Color.Gray, Text = "First Name", FontSize = 14, Margin = new Thickness(5, 5, 5, 1) }; var fNameEntry = new CoreUnderlineEntry() { AutomationId = "fNameEntry", Margin = new Thickness(5, 1, 5, 1), EntryColor = Color.DarkGray }; fNameEntry.SetBinding(Entry.TextProperty, "FirstName"); fNameEntry.Behaviors.Add(new RegExBehavior() { ErrorMessage = "Requred Field", RegexExp = @"^[\s\t\r\n]*\S+" }); var errorLabel = new Label() { FontSize = 14, TextColor = Color.Red, Margin = new Thickness(5, 1, 5, 1), AutomationId = "errorLabel" }; errorLabel.SetBinding(Label.TextProperty, new Binding( source: fNameEntry.Behaviors[0], path: "ErrorMessage", mode: BindingMode.OneWay)); errorLabel.SetBinding(Label.IsVisibleProperty, new Binding( source: fNameEntry.Behaviors[0], path: "HasError", mode: BindingMode.OneWay)); var lblPhone = new Label() { TextColor = Color.Gray, Text = "Phone Number", FontSize = 14, Margin = new Thickness(5, 5, 5, 1), AutomationId = "lblPhone" }; var phoneEntry = new CoreUnderlineEntry() { Margin = new Thickness(5, 1, 5, 1), AutomationId = "phoneEntry", EntryColor = Color.DarkGray }; phoneEntry.Behaviors.Add(new PhoneMaskBehavior()); phoneEntry.Behaviors.Add(new RegExBehavior() { ErrorMessage = "Requred Field", RegexExp = @"^[\s\t\r\n]*\S+" }); var phoneErrorLabel = new Label() { FontSize = 14, TextColor = Color.Red, Margin = new Thickness(5, 1, 5, 1), AutomationId = "phoneErrorLabel" }; phoneErrorLabel.SetBinding(Label.TextProperty, new Binding(source: phoneEntry.Behaviors[1], path: "ErrorMessage", mode: BindingMode.OneWay)); phoneErrorLabel.SetBinding(Label.IsVisibleProperty, new Binding(source: phoneEntry.Behaviors[1], path: "HasError", mode: BindingMode.OneWay)); var lblBindingEvent = new Label() { TextColor = Color.Gray, Text = "Event To Command Binding - (numbers only)", FontSize = 14, Margin = new Thickness(5, 5, 5, 1) }; var bindingEntry = new CoreUnderlineEntry() { Margin = new Thickness(5, 1, 5, 1), AutomationId = "bindingEntry", EntryColor = Color.DarkGray }; bindingEntry.Behaviors.Add(new EventToCommandBehavior() { EventName = "TextChanged" }); bindingEntry.Behaviors[0].SetBinding(EventToCommandBehavior.CommandProperty, "BindingTextChanged"); bindingEntry.SetBinding(CoreUnderlineEntry.TextProperty, "BindingTextValue"); var customLabel = new Label() { Margin = 5, AutomationId = "customLabel" }; customLabel.Behaviors.Add(new PropertyChangedBehavior(VM, (prop, ctrl) => { if (prop == "FirstName") { if (VM.FirstName == "Jack Sparrow") { var ctrlLabel = (Label)ctrl; ctrlLabel.IsVisible = true; ctrlLabel.TextColor = Color.Green; ctrlLabel.Text = "You like a pirate that has a bird for a friend!"; } else { ctrl.IsVisible = false; } } })); var btnCanExecute = new CoreButton() { Margin = new Thickness(5, 5, 5, 1), Text = "Can Execute", Style = CoreStyles.LightOrange }; btnCanExecute.SetBinding(CoreButton.CommandProperty, "CanExecute"); Content = new StackContainer(true) { Padding = 15, Children = { explanation, lbl, fNameEntry, errorLabel, lblPhone, phoneEntry, phoneErrorLabel, customLabel, lblBindingEvent, bindingEntry, btnCanExecute } }; }
public LoginPage() { this.Title = "Login"; var marginEdge = 30; NavigationPage.SetHasBackButton(this, false); NavigationPage.SetHasNavigationBar(this, false); this.BackgroundColor = CoreStyles.LightOrangeBackground; var img = new Image() { Source = "loginheader.png", Aspect = Aspect.AspectFill }; this.Padding = new Thickness(-9, -6, -9, -6); var lblHeader = new Label() { FontSize = 32, Text = "Task Manager", Margin = new Thickness(marginEdge, 5, marginEdge, 20), HorizontalOptions = LayoutOptions.Center }; var txtUserName = new CoreUnderlineEntry() { Placeholder = "User Name", Style = CoreStyles.LoginEntryStyle, }; txtUserName.SetBinding(CoreUnderlineEntry.TextProperty, "UserName"); var txtPassword = new CoreUnderlineEntry() { Placeholder = "Password", IsPassword = true, Style = CoreStyles.LoginEntryStyle, }; txtPassword.SetBinding(CoreUnderlineEntry.TextProperty, "Password"); var spacer = new StackLayout() { VerticalOptions = LayoutOptions.FillAndExpand }; var btnLogin = new CoreButton() { Text = "LOGIN", Style = CoreStyles.LightOrangeButton, Margin = new Thickness(marginEdge, 10, marginEdge, 10) }; btnLogin.SetBinding(CoreButton.CommandProperty, "LoginUser"); var btnRegister = new CoreButton() { Text = "REGISTER", Style = CoreStyles.LightOrangeButton, Margin = new Thickness(marginEdge, 10, marginEdge, 25), Command = new Command(async(obj) => { await Navigation.PushAsync(new RegisterPage()); }) }; Content = new StackLayout() { Padding = 0, Spacing = 0, Children = { img, lblHeader, txtUserName, txtPassword, spacer, btnLogin, btnRegister } }; }
public RegisterPage() { this.Title = "Login"; var marginEdge = 30; NavigationPage.SetHasBackButton(this, false); NavigationPage.SetHasNavigationBar(this, false); this.BackgroundColor = CoreStyles.LightOrangeBackground; var img = new Image() { Source = "registerheader.png", Aspect = Aspect.AspectFill }; this.Padding = new Thickness(-9, -6, -9, -6); var lblHeader = new Label() { FontSize = 32, Text = "Create Account", Margin = new Thickness(marginEdge, 5, marginEdge, 20), HorizontalOptions = LayoutOptions.Center }; var txtUserName = new CoreUnderlineEntry() { Placeholder = "User Name", Style = CoreStyles.LoginEntryStyle, }; txtUserName.SetBinding(CoreUnderlineEntry.TextProperty, "UserName"); var txtPassword = new CoreUnderlineEntry() { Placeholder = "Password", IsPassword = true, Style = CoreStyles.LoginEntryStyle, }; txtPassword.SetBinding(CoreUnderlineEntry.TextProperty, "Password"); var txtConfirmPassword = new CoreUnderlineEntry() { Placeholder = "Confirm Password", IsPassword = true, Style = CoreStyles.LoginEntryStyle, }; txtConfirmPassword.SetBinding(CoreUnderlineEntry.TextProperty, "ConfirmPassword"); var spacer = new StackLayout() { VerticalOptions = LayoutOptions.FillAndExpand }; var btnCreate = new CoreButton() { Text = "CREATE", Style = CoreStyles.LightOrangeButton, Margin = new Thickness(marginEdge, 10, marginEdge, 25) }; btnCreate.SetBinding(CoreButton.CommandProperty, "RegisterUser"); var pageContent = new StackLayout() { Children = { img, lblHeader, txtUserName, txtPassword, txtConfirmPassword, spacer, btnCreate } }; Content = new ScrollView() { Padding = 0, Margin = 0, Content = pageContent }; }
public CalendarEventPage() { this.Title = "Calendar Wizard"; var lblExplain = new Label() { Text = "Please enter the required fields to create a calendar event." }; var evtName = new Label() { TextColor = Color.Gray, Text = "Event Name", FontSize = 14, Margin = new Thickness(5, 5, 5, 1) }; evtNameEntry = new CoreUnderlineEntry() { Margin = new Thickness(5, 1, 5, 1), EntryColor = Color.DarkGray, }; evtNameEntry.SetBinding(Entry.TextProperty, new Binding(path: "Appt.Title", mode: BindingMode.TwoWay)); var evtDescription = new Label() { TextColor = Color.Gray, Text = "Description", FontSize = 14, Margin = new Thickness(5, 5, 5, 1), AutomationId = "evtDescription" }; var evtDescriptionEntry = new CoreUnderlineEntry() { Margin = new Thickness(5, 1, 5, 1), EntryColor = Color.DarkGray, AutomationId = "evtDescriptionEntry" }; evtDescriptionEntry.SetBinding(Entry.TextProperty, "Appt.Description"); var calendarSelect = CreateCalendarSelectionPanel(); var startTime = CreateStartDateTimePanel(); var endTime = CreateEndDateTimePanel(); var evtHasReminder = new Label() { TextColor = Color.Gray, Text = "Has Reminder", FontSize = 14, Margin = new Thickness(5, 5, 5, 1) }; var swReminder = new Switch() { Margin = 5, AutomationId = "swReminder" }; swReminder.SetBinding(Switch.IsToggledProperty, "Appt.HasReminder"); var btnCreate = new CoreButton() { Text = "Create Event", Style = CoreStyles.LightOrange, Margin = 5, AutomationId = "btnCreate" }; btnCreate.SetBinding(CoreButton.CommandProperty, "CreateEvent"); Content = new CompressedStackLayout() { Padding = 15, Children = { lblExplain, evtName, evtNameEntry, evtDescription, evtDescriptionEntry, calendarSelect, startTime, endTime, evtHasReminder, swReminder, btnCreate } }; this.SetAutomationIds(); }
public EncryptionPage() { this.Title = "Encryption"; var lbl = new Label() { TextColor = Color.Gray, Text = "Clear Text", FontSize = 14, Margin = new Thickness(5, 5, 5, 1) }; var clearEntry = new CoreUnderlineEntry() { Margin = new Thickness(5, 1, 5, 1), AutomationId = "clearEntry" }; clearEntry.SetBinding(CoreUnderlineEntry.TextProperty, "ClearText"); var encryptedLabel = new Label() { FontSize = 14, Margin = new Thickness(5, 1, 5, 1), AutomationId = "encryptedLabel" }; encryptedLabel.SetBinding(Label.TextProperty, "EncryptedText"); var btnEncrypt = new CoreButton() { Text = "Encryption", Style = CoreStyles.LightOrange, Margin = 5, AutomationId = "btnEncrypt" }; btnEncrypt.SetBinding(Button.CommandProperty, "EncryptText"); var md5Label1 = new Label() { TextColor = Color.Gray, Text = "Hash 1", FontSize = 14, Margin = new Thickness(5, 5, 5, 1), AutomationId = "md5Label1" }; var clearHash1 = new CoreUnderlineEntry() { Margin = new Thickness(5, 1, 5, 1), AutomationId = "clearHash1" }; clearHash1.SetBinding(CoreUnderlineEntry.TextProperty, "ClearHash1"); var md5Label2 = new Label() { TextColor = Color.Gray, Text = "Hash 2", FontSize = 14, Margin = new Thickness(5, 5, 5, 1), AutomationId = "md5Label2" }; var clearHash2 = new CoreUnderlineEntry() { Margin = new Thickness(5, 1, 5, 1), AutomationId = "clearHash2" }; clearHash2.SetBinding(CoreUnderlineEntry.TextProperty, "ClearHash2"); var btnHash = new CoreButton() { Text = "Compare Clear Hash", Style = CoreStyles.LightOrange, Margin = 5, AutomationId = "btnHash" }; btnHash.SetBinding(Button.CommandProperty, "HashText"); var hashMatch = new Label() { TextColor = Color.Red, AutomationId = "hashMatch" }; hashMatch.SetBinding(Label.TextProperty, "HashMatchMessage"); Content = new CompressedStackLayout() { Padding = 15, Children = { lbl, clearEntry, encryptedLabel, btnEncrypt, md5Label1, clearHash1, md5Label2, clearHash2, btnHash, hashMatch } }; }