Exemplo n.º 1
0
        public Nav1()
        {
            this.Title = "Nav1";

#if __IOS__
            this.OverrideBackButton = true;
#endif

            var btn = new CoreButton()
            {
                Style        = CoreStyles.LightOrange,
                Text         = "Navigate",
                AutomationId = "btn",
                Command      = new Command((obj) =>
                {
                    Navigation.PushNonAwaited <Nav2>();
                })
            };

            Content = new CompressedStackLayout()
            {
                Padding  = 20,
                Spacing  = 10,
                Children = { btn }
            };
        }
Exemplo n.º 2
0
        public FavoritesPage()
        {
            this.Title = "Favorites";

            var btn = new CoreButton()
            {
                Margin  = 20,
                Text    = "Favorite Kitties",
                Style   = CoreStyles.LightOrange,
                Command = new Command(async() =>
                {
                    await CoreSettings.AppNav.PushAsync(new FavoritesSubPage());
                })
            };

            Content = new StackLayout()
            {
                Children =
                {
                    new Label()
                    {
                        Text = "Favorites Page", Margin = 20
                    },
                    btn
                }
            };
        }
Exemplo n.º 3
0
        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 CompressedGrid CreateAnimation(string buttonText, Color boxColor, CoreTriggerAction animation)
        {
            var box = new BoxView()
            {
                HeightRequest   = 28,
                WidthRequest    = 28,
                BackgroundColor = boxColor
            };

            animation.Animation.Target = box;

            var trigger = new EventTrigger()
            {
                Event   = "Clicked",
                Actions = { animation }
            };

            var btn = new CoreButton()
            {
                Text     = buttonText,
                Style    = CoreStyles.LightOrange,
                Triggers = { trigger }
            };

            var grid = new CompressedGrid();

            grid.AddChild(box, 0, 0);
            grid.AddChild(btn, 0, 1);
            return(grid);
        }
        public EffectsMain()
        {
            this.Title = "Effects";

            var removeEmptyRowsEffect = new CoreButton()
            {
                Text         = "Remove Empty Cell",
                Style        = CoreStyles.LightOrange,
                AutomationId = "removeEmptyRowsEffect",
                Command      = new Command((obj) =>
                {
                    Navigation.PushNonAwaited(new ListViewEffect());
                })
            };

            var hideListSeparatorEffect = new CoreButton()
            {
                Text         = "Hide List Separator",
                Style        = CoreStyles.LightOrange,
                AutomationId = "hideListSeparatorEffect",
                Command      = new Command((obj) =>
                {
                    Navigation.PushNonAwaited(new ListViewEffect(true));
                })
            };

            var disableWebViewScrollEffect = new CoreButton()
            {
                Text         = "WebView Scroll Disable",
                Style        = CoreStyles.LightOrange,
                AutomationId = "disableWebViewScrollEffect",
                Command      = new Command((obj) =>
                {
                    Navigation.PushNonAwaited <WebViewEffect>();
                })
            };

            var stack = new StackContainer(true)
            {
                Padding  = 20,
                Spacing  = 10,
                Children = { removeEmptyRowsEffect, hideListSeparatorEffect, disableWebViewScrollEffect, new StackLayout()
                             {
                                 HeightRequest = 5
                             } }
            };

            Content = new ScrollView()
            {
                Content = stack
            };
        }
Exemplo n.º 6
0
        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
            };
        }
Exemplo n.º 7
0
        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 }
            };
        }
Exemplo n.º 8
0
        public Nav4()
        {
            this.NeedOverrideSoftBackButton = true;
#if __IOS__
            this.OverrideBackButton = true;
#endif

            this.Title = "Nav4";

            var btnBack = new CoreButton()
            {
                Style        = CoreStyles.LightOrange,
                Text         = "Back",
                AutomationId = "btnBack",
                Command      = new Command(async(obj) =>
                {
                    await Navigation.PopTo <Nav2>(true);
                })
            };

            var btnRelease = new CoreButton()
            {
                Style        = CoreStyles.LightOrange,
                Text         = "Release Resources",
                AutomationId = "btnRelease",
                Command      = new Command((obj) =>
                {
                    CoreDependencyService.ReleaseResources <Nav4ViewModel>();
                })
            };

            var lbl = new Label()
            {
                Margin = 5
            };
            lbl.SetBinding(Label.TextProperty, "AnimalDescription");

            Content = new CompressedStackLayout()
            {
                Padding  = 20,
                Spacing  = 10,
                Children = { btnBack, btnRelease, lbl }
            };
        }
        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 }
            };
        }
Exemplo n.º 10
0
        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 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 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);
        }
Exemplo n.º 13
0
        public Nav2()
        {
            this.NeedOverrideSoftBackButton = false;
#if __IOS__
            this.OverrideBackButton = true;
#endif
            this.Title = "Nav2";
            var btn = new CoreButton()
            {
                Style        = CoreStyles.LightOrange,
                Text         = "Navigate",
                AutomationId = "btn",
                Command      = new Command((obj) =>
                {
                    Navigation.PushNonAwaited <Nav3>();
                })
            };

            var btnBack = new CoreButton()
            {
                Style        = CoreStyles.LightOrange,
                Text         = "Back",
                AutomationId = "btnBack",
                Command      = new Command((obj) =>
                {
                    Navigation.PopNonAwaited();
                })
            };

            Content = new CompressedStackLayout()
            {
                Padding  = 20,
                Spacing  = 10,
                Children = { btn, btnBack }
            };
        }
Exemplo n.º 14
0
        public SomePage()
        {
            this.Title = "Fonts";

            var fontAwesome = new CoreButton()
            {
                Text    = "FontAwesome",
                Style   = CoreStyles.LightOrange,
                Command = new Command((obj) =>
                {
                    VM.FontType = FontType.FontAwesome;
                    VM.BuildResourceList();
                    Navigation.PushNonAwaited <FontsCollectionView>();
                })
            };

            var entypoPlus = new CoreButton()
            {
                Text    = "EntypoPlus",
                Style   = CoreStyles.LightOrange,
                Command = new Command((obj) =>
                {
                    VM.FontType = FontType.EntypoPlus;
                    VM.BuildResourceList();
                    Navigation.PushNonAwaited <FontsCollectionView>();
                })
            };

            var ionicons = new CoreButton()
            {
                Text    = "Ionicons",
                Style   = CoreStyles.LightOrange,
                Command = new Command((obj) =>
                {
                    VM.FontType = FontType.Ionicons;
                    VM.BuildResourceList();
                    Navigation.PushNonAwaited <FontsCollectionView>();
                })
            };

            var material = new CoreButton()
            {
                Text    = "Material",
                Style   = CoreStyles.LightOrange,
                Command = new Command((obj) =>
                {
                    VM.FontType = FontType.Material;
                    VM.BuildResourceList();
                    Navigation.PushNonAwaited <FontsCollectionView>();
                })
            };

            var meteocons = new CoreButton()
            {
                Text    = "Meteocons",
                Style   = CoreStyles.LightOrange,
                Command = new Command((obj) =>
                {
                    VM.FontType = FontType.Meteocons;
                    VM.BuildResourceList();
                    Navigation.PushNonAwaited <FontsCollectionView>();
                })
            };

            var simpleLineIcons = new CoreButton()
            {
                Text    = "SimpleLineIcons",
                Style   = CoreStyles.LightOrange,
                Command = new Command((obj) =>
                {
                    VM.FontType = FontType.SimpleLineIcons;
                    VM.BuildResourceList();
                    Navigation.PushNonAwaited <FontsCollectionView>();
                })
            };

            var typicons = new CoreButton()
            {
                Text    = "Typicons",
                Style   = CoreStyles.LightOrange,
                Command = new Command((obj) =>
                {
                    VM.FontType = FontType.Typicons;
                    VM.BuildResourceList();
                    Navigation.PushNonAwaited <FontsCollectionView>();
                })
            };

            var weatherIcons = new CoreButton()
            {
                Text    = "WeatherIcons",
                Style   = CoreStyles.LightOrange,
                Command = new Command((obj) =>
                {
                    VM.FontType = FontType.WeatherIcons;
                    VM.BuildResourceList();
                    Navigation.PushNonAwaited <FontsCollectionView>();
                })
            };

            Content = new StackContainer(true)
            {
                Padding  = 20,
                Spacing  = 10,
                Children = { fontAwesome, entypoPlus, ionicons, material, meteocons, simpleLineIcons, typicons, weatherIcons }
            };
        }
        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 }
            };
        }
Exemplo n.º 16
0
        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
            };
        }
Exemplo n.º 17
0
        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
                }
            };
        }
Exemplo n.º 18
0
        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 }
            };
        }
        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();
        }
Exemplo n.º 20
0
        public DialogExample()
        {
            this.Title = "Dialogs";

            var dlg1 = new CoreButton()
            {
                Style   = CoreStyles.LightOrange,
                Text    = "Ok Popup",
                Command = new Command(() => {
                    Prompt.ShowMessage(new Prompt()
                    {
                        Title        = "Hello",
                        ButtonTitles = new string[] { "Yes" },
                        Message      = "This is an okay message"
                    });
                })
            };

            var dlg2 = new CoreButton()
            {
                Style   = CoreStyles.LightOrange,
                Text    = "Yes No Popup",
                Command = new Command(() => {
                    Prompt.ShowMessage(new Prompt()
                    {
                        Title        = "Are you bored?",
                        Message      = "Make a selection and change you life for the better",
                        ButtonTitles = new string[] { "Yes", "No" },
                        Callback     = (obj) => {
                            var x = obj;
                        },
                    });
                })
            };

            var dlg3 = new CoreButton()
            {
                Style   = CoreStyles.LightOrange,
                Text    = "Options Popup",
                Command = new Command(() =>
                {
                    Prompt.ShowMessage(new Prompt()
                    {
                        Title        = "Which do you prefer?",
                        Message      = "Pick a flavor and see what happens.",
                        ButtonTitles = new string[] { "Orange", "Apple", "Melon" },
                        Callback     = (obj) =>
                        {
                            var x = obj;
                        },
                    });
                })
            };

            var dlg4 = new CoreButton()
            {
                Style   = CoreStyles.LightOrange,
                Text    = "Action Sheet",
                Command = new Command(() =>
                {
                    Prompt.ShowActionSheet(
                        "Vehicles",
                        "Please select your favorite",
                        new string[] { "Chevy", "Ford", "Lincoln", "Nissan", "Toyota", "Honda", "Audi" },
                        (obj) => {
                        var x = obj;
                    });
                })
            };

            var stack = new StackContainer(true)
            {
                Padding  = 20,
                Spacing  = 10,
                Children = { dlg1, dlg2, dlg3, dlg4 }
            };

            Content = new ScrollView()
            {
                Content = stack
            };
        }
        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 ControlsMain()
        {
            this.Title = "Controls";

            var md = new CoreButton()
            {
                Text    = "Material Design",
                Style   = CoreStyles.LightOrange,
                Command = new Command((obj) =>
                {
                    Navigation.PushNonAwaited <MaterialDesignPage>();
                })
            };

            var listPage = new CoreButton()
            {
                Text    = "List Control",
                Style   = CoreStyles.LightOrange,
                Command = new Command((obj) =>
                {
                    Navigation.PushNonAwaited <PaginagedListControl>();
                })
            };


            var searchPage = new CoreButton()
            {
                Text    = "Search Page",
                Style   = CoreStyles.LightOrange,
                Command = new Command((obj) =>
                {
                    Navigation.PushNonAwaited <SearchContentPage>();
                })
            };

            var popup = new CoreButton()
            {
                Text    = "Popup Control",
                Style   = CoreStyles.LightOrange,
                Command = new Command((obj) =>
                {
                    this.ShowPopup(new StateView(), new Rectangle(0.5, 0.5, 0.85, 0.5), 5);
                })
            };

            var carouselPage = new CoreButton()
            {
                Text    = "Carousel Page",
                Style   = CoreStyles.LightOrange,
                Command = new Command((obj) =>
                {
                    Navigation.PushNonAwaited <CarouselMain>();
                })
            };

            var bckImage = new CoreButton()
            {
                Text    = "Background Image",
                Style   = CoreStyles.LightOrange,
                Command = new Command((obj) =>
                {
                    Navigation.PushNonAwaited <BackgroundImagePage>();
                })
            };

            var cardViewPage = new CoreButton()
            {
                Text    = "Card View",
                Style   = CoreStyles.LightOrange,
                Command = new Command((obj) =>
                {
                    Navigation.PushNonAwaited <CardViewPage>();
                })
            };

            var pnl = new CompressedStackLayout()
            {
                Orientation = StackOrientation.Horizontal,
                Spacing     = 10,
                Children    =
                {
                    new Label()
                    {
                        Margin            = 5,
                        Text              = "Toggle A Selection",
                        HorizontalOptions = LayoutOptions.StartAndExpand
                    },
                    new CoreSwitch()
                    {
                        TrueColor = Color.FromHex("#DF8049")
                    }
                }
            };

            var ranking = new CoreRanking()
            {
                Margin          = 5,
                Count           = 5,
                UnSelectedImage = "star_outline.png",
                SelectedImage   = "star_selected.png",
            };

            ranking.SetBinding(CoreRanking.SelectedRankProperty, new Binding("SelectedRank", BindingMode.TwoWay));

            var starLbl = new Label()
            {
                Margin            = 5,
                HorizontalOptions = LayoutOptions.Center
            };

            starLbl.SetBinding(Label.TextProperty, "SelectedRankText");

            var radioGroup = new CoreRadioGroup()
            {
                Spacing         = 15,
                ImageColor      = Color.FromHex("#DF8049"),
                TextColor       = Color.FromHex("#E8A47D"),
                SelectedImage   = "checked.png",
                UnSelectedImage = "unchecked.png",
                CheckedCommand  = new CoreCommand((obj) => {
                    var z = obj;
                })
            };

            radioGroup.SetBinding(CoreRadioGroup.ItemsSourceProperty, "RadioOptions");
            radioGroup.SetBinding(CoreRadioGroup.SelectedIndexProperty, "SelectedRadioIndex");

            var stack = new StackLayout()
            {
                Padding  = 20,
                Spacing  = 10,
                Children = { listPage, md, searchPage, popup, carouselPage, bckImage, cardViewPage, pnl, ranking, starLbl, radioGroup }
            };

            Content = new ScrollView()
            {
                Content = stack
            };
        }
Exemplo n.º 23
0
        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
            };
        }
Exemplo n.º 24
0
        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
            };
        }
Exemplo n.º 25
0
        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
            };
        }
Exemplo n.º 26
0
        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
                }
            };
        }