当前位置: 首页>>代码示例>>C#>>正文


C# Forms.View类代码示例

本文整理汇总了C#中Xamarin.Forms.View的典型用法代码示例。如果您正苦于以下问题:C# View类的具体用法?C# View怎么用?C# View使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


View类属于Xamarin.Forms命名空间,在下文中一共展示了View类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: QuestionInputViewContainer

        public QuestionInputViewContainer(IQuestion question, View view, SurveyPageAppearance appearance)
        {
            view.HorizontalOptions = LayoutOptions.FillAndExpand;

            var errorLabel = new Label {
                Style = appearance.QuestionErrorLabelStyle,
                Text = String.Empty,
                IsVisible = false,
                HorizontalOptions = LayoutOptions.FillAndExpand
            };

            question.PropertyChanged += (sender, e) => {
                if (e.PropertyName == "HasError") {
                    if (question.HasError) {
                        errorLabel.Text = question.ErrorMessage;
                        errorLabel.IsVisible = true;
                    } else {
                        errorLabel.IsVisible = false;
                    }
                }
            };

            Content = new StackLayout {
                Orientation = StackOrientation.Vertical,
                Style = appearance.QuestionInputViewContainerLayoutStyle,
                Children = {
                    view,
                    errorLabel
                }
            };
        }
开发者ID:davidjcaton,项目名称:glowingbrain-data-capture,代码行数:31,代码来源:QuestionInputViewContainer.cs

示例2: Disposing

 public override void Disposing(View content, PopupPage page)
 {
     if (HasBackgroundAnimation && page.BackgroundImage == null)
     {
         page.BackgroundColor = _backgroundColor;
     }
 }
开发者ID:rotorgames,项目名称:Rg.Plugins.Popup,代码行数:7,代码来源:FadeBackgroundAnimation.cs

示例3: QuestionContainerView

        public QuestionContainerView(ISurveyItem item, View questionView, SurveyPageAppearance appearance)
        {
            var headerView = new QuestionHeaderView (item, appearance) {
                VerticalOptions = LayoutOptions.Start
            };

            var inputStackLayout = new StackLayout () {
                Style = appearance.QuestionContainerLayoutStyle,
                Children = {
                    StandardViews.CreateSeparator (appearance.ItemSeperatorStyle),
                    questionView,
                    StandardViews.CreateSeparator (appearance.ItemSeperatorStyle)
                }
            };

            var stackLayout = new StackLayout {
                HorizontalOptions = LayoutOptions.FillAndExpand,
                Children = {
                    headerView,
                    inputStackLayout,
                }
            };

            if (!String.IsNullOrWhiteSpace (item.Footnote)) {
                var footerView = new QuestionFooterView (item, appearance);
                stackLayout.Children.Add (footerView);
            }

            Content = stackLayout;
        }
开发者ID:davidjcaton,项目名称:glowingbrain-data-capture,代码行数:30,代码来源:QuestionContainerView.cs

示例4: AnimationListAdd

        public void AnimationListAdd(View view)
        {
            if (!isListShowed)
                view.RotationX = 90;

            animationList.Add(view);
        }
开发者ID:asthanarht,项目名称:XamarinDiscountsApp,代码行数:7,代码来源:ListViewAnimation.cs

示例5: AddToContext

        public void AddToContext(View view, bool inputTransparent = true)
        {
            panelLayout.Children.RemoveAt(panelLayout.Children.Count - 1);

            if (inputTransparent)
            {
                var viewGestures = new ViewGestures();
                viewGestures.Content = view;
                viewGestures.BackgroundColor = BackgroundColor;

                viewGestures.Tap += (s, e) => { OnClick(); };
                if (panelAlignEnum == PanelAlignEnum.paLeft)
                    viewGestures.SwipeLeft += (s, e) => { OnClick(); };
                else if (panelAlignEnum == PanelAlignEnum.paRight)
                    viewGestures.SwipeRight += (s, e) => { OnClick(); };

                AddView(viewGestures);
                previousView = viewGestures;
            }
            else
            {
                AddView(view);
                previousView = view;
            }

            CloseContext();
        }
开发者ID:emcconnell,项目名称:ScnSideMenu,代码行数:27,代码来源:SideBarPanel.cs

示例6: ShowPopup

		/// <summary>
		/// Shows the _popup centered to the parent view.
		/// </summary>
		/// <param name="popupView">The _popup view.</param>
		public void ShowPopup(View popupView) {
			ShowPopup(
				popupView,
				Constraint.RelativeToParent(p => (Width - _popup.WidthRequest) / 2),
				Constraint.RelativeToParent(p => (Height -_popup.HeightRequest) / 2)
				);
		}
开发者ID:Vorkeal,项目名称:LeagueStatsMobile,代码行数:11,代码来源:PopupLayout.cs

示例7: Appearing

        public async override Task Appearing(View content, PopupPage page)
        {
            var taskList = new List<Task>();

            taskList.Add(base.Appearing(content, page));

            if (content != null)
            {
                var topOffset = GetTopOffset(content, page);
                var leftOffset = GetLeftOffset(content, page);

                if (PositionIn == MoveAnimationOptions.Top)
                {
                    content.TranslationY = -topOffset;
                }
                else if (PositionIn == MoveAnimationOptions.Bottom)
                {
                    content.TranslationY = topOffset;
                }
                else if (PositionIn == MoveAnimationOptions.Left)
                {
                    content.TranslationX = -leftOffset;
                }
                else if (PositionIn == MoveAnimationOptions.Right)
                {
                    content.TranslationX = leftOffset;
                }

                taskList.Add(content.TranslateTo(_defaultTranslationX, _defaultTranslationY, DurationIn, EasingIn));
            }

            page.IsVisible = true;

            await Task.WhenAll(taskList);
        }
开发者ID:rotorgames,项目名称:Rg.Plugins.Popup,代码行数:35,代码来源:MoveAnimation.cs

示例8: Create

        /// <summary>
        /// Instantiate a new <see cref="PopupTappedEventArgs"/>
        /// </summary>
        /// <param name="popup">The popup that was tapped</param>
        /// <param name="view">The view that was tapped</param>
        /// <returns></returns>
        public static PopupTappedEventArgs Create(Popup popup, View view)
        {
            PopupSectionType housingSectionType;

            var parentView = view.FindParent(ve =>
            {
                var parentSectionType = ve.GetValue(Popup.SectionTypeProperty);
                var currentSection = (PopupSectionType)parentSectionType;

                return currentSection == PopupSectionType.Body
                       || currentSection == PopupSectionType.Footer
                       || currentSection == PopupSectionType.Header;
            });

            if (parentView == null)
            {
                housingSectionType = PopupSectionType.Backdrop;
            }
            else
            {
                housingSectionType = (PopupSectionType)parentView.GetValue(Popup.SectionTypeProperty);
            }

            var controlType = (PopupSectionType)view.GetValue(Popup.SectionTypeProperty);
            var evt = new PopupTappedEventArgs
            {
                Popup = popup,
                ControlTapped = view,
                IsUserControl = controlType == PopupSectionType.NotSet,
                Section = housingSectionType
            };

            return evt;
        }
开发者ID:michaeled,项目名称:FormsPopup,代码行数:40,代码来源:PopupTappedEventArgs.cs

示例9: ContainsTransaction

        public bool ContainsTransaction(View view)
        {
            if(view == null)
                throw new ArgumentNullException("view");

            return _transactions.ContainsKey(view);
        }
开发者ID:LuisAlbertoPenaNunez,项目名称:Marioneta,代码行数:7,代码来源:RelativeBuilderTransactionManager.cs

示例10: OnClick

            public void OnClick(View view)
            {
                var renderer = view.Tag as AppCompatButtonRenderer;

                if (renderer != null)
                    renderer.Element.InvokeSendClicked();
            }
开发者ID:jdluzen,项目名称:oss-xamarin,代码行数:7,代码来源:AppCompatButtonRenderer.cs

示例11: ShadowBoxCell

        public ShadowBoxCell(View content, double boxHeight, double boxWidth)
        {
            BoxWidth = boxWidth;
            BoxHeight = boxHeight;

            var frameImage = new Frame {
                Padding = 5,
                Content = content,
                BackgroundColor = Color.White,
                HasShadow = false,
                VerticalOptions = LayoutOptions.Center,
                HorizontalOptions = LayoutOptions.Center,
                OutlineColor = Color.Black,
                HeightRequest = BoxHeight,
                WidthRequest = BoxWidth,
                MinimumHeightRequest = BoxHeight,
                MinimumWidthRequest = BoxWidth,
            };

            var frameBackground1 = new Frame {
                Padding = 5,
                BackgroundColor = Color.Gray,
                HasShadow = false,
                VerticalOptions = LayoutOptions.Center,
                HorizontalOptions = LayoutOptions.Center,
                OutlineColor = Color.Black,
                HeightRequest = BoxHeight,
                WidthRequest = BoxWidth,
                MinimumHeightRequest = BoxHeight,
                MinimumWidthRequest = BoxWidth,
            };

            var grid = new Grid {
                RowSpacing = 0,
                Padding = new Thickness (0, 0, 0, 0),
            };

            grid.RowDefinitions.Add (new RowDefinition { Height = new GridLength (300) });
            grid.ColumnDefinitions.Add (new ColumnDefinition { Width = new GridLength (300) });

            var relativeLayout = new RelativeLayout ();

            relativeLayout.Children.Add (frameBackground1,
                Constraint.Constant (2),
                Constraint.Constant (2)
            );

            relativeLayout.Children.Add (frameImage,
                Constraint.RelativeToView (frameBackground1, (parent, sibling) => {
                    return sibling.X - 1;
                }),
                Constraint.RelativeToView (frameBackground1, (parent, sibling) => {
                    return sibling.Y - 1;
                }));

            grid.Children.Add (relativeLayout, 0, 0);

            Content = grid;
        }
开发者ID:jefferson-silva-maboobr,项目名称:Signos,代码行数:59,代码来源:ShadowBoxCell.cs

示例12: Preparing

 public override void Preparing(View content, PopupPage page)
 {
     if (HasBackgroundAnimation && page.BackgroundImage == null)
     {
         _backgroundColor = page.BackgroundColor;
         page.BackgroundColor = GetColor(0);
     }
 }
开发者ID:rotorgames,项目名称:Rg.Plugins.Popup,代码行数:8,代码来源:FadeBackgroundAnimation.cs

示例13: GetTransactionFor

        public Transaction GetTransactionFor(View view)
        {
            var transaction = _transactions.First(x => x.Key == view);

            var transactionValue = transaction.Value;

            return transactionValue;
        }
开发者ID:LuisAlbertoPenaNunez,项目名称:Marioneta,代码行数:8,代码来源:RelativeBuilderTransactionManager.cs

示例14: ShowPopup

 /// <summary>
 /// Shows the popup centered to the parent view.
 /// </summary>
 /// <param name="popupView">The popup view.</param>
 public void ShowPopup(View popupView)
 {
     this.ShowPopup(
         popupView,
         Constraint.RelativeToParent(p => (this.Width - this.popup.WidthRequest) / 2),
         Constraint.RelativeToParent(p => (this.Height- this.popup.HeightRequest) / 2)
         );
 }
开发者ID:Jaskomal,项目名称:Xamarin-Forms-Labs,代码行数:12,代码来源:PopupLayout.cs

示例15: ViewWithGridPosition

 public ViewWithGridPosition(View view, int row, int column, int rowSpan = 1, int columnSpan = 1)
 {
     this.View = view;
       this.Row = row;
       this.RowSpan = rowSpan;
       this.Column = column;
       this.ColumnSpan = columnSpan;
 }
开发者ID:dotnetautor,项目名称:FeedReader2015,代码行数:8,代码来源:GridHelper.cs


注:本文中的Xamarin.Forms.View类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。