Exemplo n.º 1
0
        public MenuPage()
        {
            Icon = "menu.png";
            Title = "menu"; // The Title property must be set.
            BackgroundColor = Color.FromHex("333333");

            Menu = new MenuListView();

            var menuLabel = new ContentView
            {
                Padding = new Thickness(10, 36, 0, 5),
                Content = new Label
                {
                    TextColor = Color.White, //Color.FromHex("AAAAAA"),
                    Text = StateService.GetInstance().AppName,
                    HorizontalOptions = LayoutOptions.Center
                }
            };

            var layout = new StackLayout
            {
                Spacing = 0,
                VerticalOptions = LayoutOptions.FillAndExpand
            };
            layout.Children.Add(menuLabel);
            layout.Children.Add(Menu);

            Content = layout;
        }
Exemplo n.º 2
0
        public MenuPage2()
        {
            Icon = "MenuIcon.png";
            Title = "menu";
            BackgroundColor = Color.FromHex("333333");

            Menu = new MenuListView();

            var menuLabel = new ContentView
            {
                Padding = new Thickness(10, 36, 0, 5),
                Content = new Label
                {
                    TextColor = Color.FromHex("AAAAAA"),
                    Text = "MENU",
                }
            };

            var layout = new StackLayout
            {
                Spacing = 0,
                VerticalOptions = LayoutOptions.FillAndExpand
            };
            layout.Children.Add(menuLabel);
            layout.Children.Add(Menu);

            Content = layout;
        }
        public AlertDetailsPage(AlertNavigationPage alertManager)
        {
            // MAP MODULE
                // Address
                // Map
            // TEXT MODULE
                // Room -- Floor
            // SEND MODULE
                //Button

            // Create Screen Elements
            var button = new Button {
                Text = "Send Test Alert",
                TextColor = Color.White,
                BackgroundColor = Color.Red,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                MinimumHeightRequest = 100

            };
            button.Clicked += (sender, e) => {
                alertManager.SendAlert ();
            };

            // Create Screen Content
            Content = new ContentView {
                Content = new StackLayout {
                    Children = {
                        button
                    }
                }
            };
        }
 private void InitializeComponent()
 {
     this.LoadFromXaml(typeof(MatrixControlPrototype));
     cnvTitle = this.FindByName<ContentView>("cnvTitle");
     lblTitle = this.FindByName<Label>("lblTitle");
     rootCanvas = this.FindByName<AbsoluteLayout>("rootCanvas");
 }
Exemplo n.º 5
0
		public MenuPage ()
		{
			Icon = "settings.png";
			Title = "Gráficos"; // The Title property must be set.
			BackgroundColor = Color.FromHex ("333333");

			Menu = new MenuListView ();

			var menuLabel = new ContentView {
				Padding = new Thickness (10, 36, 0, 5),
				Content = new Label {
					TextColor = Color.FromHex ("AAAAAA"),
					Text = "Gráficos", 
				}
			};

			var layout = new StackLayout { 
				Spacing = 0, 
				VerticalOptions = LayoutOptions.FillAndExpand
			};
			layout.Children.Add (menuLabel);
			layout.Children.Add (Menu);

			Content = layout;
		}
Exemplo n.º 6
0
        public MenuPage()
        {
            Icon = "settings.png";
            Title = "menu";
            BackgroundColor = Color.FromHex ("#003f77");

            Menu = new MenuListView ();

            var menuLabel = new ContentView {
                Padding = new Thickness (10, 15, 0, 15),
                VerticalOptions = LayoutOptions.Center,
                Content = new Label {
                    TextColor = Color.FromHex ("#ffffff"),
                    FontSize = 15,
                    Text = "Tristan Low \[email protected] ",
                }
            };

            var layout = new StackLayout {
                Spacing = 0,
                VerticalOptions = LayoutOptions.FillAndExpand
            };
            layout.Children.Add (menuLabel);
            layout.Children.Add (Menu);

            Content = layout;
        }
Exemplo n.º 7
0
        private void RenderContent()
        {
            ScrollView scrollview = new ScrollView() { HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.FillAndExpand};
            var rootLayout = new StackLayout() { BackgroundColor = Color.Black, Spacing = 15, Orientation = StackOrientation.Vertical, HorizontalOptions = LayoutOptions.FillAndExpand, Padding = new Thickness(0, 0, 0, 10) }; // Padding = new Thickness(45, 15, 45, 15),

            ContentView header = new ContentView() { BackgroundColor = Color.Black, HorizontalOptions = LayoutOptions.FillAndExpand, Padding = new Thickness(0, 80, 0, 0) };
            rootLayout.Children.Add(header);

            btnGoogleLogIn = new Button() {
                Text = " LOG IN WITH GOOGLE ",
                FontAttributes = FontAttributes.Bold,
                BackgroundColor = Color.Green,
                TextColor = Color.White,
                HorizontalOptions = LayoutOptions.Center
            };
            rootLayout.Children.Add(btnGoogleLogIn);

            scrollview.Content = rootLayout;

            if (Device.OS == TargetPlatform.Android)
            {
                scrollview.IsClippedToBounds = true;
            }

            Content = scrollview;
        }
Exemplo n.º 8
0
 private void InitializeComponent() {
     this.LoadFromXaml(typeof(StandingsView));
     NameGrid = this.FindByName<Grid>("NameGrid");
     MessagesLayoutFrame = this.FindByName<AbsoluteLayout>("MessagesLayoutFrame");
     MessagesLayoutFrameInner = this.FindByName<ContentView>("MessagesLayoutFrameInner");
     MessagesListView = this.FindByName<ListView>("MessagesListView");
 }
        public TitleIXPage()
        {
            // Set Page Title
            Title = "Title IX Rights";

            var source = new UrlWebViewSource ();
            source.Url = "http://knowyourix.org/title-ix/title-ix-the-basics/";
            var webView = new WebView {
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions = LayoutOptions.FillAndExpand,
                Source = source
            };
            webView.Navigating += (object sender, WebNavigatingEventArgs e) => {
                System.Diagnostics.Debug.WriteLine("Loading");
            };
            webView.Navigated += (object sender, WebNavigatedEventArgs e) => {
                System.Diagnostics.Debug.WriteLine("Done");
            };

            Content = new ContentView {
                Content = new StackLayout {
                    Children = {
                        webView
                    }
                }
            };
        }
Exemplo n.º 10
0
        public AlertPage()
        {
            // Set Page Navigation
            Title = "Alert!";

            alert = new Alert ();

            // Create Screen Elements
            var button = new Button {
                Text = "Send Test Alert",
                TextColor = Color.White,
                BackgroundColor = Color.Red,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                MinimumHeightRequest = 100

            };
            button.Clicked += (sender, e) => { fakeAlert(); };

            // Create Screen Content
            Content = new ContentView {
                Content = new StackLayout {
                    Children = {
                        button
                    }
                }
            };
        }
Exemplo n.º 11
0
        public MenuPage()
        {
            Icon = "profile_filler.png";//"settings.png";
            Title = "menu"; // The Title property must be set.
            BackgroundColor = Color.FromHex ("#007064");

            Menu = new MenuListView ();

            var menuLabel = new ContentView {
                Padding = 10,
                Content = new Label {
                    TextColor = Color.White,
                    Text = "Menu",
                    XAlign = TextAlignment.Center,
                    FontSize = 20,
                    FontAttributes = FontAttributes.Bold
                }
            };

            StackLayout layout = new StackLayout {
                VerticalOptions = LayoutOptions.FillAndExpand,
                Orientation = StackOrientation.Vertical,
                Spacing = 0
            };

            layout.Children.Add (menuLabel);
            layout.Children.Add (Menu);

            Content = layout;
        }
 private void InitializeComponent()
 {
     this.LoadFromXaml(typeof(MatrixView));
     grdRoot = this.FindByName<Grid>("grdRoot");
     cnvInfo = this.FindByName<ContentView>("cnvInfo");
     lblInfo = this.FindByName<Label>("lblInfo");
     cnvHeader = this.FindByName<ContentView>("cnvHeader");
     lblHeader1 = this.FindByName<Label>("lblHeader1");
     lblHeaderContent1 = this.FindByName<Label>("lblHeaderContent1");
     lblHeader2 = this.FindByName<Label>("lblHeader2");
     lblHeaderContent2 = this.FindByName<Label>("lblHeaderContent2");
     grdHeaderContent = this.FindByName<Grid>("grdHeaderContent");
     lblZ = this.FindByName<Label>("lblZ");
     lblZ1 = this.FindByName<Label>("lblZ1");
     lblZ2 = this.FindByName<Label>("lblZ2");
     lblZ3 = this.FindByName<Label>("lblZ3");
     lblZ4 = this.FindByName<Label>("lblZ4");
     lblZ5 = this.FindByName<Label>("lblZ5");
     lblZ6 = this.FindByName<Label>("lblZ6");
     lblD = this.FindByName<Label>("lblD");
     lblD1 = this.FindByName<Label>("lblD1");
     lblD2 = this.FindByName<Label>("lblD2");
     lblD3 = this.FindByName<Label>("lblD3");
     lblD4 = this.FindByName<Label>("lblD4");
     lblD5 = this.FindByName<Label>("lblD5");
     lblD6 = this.FindByName<Label>("lblD6");
     stkChart = this.FindByName<StackLayout>("stkChart");
     lblStatus = this.FindByName<Label>("lblStatus");
     cnvMatrix = this.FindByName<ContentView>("cnvMatrix");
 }
        public ModalPopupWithNavigationPages()
        {
            var button = new Button {
                Text = "Show Test Page",
            };

            button.Clicked += (sender, e) => {
                var page = new BubbonPushModalAsyncPage();
                page.Cancelled += (s, args) => {
                    this.Navigation.PopModalAsync();
                };
                this.Navigation.PushModalAsync(page);
            };
            // The root page of your application
            var content = new Xamarin.Forms.ContentView
            {
                //Title = "BubbleTest",
                Content = new Xamarin.Forms.StackLayout
                {
                    VerticalOptions = LayoutOptions.Center,
                    Children        =
                    {
                        new Xamarin.Forms.Label {
                            HorizontalTextAlignment = TextAlignment.Center,
                            Text = "Welcome to Xamarin Forms!"
                        },
                        button,
                    }
                }
            };

            Content = content;
        }
Exemplo n.º 14
0
Arquivo: Spike.cs Projeto: adbk/spikes
        private void Foo()
        {

            Page p = new Page
            {
                //BackgroundColor = "white",
            };

            var l = new Label
            {
                Font = Font.SystemFontOfSize(NamedSize.Micro),
            };

            var e = new Entry()
            {

                Keyboard = Keyboard.Numeric,
                VerticalOptions = LayoutOptions.FillAndExpand,
            };


            var c = new ContentView()
            {
                Padding = new Thickness(5),
            };

            var sl = new StackLayout
            {
                Padding = new Thickness(5),
            };
        }
Exemplo n.º 15
0
        public MenuPage()
        {
            this.Title = "Menu";
            this.BackgroundColor = Theme.NavBackgroundColor;

            var layout = new StackLayout
            {
                Spacing = 0,
                VerticalOptions = LayoutOptions.FillAndExpand
            };

            var menuLabel = new ContentView()
            {
                VerticalOptions = LayoutOptions.Start,
                Padding = new Thickness(15, 10, 0, 0),
                Content = new Label
                {
                    TextColor = Theme.HeaderColor,
                    Text = "Menu",
                    FontSize = 22
                }
            };

            layout.Children.Add(menuLabel);
            layout.Children.Add(Menu);

            this.Content = layout;
        }
Exemplo n.º 16
0
        public LeadListHeaderView(Command newLeadTappedCommand)
        {
            _NewLeadTappedCommand = newLeadTappedCommand;

            #region title label
            Label headerTitleLabel = new Label()
            {
                Text = TextResources.Leads_LeadListHeaderTitle.ToUpperInvariant(),
                TextColor = Palette._003,
                FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Label)),
                FontAttributes = FontAttributes.Bold,
                HorizontalTextAlignment = TextAlignment.Start,
                VerticalTextAlignment = TextAlignment.Center
            };
            #endregion

            #region new lead image "button"
            var newLeadImage = new Image
            {
                Source = new FileImageSource { File = Device.OnPlatform("add_ios_gray", "add_android_gray", null) },
                Aspect = Aspect.AspectFit, 
                HorizontalOptions = LayoutOptions.EndAndExpand,
            };
            //Going to use FAB
            newLeadImage.IsVisible = false;
            newLeadImage.GestureRecognizers.Add(new TapGestureRecognizer()
                {
                    Command = _NewLeadTappedCommand,
                    NumberOfTapsRequired = 1
                });
            #endregion

            #region absolutLayout
            AbsoluteLayout absolutLayout = new AbsoluteLayout();

            absolutLayout.Children.Add(
                headerTitleLabel, 
                new Rectangle(0, .5, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize), 
                AbsoluteLayoutFlags.PositionProportional);

            absolutLayout.Children.Add(
                newLeadImage, 
                new Rectangle(1, .5, AbsoluteLayout.AutoSize, .5), 
                AbsoluteLayoutFlags.PositionProportional | AbsoluteLayoutFlags.HeightProportional);
            #endregion

            #region setup contentView
            ContentView contentView = new ContentView()
            {
                Padding = new Thickness(10, 0), // give the content some padding on the left and right
                HeightRequest = RowSizes.MediumRowHeightDouble, // set the height of the content view
            };
            #endregion

            #region compose the view hierarchy
            contentView.Content = absolutLayout;
            #endregion

            Content = contentView;
        }
        private void InitAsync()
        {
            _listView = new MultiLevelListView<MultiLevelItemBase>();
            _source = new ObservableCollection<MultiLevelItemBase>();

            _listView.ItemTemplate = new DataTemplate(typeof(TestCell));
            // The root page of your application
            Content = new ContentView()
            {
                Content = _listView
            };

            for (int i = 0; i < 3; i++)
            {
                var root = new MultiLevelItemBase() { Name = "Root " + i };
                _source.Add(root);
                for (int j = 0; j < 3; j++)
                {
                    var child1 = new MultiLevelItemBase() { Name = $"\tChild {i}-{j}" };
                    root.Children.Add(child1);
                    for (int k = 0; k < 3; k++)
                    {
                        var child2 = new MultiLevelItemBase() { Name = $"\t\tChild {i}-{j}-{k}" };
                        child1.Children.Add(child2);
                    }
                }
            }
            _listView.ItemsSource = _source;
        }
        public ChessboardDynamicPage()
        {
            absoluteLayout = new AbsoluteLayout
            {
                BackgroundColor = Color.FromRgb(240, 220, 130),
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions = LayoutOptions.Center
            };

            for (int i = 0; i < 32; i++)
            {
                BoxView boxView = new BoxView
                {
                    Color = Color.FromRgb(0, 64, 0)
                };
                absoluteLayout.Children.Add(boxView);
            }

            ContentView contentView = new ContentView
            {
                Content = absoluteLayout
            };
            contentView.SizeChanged += OnContentViewSizeChanged;

            this.Padding = new Thickness(5, Device.OnPlatform(25, 5, 5), 5, 5);
            this.Content = contentView;
        }
        public ModalPopupWithNavigationPages()
        {
            Padding = 20;

            var button = new Forms9Patch.Button("Show Test Page");

            button.Clicked += (sender, e) => this.Navigation.PushModalAsync(new BubbonPushModalAsyncPage());
            // The root page of your application
            var content = new Xamarin.Forms.ContentView
            {
                //Title = "BubbleTest",
                Content = new Xamarin.Forms.StackLayout
                {
                    VerticalOptions = LayoutOptions.Center,
                    Children        =
                    {
                        new Xamarin.Forms.Label {
                            HorizontalTextAlignment = TextAlignment.Center,
                            Text = "Welcome to Xamarin Forms!"
                        },
                        button,
                    }
                }
            };

            Content = content;
        }
Exemplo n.º 20
0
        public NewImagePage()
        {
            mImage = new Image
            {
                Source = "http://developer.xamarin.com/demo/IMG_1415.JPG?width=512"
            };

            tapPointsLayout = new AbsoluteLayout
            {
                VerticalOptions = LayoutOptions.Center,
                HorizontalOptions = LayoutOptions.Center,
                BackgroundColor = Color.Teal
            };
            tapPointsLayout.Children.Add(mImage);

            imageContainer = new ContentView
            {
                Content = tapPointsLayout,
                VerticalOptions = LayoutOptions.FillAndExpand,
                BackgroundColor = Color.Yellow
            };
            imageContainer.SizeChanged += imageContainer_SizeChanged;

            Content = new StackLayout
            {
                Children = {
                    new Label { Text = "Hello ContentPage" },
                    imageContainer,
                    new Label { Text = "PAUL IS COOL"}
                }
            };

            //Content.SizeChanged += Content_SizeChanged;
        }
Exemplo n.º 21
0
        public MenuCell()
        {
            this.Height = 70;
            var title = new Label
            {
                TextColor = Color.White,
                VerticalOptions = LayoutOptions.Center,
                HorizontalOptions = LayoutOptions.CenterAndExpand,
                FontSize = 21,
                FontAttributes = FontAttributes.Bold,

            };

            title.SetBinding(Label.TextProperty, "Title");

            var cntViewTitle = new ContentView {
                Content = title,
                BackgroundColor = Color.FromRgb(1,112,126),
                HeightRequest = 70,
                HorizontalOptions = LayoutOptions.FillAndExpand,

            };

            View = new StackLayout
            {
                HorizontalOptions = LayoutOptions.FillAndExpand,
                Orientation = StackOrientation.Vertical,
                Children = { cntViewTitle },
                HeightRequest = 80,
                Padding = new Thickness(0,2,0,2),

            };
        }
Exemplo n.º 22
0
        public MenuPage()
        {
            Icon = "settings.png";
            Title = "Menu";
            BackgroundColor = Color.FromHex("FFFFFF");

            Menu = new MenuListView();

            var menuLabel = new ContentView
            {
                Padding = new Thickness(5, 5, 5, 5),
                Content = new Label()
            };

            var layout = new StackLayout
            {
                Spacing = 0,
                Padding = new Thickness(15, 15, 15, 15),
                VerticalOptions = LayoutOptions.FillAndExpand
            };
            layout.Children.Add(menuLabel);
            layout.Children.Add(Menu);

            Content = layout;
        }
		public stackLayoutContentView ()
		{
			ContentView contentView = new ContentView 
			{
				BackgroundColor = Color.Teal,
				Padding = new Thickness (40),
				HorizontalOptions = LayoutOptions.Fill,
				Content = new Label
				{
					Text = "a view, such as a label, a layout of layouts",
					FontSize = 20,
					FontAttributes = FontAttributes.Bold,
					TextColor = Color.White
				}
			};

			// Padding on edges and a bit more for iPhone top status bar
			this.Padding = new Thickness(10, Device.OnPlatform(20,0,0),10,5);

			this.Content = new StackLayout 
			{
				Children = {
					contentView
				}
			};

		}
		protected AbstractMasterMenuPage()
		{
			Icon = GetIcon();
			Title = GetTitle(); // The Title property must be set.
			BackgroundColor = Color.FromHex ("888888");

			Menu = new MenuListView (GetMenuItems()) 
			{ 
				SeparatorVisibility = SeparatorVisibility.None 
			};

			var menuLabel = new ContentView {
				Padding = new Thickness (10, 10, 0, 5),
				Content = new Label {
					TextColor = Color.FromHex ("AAAAAA"),
					Text = GetTitle(), 
				}
			};

			var layout = new StackLayout { 
				Spacing = 0, 
				VerticalOptions = LayoutOptions.FillAndExpand
			};
			layout.Children.Add (menuLabel);
			layout.Children.Add (Menu);

			Content = layout;
		}
Exemplo n.º 25
0
        public MenuPage()
        {
            if (Device.OS == TargetPlatform.iOS)
                Icon = "settings.png";
			
            Title = "menu";
            BackgroundColor = Colors._defaultColorFromHex;

            Menu = new MenuListView();

            var menuLabel = new ContentView
            {
                Padding = new Thickness(10, 36, 0, 5),
                Content = new Label
                {
                    TextColor = Color.White,
                    Text = "MENU", 
                }
            };

            var layout = new StackLayout
            { 
                Spacing = 10, 
                VerticalOptions = LayoutOptions.FillAndExpand
            };
            layout.Children.Add(menuLabel);
            layout.Children.Add(Menu);

            Content = layout;
        }
Exemplo n.º 26
0
		public BorderDisplayControl() {
			ContentView border = new ContentView();
			border.BackgroundColor = Color.Green;
			Content = border;
			label = new Label();
			border.Content = label;
		}
Exemplo n.º 27
0
        public MenuPage()
        {
            Icon = "settings.png";
            Title = "menu"; // The Title property must be set.
            Menu = new MenuListView ();

            var menuLabel = new ContentView {
                Padding = new Thickness (10, 36, 0, 5),
                Content = new Label {
                    TextColor = Color.FromHex ("AAAAAA"),
                    Text = "MENU",
                }
            };

            //this.Padding = new Thickness(10, Device.OnPlatform(50, 0, 0), 10, 5);

            var layout = new StackLayout {
                Spacing = 0,
                VerticalOptions = LayoutOptions.FillAndExpand
            };
            layout.Children.Add (menuLabel);
            layout.Children.Add (Menu);

            Content = layout;
        }
Exemplo n.º 28
0
        public FirstContentView()
        {
            var l = new Label();

            Icon = "settings_vertical.png";

            l.TextColor = Color.FromHex("BBBBBB");
            l.SetBinding(Label.TextProperty, "Title");

            var label = new ContentView
            {
                Padding = new Thickness(10, 0, 0, 5),
                Content = l
            };

            var b = new Button();
            b.Text = "Next page";
            b.SetBinding(Button.CommandProperty, "NextPageCommand");

            var layout = new StackLayout();

            layout.Children.Add(label);
            layout.Children.Add(b);

            Content = layout;
        }
        public Example_LiveTiles()
        {
            Content = new ContentView (); // Temp, This will be overwritten shortly

            Title = "Pseudo LiveTiles";

            timer = new TimerWrapper (new TimeSpan (0, 0, 1), true, TimerElapsedEvt);
        }
Exemplo n.º 30
0
		public BorderEditControl() {
			ContentView border = new ContentView();
			border.BackgroundColor = Color.Blue;
			Content = border;
			editor = new Editor();
			editor.TextChanged += EditorTextChanged;
			border.Content = editor;
		}
Exemplo n.º 31
0
 private void InitializeComponent()
 {
     this.LoadFromXaml(typeof(MainView));
     MainStack = this.FindByName<StackLayout>("MainStack");
     prev_btn = this.FindByName<Button>("prev_btn");
     title_lb = this.FindByName<Label>("title_lb");
     next_btn = this.FindByName<Button>("next_btn");
     overlay = this.FindByName<ContentView>("overlay");
 }
 public MbbDataTemplate(DataTemplateItemsComponent <T> dataTemplateItemsAccessor)
     : base(() =>
 {
     var contentView = new XF.ContentView();
     dataTemplateItemsAccessor.Add(contentView);
     return(contentView);
 })
 {
 }
 private static ElementHandler CreateHandler(XF.Element parent, MobileBlazorBindingsRenderer renderer)
 {
     return(parent switch
     {
         XF.ContentPage contentPage => new ContentPageHandler(renderer, contentPage),
         XF.ContentView contentView => new ContentViewHandler(renderer, contentView),
         XF.Label label => new LabelHandler(renderer, label),
         XF.FlyoutPage flyoutPage => new FlyoutPageHandler(renderer, flyoutPage),
         XF.ScrollView scrollView => new ScrollViewHandler(renderer, scrollView),
         XF.ShellContent shellContent => new ShellContentHandler(renderer, shellContent),
         XF.Shell shell => new ShellHandler(renderer, shell),
         XF.ShellItem shellItem => new ShellItemHandler(renderer, shellItem),
         XF.ShellSection shellSection => new ShellSectionHandler(renderer, shellSection),
         XF.TabbedPage tabbedPage => new TabbedPageHandler(renderer, tabbedPage),
         _ => new ElementHandler(renderer, parent),
     });
Exemplo n.º 34
0
        // Initialise so the Carousel may prepare itself with your first page, ready for viewing.
        public void Initialise(int StartPage = 0, Color? backgroundcolor = null)
        {
            if (Pages == null || Pages.Count == 0)
            {
                throw new Exception("At least one page must be provided to the carousel layout");
            }
            else if (StartPage >= Pages.Count)
            {
                throw new Exception("StartPage cannot exceed layout pages in array.");
            }
            else
            {
                #region Carousel Slide Initialisation

                /* It is important to call the initailise method after instanciating the ManualCarouselView
		 		* object so the first page may contain the content you wish to display. */

                _mainPage = new ContentView()
                {
                    HorizontalOptions = LayoutOptions.FillAndExpand,
                    VerticalOptions = LayoutOptions.FillAndExpand,
                    Content = Pages[StartPage]
                };
                _mainPageSV = new ScrollView()
                {
                    Orientation = ScrollOrientation.Vertical,
                    HorizontalOptions = LayoutOptions.FillAndExpand,
                    VerticalOptions = LayoutOptions.FillAndExpand,
                    Content = _mainPage
                };
                _altPage = new ContentView()
                {
                    HorizontalOptions = LayoutOptions.FillAndExpand,
                    VerticalOptions = LayoutOptions.FillAndExpand,
                    Content = new ContentView()
                };
                _altPageSV = new ScrollView()
                {
                    Orientation = ScrollOrientation.Vertical,
                    HorizontalOptions = LayoutOptions.FillAndExpand,
                    VerticalOptions = LayoutOptions.FillAndExpand,
                    Content = _altPage
                };

                /* It's important that the first and second pages are added to the layout, on top of
				 * eachother so they will be sized correctly when animating in the future */
                _baseLayout.Children.Add(_altPageSV, 0, 1, 0, 1);
                _baseLayout.Children.Add(_mainPageSV, 0, 1, 0, 1);

                #endregion Carousel Slide Initialisation

                if (backgroundcolor.HasValue)
                {
                    _mainPageSV.BackgroundColor = backgroundcolor.Value;
                    _altPageSV.BackgroundColor = backgroundcolor.Value;
                    BackgroundColor = backgroundcolor.Value;
                }

                // As we are showing the first page for the first time, we should trigger the
                // "OnPageAppearing" code
                var iPgContent = Pages[StartPage] as IExtendedCarouselPage;
                Page_Appearing(iPgContent);
                Page_Appeared(iPgContent);

                //Content = _baseLayout;
                _initialised = true;
            }
        }
Exemplo n.º 35
0
        public BubblePopupTestPage()
        {
            BackgroundColor = Color.White;

            var shadowToggle = new Switch();

            shadowToggle.SetBinding(Switch.IsToggledProperty, "HasShadow");
            shadowToggle.BindingContext = this;

            var shadowInvertedToggle = new Switch();

            shadowInvertedToggle.SetBinding(Switch.IsToggledProperty, "ShadowInverted");
            shadowInvertedToggle.BindingContext = this;

            var cornerRadiusSlider = new Slider
            {
                Maximum       = 40,
                Minimum       = 0,
                HeightRequest = 20,
            };

            cornerRadiusSlider.SetBinding(Slider.ValueProperty, "CornerRadius");
            cornerRadiusSlider.BindingContext = this;

            var pointerLengthSlider = new Slider
            {
                Maximum       = 40,
                Minimum       = 0,
                HeightRequest = 20,
            };

            pointerLengthSlider.SetBinding(Slider.ValueProperty, "PointerLength");
            pointerLengthSlider.BindingContext = this;

            var pointerTipRadiusSlider = new Slider
            {
                Maximum       = 20,
                Minimum       = 0,
                HeightRequest = 20,
            };

            pointerTipRadiusSlider.SetBinding(Slider.ValueProperty, "PointerTipRadius");
            pointerTipRadiusSlider.BindingContext = this;

            var paddingSlider = new Slider
            {
                Maximum       = 100,
                Minimum       = 0,
                HeightRequest = 20,
            };

            paddingSlider.SetBinding(Slider.ValueProperty, "PUDPadding");
            paddingSlider.BindingContext = this;

            var pointerCornerRadiusSlider = new Slider
            {
                Maximum       = 20,
                Minimum       = 0,
                HeightRequest = 20,
            };

            pointerCornerRadiusSlider.SetBinding(Slider.ValueProperty, "PointerCornerRadius");
            pointerCornerRadiusSlider.BindingContext = this;

            var leftSeg = new Forms9Patch.Segment
            {
                Text       = "⬅︎",
                IsSelected = true,
            };

            leftSeg.Tapped += (sender, e) => _lastChanged = leftSeg.VisualElement;
            var upSeg = new Forms9Patch.Segment
            {
                Text = "⬆︎",
            };

            upSeg.Tapped += (sender, e) =>
                            _lastChanged = upSeg.VisualElement;
            var rightSeg = new Forms9Patch.Segment
            {
                Text = "➡︎",
            };

            rightSeg.Tapped += (sender, e) => _lastChanged = rightSeg.VisualElement;
            var downSeg = new Forms9Patch.Segment
            {
                Text = "⬇︎",
            };

            downSeg.Tapped += (sender, e) => _lastChanged = downSeg.VisualElement;

            PointerDirection = Forms9Patch.PointerDirection.Left;
            var directionSegmentControl = new Forms9Patch.SegmentedControl
            {
                Segments            = { leftSeg, upSeg, rightSeg, downSeg, },
                GroupToggleBehavior = Forms9Patch.GroupToggleBehavior.Multiselect,
            };

            directionSegmentControl.SegmentTapped += (sender, e) =>
            {
                var dir = Forms9Patch.PointerDirection.None;
                dir |= (leftSeg.IsSelected ? Forms9Patch.PointerDirection.Left : Forms9Patch.PointerDirection.None);
                dir |= (rightSeg.IsSelected ? Forms9Patch.PointerDirection.Right : Forms9Patch.PointerDirection.None);
                dir |= (upSeg.IsSelected ? Forms9Patch.PointerDirection.Up : Forms9Patch.PointerDirection.None);
                dir |= (downSeg.IsSelected ? Forms9Patch.PointerDirection.Down : Forms9Patch.PointerDirection.None);
                PointerDirection = dir;
                System.Diagnostics.Debug.WriteLine("Direction changed");
            };

            var bubbleLabel = new Label
            {
                Text      = "Forms9Patch.BubblePopup",
                TextColor = Color.Black,
                //BackgroundColor = Color.Green,
            };
            var bubbleButton = new Forms9Patch.Button
            {
                Text = "Close",
                //BackgroundColor = Color.Blue,
                OutlineColor = Color.Blue,
                TextColor    = Color.Blue,
            };

            //bubbleLabel.SetBinding (Label.TextProperty, "CornerRadius");
            bubbleLabel.BindingContext = this;

            var addItemButton = new Forms9Patch.Button
            {
                Text         = "Add Item",
                OutlineColor = Color.Black,
                OutlineWidth = 1,
                TextColor    = Color.Red
            };

            var removeItemButton = new Forms9Patch.Button
            {
                Text         = "Remove Item",
                OutlineColor = Color.Black,
                OutlineWidth = 1,
                TextColor    = Color.Red
            };

            var enlargeItemsButton = new Forms9Patch.Button
            {
                Text         = "Englarge Items",
                OutlineColor = Color.Black,
                OutlineWidth = 1,
                TextColor    = Color.Black
            };

            var shrinkItems = new Forms9Patch.Button
            {
                Text         = "Shrink Items",
                OutlineColor = Color.Black,
                OutlineWidth = 1,
                TextColor    = Color.Black
            };

            var stackLayout = new Forms9Patch.StackLayout
            {
                Orientation       = StackOrientation.Horizontal,
                HorizontalOptions = LayoutOptions.Start,
            };
            //stackLayout.Children.Add(new Label { Text = "X,", TextColor = Color.Green });

            var contentView = new Xamarin.Forms.ContentView
            {
                Content           = stackLayout,
                HorizontalOptions = LayoutOptions.Start
            };

            var bubble = new Forms9Patch.BubblePopup(this)
            {
                //BackgroundColor = Color.Green,
                //OutlineColor = Color.Black,
                //OutlineWidth = 1,
                PointerCornerRadius = 0,
                Content             = new StackLayout
                {
                    Children =
                    {
                        bubbleLabel,
                        contentView,
                        new Label {
                            Text = "Padding:",    FontSize            = 10, TextColor = Color.Black
                        },
                        paddingSlider,
                        new Label {
                            Text = "Pointer Length:",FontSize            = 10, TextColor = Color.Black
                        },
                        pointerLengthSlider,
                        new Label {
                            Text = "Pointer Tip Radius:",FontSize            = 10, TextColor = Color.Black
                        },
                        pointerTipRadiusSlider,
                        new Label {
                            Text = "Corner Radius:",FontSize            = 10, TextColor = Color.Black
                        },
                        cornerRadiusSlider,
                        new Label {
                            Text = "Pointer Corner Radius:",FontSize            = 10, TextColor = Color.Black
                        },
                        pointerCornerRadiusSlider,
                        bubbleButton,
                        addItemButton,
                        removeItemButton,
                        enlargeItemsButton,
                        shrinkItems
                    }
                },
            };

            bubble.SetBinding(Forms9Patch.BubblePopup.OutlineRadiusProperty, "CornerRadius");
            bubble.SetBinding(Forms9Patch.BubblePopup.PointerLengthProperty, "PointerLength");
            bubble.SetBinding(Forms9Patch.BubblePopup.PointerTipRadiusProperty, "PointerTipRadius");
            bubble.SetBinding(Forms9Patch.BubblePopup.PaddingProperty, "PUPadding");
            bubble.SetBinding(Forms9Patch.BubblePopup.HasShadowProperty, "HasShadow");
            bubble.SetBinding(Forms9Patch.BubblePopup.ShadowInvertedProperty, "ShadowInverted");
            bubble.SetBinding(Forms9Patch.BubblePopup.PointerDirectionProperty, "PointerDirection");
            bubble.SetBinding(Forms9Patch.BubblePopup.PointerCornerRadiusProperty, "PointerCornerRadius");
            bubble.BindingContext = this;

            //const bool Relayout = false;


            bubbleButton.Tapped  += (sender, e) => bubble.IsVisible = false;
            addItemButton.Tapped += (sender, e) =>
            {
                //var count = stackLayout.Children.Count();
                //stackLayout.Children.Clear();
                //for (int i = 0; i <= count; i++)
                stackLayout.Children.Add(new Label {
                    Text = "X,", TextColor = Color.Green
                });
                //bubble.WidthRequest = 1;
                stackLayout.WidthRequest = -1;
                var size = stackLayout.Measure(double.MaxValue, double.MinValue);
                System.Diagnostics.Debug.WriteLine("WIDTH=[" + stackLayout.Width + "] size.Request.Width=[" + size.Request.Width + "]");
                //stackLayout.WidthRequest = size.Request.Width + 1;
                //this.CallMethod("InvalidateMeasure", new object[] {});
                //contentView.WidthRequest = size.Request.Width;
                stackLayout.Children.Last().IsVisible = true;
            };

            enlargeItemsButton.Tapped += (sender, e) =>
            {
                var count = stackLayout.Children.Count();
                var width = 1;
                if (count > 0)
                {
                    width = ((Label)stackLayout.Children[0]).Text.Length;
                }
                string text = "";
                for (int i = 0; i < width; i++)
                {
                    text += "X";
                }
                text += ",";
                stackLayout.Children.Clear();
                for (int i = 0; i < count; i++)
                {
                    stackLayout.Children.Add(new Label {
                        Text = text, TextColor = Color.Green
                    });
                }
                //bubble.WidthRequest = 1;
                stackLayout.WidthRequest = -1;
                var size = stackLayout.Measure(double.MaxValue, double.MinValue);
                System.Diagnostics.Debug.WriteLine("WIDTH=[" + stackLayout.Width + "] size.Request.Width=[" + size.Request.Width + "]");
                //stackLayout.WidthRequest = size.Request.Width + 1;
                //this.CallMethod("InvalidateMeasure", new object[] {});
                //contentView.WidthRequest = size.Request.Width;
            };

            shrinkItems.Tapped += (sender, e) =>
            {
                var count = stackLayout.Children.Count();
                var width = 1;
                if (count > 0)
                {
                    width = ((Label)stackLayout.Children[0]).Text.Length;
                }
                string text = "";
                for (int i = 0; i < width - 2; i++)
                {
                    text += "X";
                }
                text += ",";
                System.Diagnostics.Debug.WriteLine("Text=[" + text + "]");
                stackLayout.Children.Clear();
                for (int i = 0; i < count; i++)
                {
                    stackLayout.Children.Add(new Label {
                        Text = text, TextColor = Color.Green
                    });
                }
                //bubble.WidthRequest = 1;
                stackLayout.WidthRequest = -1;
                var size = stackLayout.Measure(double.MaxValue, double.MinValue);
                System.Diagnostics.Debug.WriteLine("WIDTH=[" + stackLayout.Width + "] size.Request.Width=[" + size.Request.Width + "]");
            };

            removeItemButton.Tapped += (sender, e) =>
            {
                if (stackLayout.Children.Count > 0)
                {
                    stackLayout.Children.Remove(stackLayout.Children.Last());
                }
            };


            var showButton = new Forms9Patch.Button
            {
                Text         = "Show BubblePopup",
                OutlineColor = Color.Blue,
                TextColor    = Color.Blue,
            };

            showButton.Tapped += (object sender, EventArgs e) =>
            {
                bubble.Target    = _lastChanged;
                bubble.IsVisible = true;
            };

            _lastChanged = leftSeg.VisualElement;

            Content = new StackLayout
            {
                Padding  = 20,
                Children =
                {
                    new StackLayout           {
                        Orientation = StackOrientation.Horizontal,
                        Children    =
                        {
                            new StackLayout   {
                                Children =
                                {
                                    new Label {
                                        Text = "Has Shadow", FontSize = 10, TextColor = Color.Black
                                    },
                                    shadowToggle,
                                },
                                HorizontalOptions = LayoutOptions.StartAndExpand,
                            },
                            new StackLayout   {
                                Children =
                                {
                                    new Label {
                                        Text = "Inset Shadow", FontSize = 10, TextColor = Color.Black
                                    },
                                    shadowInvertedToggle,
                                },
                                HorizontalOptions = LayoutOptions.EndAndExpand,
                            }
                        }
                    },
                    //new Label { Text = "Padding:", FontSize=10, TextColor=Color.Black },
                    //paddingSlider,
                    new Label                 {
                        Text = "Pointer Direction", FontSize = 10, TextColor = Color.Black
                    },
                    directionSegmentControl,
                    showButton,
                    new Label                 {
                        Text = "Arrows choose the BubblePopup's allowed pointer direction.  Bubble's pointer will point at the last selected arrow-segment-button.", TextColor = Color.Black
                    },
                }
            };
        }
Exemplo n.º 36
0
 public void Add(XF.ContentView templateRoot)
 {
     _itemRoots.Add(templateRoot);
     StateHasChanged();
 }
Exemplo n.º 37
0
 public TwoPaneViewPane2Handler(NativeComponentRenderer renderer, XF.ContentView twoPaneView2Control) : base(renderer, twoPaneView2Control)
 {
     TwoPaneView2Control = twoPaneView2Control ?? throw new ArgumentNullException(nameof(twoPaneView2Control));
 }
Exemplo n.º 38
0
 public ContentViewHandler(NativeComponentRenderer renderer, XF.ContentView contentViewControl) : base(renderer, contentViewControl)
 {
     ContentViewControl = contentViewControl ?? throw new System.ArgumentNullException(nameof(contentViewControl));
 }
        public PoliciesWebPage()
        {
            // Set Page Title
            Title = "Pace Policies";

            var source = new UrlWebViewSource ();
            source.Url = "http://pace.edu/sexual-assault";
            var webView = new WebView {
                    HorizontalOptions = LayoutOptions.FillAndExpand,
                    VerticalOptions = LayoutOptions.FillAndExpand,
                    Source = source
            };
            webView.Navigating += (object sender, WebNavigatingEventArgs e) => {
                System.Diagnostics.Debug.WriteLine("Loading");
            };
            webView.Navigated += (object sender, WebNavigatedEventArgs e) => {
                System.Diagnostics.Debug.WriteLine("Done");
            };

            Content = new ContentView {
                Content = new StackLayout {
                    Children = {
                        webView
                    }
                }
            };
        }