當前位置: 首頁>>代碼示例>>C#>>正文


C# Forms.ContentView類代碼示例

本文整理匯總了C#中Xamarin.Forms.ContentView的典型用法代碼示例。如果您正苦於以下問題:C# ContentView類的具體用法?C# ContentView怎麽用?C# ContentView使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ContentView類屬於Xamarin.Forms命名空間,在下文中一共展示了ContentView類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: MenuPage2

        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;
        }
開發者ID:Kalle-kula,項目名稱:TestApp,代碼行數:28,代碼來源:MenuPage2.cs

示例2: AlertDetailsPage

        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
                    }
                }
            };
        }
開發者ID:PaceCreativeLabs,項目名稱:PaceSafety-App,代碼行數:32,代碼來源:AlertDetailsPage.cs

示例3: RenderContent

        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;
        }
開發者ID:Jake-a-Lake,項目名稱:GaragePrincess,代碼行數:26,代碼來源:StartPage.cs

示例4: PoliciesWebPage

        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
                    }
                }
            };
        }
開發者ID:PaceCreativeLabs,項目名稱:PaceSafety-App,代碼行數:27,代碼來源:PoliciesWebPage.cs

示例5: TitleIXPage

        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
                    }
                }
            };
        }
開發者ID:PaceCreativeLabs,項目名稱:PaceSafety-App,代碼行數:27,代碼來源:TitleIXPage.cs

示例6: MenuPage

        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;
        }
開發者ID:cthorne,項目名稱:TeamBPlus,代碼行數:27,代碼來源:MenuPage.cs

示例7: InitializeComponent

 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");
 }
開發者ID:JavierErdozain,項目名稱:Events,代碼行數:7,代碼來源:StandingsView.xaml.g.cs

示例8: AlertPage

        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
                    }
                }
            };
        }
開發者ID:PaceCreativeLabs,項目名稱:PaceSafety-App,代碼行數:27,代碼來源:AlertPage.cs

示例9: MenuPage

        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;
        }
開發者ID:jarade,項目名稱:IAB330Project,代碼行數:30,代碼來源:MenuPage.cs

示例10: MenuPage

        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;
        }
開發者ID:AzureDay,項目名稱:2016-MobileApp,代碼行數:29,代碼來源:MenuPage.cs

示例11: BorderDisplayControl

		public BorderDisplayControl() {
			ContentView border = new ContentView();
			border.BackgroundColor = Color.Green;
			Content = border;
			label = new Label();
			border.Content = label;
		}
開發者ID:RMDesenvolvimento,項目名稱:Xamarin,代碼行數:7,代碼來源:BorderEditControl.cs

示例12: LeadListHeaderView

        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;
        }
開發者ID:XnainA,項目名稱:app-crm,代碼行數:60,代碼來源:LeadListHeaderView.cs

示例13: InitializeComponent

 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");
 }
開發者ID:LordOfSmiles,項目名稱:MatrixBuilderTest,代碼行數:30,代碼來源:MatrixBuilderTest.Views.MatrixView.xaml.g.cs

示例14: MenuPage

        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;
        }
開發者ID:henrytranvan,項目名稱:HSFFinance,代碼行數:25,代碼來源:MenuPage.cs

示例15: NewImagePage

        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;
        }
開發者ID:private-boolean,項目名稱:GestureSample,代碼行數:34,代碼來源:NewImagePage.cs


注:本文中的Xamarin.Forms.ContentView類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。