xamarin可视 对讲_CarouselPage

Xamarin.Forms 的 CarouselPage 类提供了一个用户可以通过左右滑动查看内容页的界面,类似于图片库。它可以为Windows Phone用户提供熟悉的操作体验。开发者可以自定义导航,例如在Android和iOS上使用NavigationPage,在Windows Phone上使用CarouselPage。通过XAML或C#代码,可以创建包含多个ContentPage的CarouselPage。在将CarouselPage嵌入Detail时,应设置IsGestureEnabled为false以避免与MasterDetailPage的手势冲突。
摘要由CSDN通过智能技术生成

CarouselPage 类

定义

程序集:Xamarin.Forms.Core.dll

一个页面,用户可从一侧轻扫到另一侧以显示内容页,就像库一样。A Page that users can swipe from side to side to display pages of content, like a gallery.

本文内容

[Xamarin.Forms.RenderWith(typeof(Xamarin.Forms.Platform._CarouselPageRenderer))]

public class CarouselPage : Xamarin.Forms.MultiPage, Xamarin.Forms.IElementConfiguration

type CarouselPage = class

inherit MultiPage

interface IElementConfiguration

注解

CarouselPage提供了一种 Windows Phone 用户非常熟悉的导航体验。The CarouselPage provides a navigation experience that will feel natural and familiar to Windows Phone users. 通过使用 TargetPlatform ,应用程序开发人员可以根据每个平台提供自定义导航。By using TargetPlatform, application developers can provide customized navigation on a per-platform basis. 例如,应用程序开发人员可以使用 NavigationPage 适用于 Android 和 iOS 的,并 CarouselPage 在 Windows Phone 上使用。For example, an application developer could use a NavigationPage for Android and iOS, and use a CarouselPage on Windows Phone.

下面的 XAML 示例(当正确包含并在 Xamarin 窗体项目中引用)创建一个 CarouselPage ,它显示三个简单 ContentPage 元素:The following XAML example, when properly included and referenced in a Xamarin.Forms project, creates a CarouselPage that displays three simple ContentPage elements:

<?xml version="1.0" encoding="UTF-8"?>

<CarouselPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="XamlExample1.MyPage">

<ContentPage>

<StackLayout>

<Label Text="Red" />

<BoxView Color="Red" VerticalOptions="FillAndExpand" />

</StackLayout>

</ContentPage>

<ContentPage>

<StackLayout>

<Label Text="Green" />

<BoxView Color="Green" VerticalOptions="FillAndExpand" />

</StackLayout>

</ContentPage>

<ContentPage>

<StackLayout>

<Label Text="Blue" />

<BoxView Color="Blue" VerticalOptions="FillAndExpand" />

</StackLayout>

</ContentPage>

</CarouselPage>

下面的 c # 示例创建一个 CarouselPage ,它显示三个简单 ContentPage 元素:The following C# example creates a CarouselPage that displays three simple ContentPage elements:

List<ContentPage> pages = new List<ContentPage> (0);

Color[] colors = { Color.Red, Color.Green, Color.Blue };

foreach (Color c in colors) {

pages.Add (new ContentPage { Content = new StackLayout {

Children = {

new Label { Text = c.ToString () },

new BoxView {

Color = c,

VerticalOptions = LayoutOptions.FillAndExpand

}

}

}

});

}

MainPage = new CarouselPage {

Children = { pages [0],

pages [1],

pages [2] }

};

将 CarouselPage 嵌入到时 Detail ,应用程序开发人员应将设置 IsGestureEnabled 为, false 以防止在 CarouselPage 和 MasterDetailPage 之间发生手势冲突。When embedding a CarouselPage into a Detail, application developers should set IsGestureEnabled to false to prevent gesture conflicts between the CarouselPage and MasterDetailPage.

构造函数

初始化 CarouselPage 类的新实例。Initializes a new instance of the CarouselPage class.

字段

此方法仅供内部使用。This method is for internal use.

(继承自 Page)

此方法仅供内部使用。This method is for internal use.

(继承自 Page)

此方法仅供内部使用。This method is for internal use.

(继承自 Page)

属性

获取或设置任何转换的中心点的 X 部分,相对于元素的边界。Gets or sets the X component of the center point for any transform, relative to the bounds of the element. 这是一种可绑定属性。This is a bindable property.

(继承自 VisualElement)

获取或设置任何转换的中心点的 Y 部分,相对于元素的边界。Gets or sets the Y component of the center point for any transform, relative to the bounds of the element. 这是一种可绑定属性。This is a bindable property.

(继承自 VisualElement)

获取或设置允许自动化框架查找此元素并与其交互的值。Gets or sets a value that allows the automation framework to find and interact with this element.

(继承自 Element)

获取或设置将填充 VisualElement 背景的颜色。Gets or sets the color which will fill the background of a VisualElement. 这是一种可绑定属性。This is a bindable property.

(继承自 VisualElement)

已过时。

标识用作 Page 的背景的图像。Identifies the image used as a background for the Page.

(继承自 Page)

供 Xamarin.Forms 平台内部使用。For internal use by the Xamarin.Forms platform.

(继承自 VisualElement)

获取与此元素关联的 Behavior 列表。Gets the list of Behaviors associated to this element. 这是一种可绑定属性。This is a bindable property.

(继承自 VisualElement)

获取或设置对象,该对象包含将被属于此 BindableObject 的绑定属性设定为目标的属性。Gets or sets object that contains the properties that will be targeted by the bound properties that belong to this BindableObject.

(继承自 BindableObject)

获取元素的边界。Gets the bounds of the element.

(继承自 VisualElement)

获取 MultiPage 的子元素的 IList。Gets an IList of child elements of the MultiPage.

(继承自 MultiPage)

获取或设置用于标识语义相似元素集合的值。Gets or sets a value used to identify a collection of semantically similar elements.

(继承自 Element)

供 Xamarin.Forms 平台内部使用。For internal use by the Xamarin.Forms platform.

(继承自 Page)

获取或设置当前选定的页面。Gets or sets the currently selected page.

(继承自 MultiPage)

供 Xamarin.Forms 平台内部使用。For internal use by the Xamarin.Forms platform.

(继承自 VisualElement)

供 Xamarin.Forms 平台内部使用。For internal use by the Xamarin.Forms platform.

(继承自 Element)

应用于此项的效果列表。A list of the effects that are applied to this item.

(继承自 Element)

获取或设置布局流方向。Gets or sets the layout flow direction.

(继承自 VisualElement)

获取此元素的当前呈现高度。Gets the current rendered height of this element. 这是一种只读可绑定属性。This is a read-only bindable property.

(继承自 VisualElement)

获取或设置此元素的所需高度替代。Gets or sets the desired height override of this element.

(继承自 VisualElement)

已过时。

Page 的关联图标的资源标识符。Resource identifier for the Page's associated icon.

(继承自 Page)

获取可用于通过运行应用程序唯一地标识元素的值。Gets a value that can be used to uniquely identify an element through the run of an application.

(继承自 Element)

供 Xamarin.Forms 平台内部使用。For internal use by the Xamarin.Forms platform.

(继承自 Page)

获取或设置一个值,该值指示此元素是否应涉及用户交互周期。Gets or sets a value indicating whether this element should be involved in the user interaction cycle. 这是一种可绑定属性。This is a bindable property.

(继承自 VisualElement)

供 Xamarin.Forms 平台内部使用。For internal use by the Xamarin.Forms platform.

(继承自 Page)

将页标记为忙。Marks the Page as busy. 这会导致特定于平台的全局活动指示器显示忙碌状态。This will cause the platform specific global activity indicator to show a busy state.

(继承自 Page)

获取或设置一个值,该值指示是否在用户界面中启用此元素。Gets or sets a value indicating whether this element is enabled in the user interface. 这是一种可绑定属性。This is a bindable property.

(继承自 VisualElement)

获取一个值,该值指示当前是否聚焦此元素。Gets a value indicating whether this element is focused currently. 这是一种可绑定属性。This is a bindable property.

(继承自 VisualElement)

供 Xamarin.Forms 平台内部使用。For internal use by the Xamarin.Forms platform.

(继承自 VisualElement)

供 Xamarin.Forms 平台内部使用。For internal use by the Xamarin.Forms platform.

(继承自 VisualElement)

供 Xamarin.Forms 平台内部使用。For internal use by the Xamarin.Forms platform.

(继承自 VisualElement)

获取或设置指明此元素是否包含在选项卡导航中的值。Gets or sets a value that indicates whether this element is included in tab navigation. 这是一种可绑定属性。This is a bindable property.

(继承自 VisualElement)

获取或设置一个值,该值确定此元素是否应属于可视化树的一部分。Gets or sets a value that determines whether this elements should be part of the visual tree or not. 这是一种可绑定属性。This is a bindable property.

(继承自 VisualElement)

要显示的项的源。The source for the items to be displayed.

(继承自 MultiPage)

用于显示项的模板。The template for displaying items.

(继承自 MultiPage)

供 Xamarin.Forms 平台内部使用。For internal use by the Xamarin.Forms platform.

(继承自 Element)

获取或设置一个值,该值将替代元素在布局期间请求的最小高度。Gets or sets a value which overrides the minimum height the element will request during layout.

(继承自 VisualElement)

获取或设置一个值,该值将替代元素在布局期间请求的最小宽度。Gets or sets a value which overrides the minimum width the element will request during layout.

(继承自 VisualElement)

获取或设置呈现元素时应用于元素的不透明度值。Gets or sets the opacity value applied to the element when it is rendered. 这是一种可绑定属性。This is a bindable property.

(继承自 VisualElement)

Page 的内容与其边框之间的空间。The space between the content of the Page and it's border.

(继承自 Page)

获取或设置元素的父元素。Gets or sets the parent element of the element.

(继承自 Element)

已过时。

获取作为 VisualElement 的此元素的最近的上级元素。Gets the element which is the closest ancestor of this element that is a VisualElement.

(继承自 Element)

供 Xamarin.Forms 平台内部使用。For internal use by the Xamarin.Forms platform.

(继承自 Element)

获取或设置本地资源字典。Gets or sets the local resource dictionary.

(继承自 VisualElement)

获取或设置呈现元素时围绕 Z 轴的旋转(仿射旋转)。Gets or sets the rotation about the Z-axis (affine rotation) when the element is rendered.

(继承自 VisualElement)

获取或设置呈现元素时围绕 X 轴的旋转(透视旋转)。Gets or sets the rotation about the X-axis (perspective rotation) when the element is rendered.

(继承自 VisualElement)

获取或设置呈现元素时围绕 Y 轴的旋转(透视旋转)。Gets or sets the rotation about the Y-axis (perspective rotation) when the element is rendered.

(继承自 VisualElement)

获取或设置应用于元素的比例因子。Gets or sets the scale factor applied to the element.

(继承自 VisualElement)

获取或设置要应用于 X 方向的缩放值。Gets or sets a scale value to apply to the X direction.

(继承自 VisualElement)

获取或设置要应用于 Y 方向的缩放值。Gets or sets a scale value to apply to the Y direction.

(继承自 VisualElement)

当前选定的项。The currently selected item.

(继承自 MultiPage)

获取或设置用于唯一地标识元素的用户定义的值。Gets or sets a user defined value to uniquely identify the element.

(继承自 Element)

Page 的标题。The Page's title.

(继承自 Page)

一组 ToolbarItem,以特定于平台的方式实现。A set of ToolbarItems, implemented in a platform-specific manner.

(继承自 Page)

获取或设置元素的 X 转换增量。Gets or sets the X translation delta of the element.

(继承自 VisualElement)

获取或设置元素的 Y 转换增量。Gets or sets the Y translation delta of the element.

(继承自 VisualElement)

获取与此元素关联的 Trigger 列表。Gets the list of Trigger associated to this element. 这是一种可绑定属性。This is a bindable property.

(继承自 VisualElement)

获取此元素的当前呈现宽度。Gets the current rendered width of this element. 这是一种只读可绑定属性。This is a read-only bindable property.

(继承自 VisualElement)

获取或设置此元素的所需宽度替代。Gets or sets the desired width override of this element.

(继承自 VisualElement)

获取此元素的当前 X 位置。Gets the current X position of this element. 这是一种只读可绑定属性。This is a read-only bindable property.

(继承自 VisualElement)

获取此元素的当前 Y 位置。Gets the current Y position of this element. 这是一种只读可绑定属性。This is a read-only bindable property.

(继承自 VisualElement)

方法

表示开始对元素属性进行批更改。Signals the start of a batch of changes to the elements properties.

(继承自 VisualElement)

表示元素命令批处理结束,且现在应提交命令。Signals the end of a batch of commands to the element and that those commands should now be committed.

(继承自 VisualElement)

供 Xamarin.Forms 平台内部使用。For internal use by the Xamarin.Forms platform.

(继承自 VisualElement)

清除由 SetValue 为 property 设置的任何值。Clears any value set by SetValue for property.

(继承自 BindableObject)

清除由 SetValue 为 propertyKey 标识的属性设置的任何值。Clears any value set by SetValue for the property that is identified by propertyKey.

(继承自 BindableObject)

为对象创建一个适合在此处CarouselPage显示的默认页。Creates a default page, suitable for display in thisCarouselPage, for an object.

供 Xamarin.Forms 平台内部使用。For internal use by the Xamarin.Forms platform.

(继承自 Element)

显示本机平台操作工作表,允许应用程序用户从多个按钮中进行选择。Displays a native platform action sheet, allowing the application user to choose from several buttons.

(继承自 Page)

使用单个取消按钮向应用程序用户显示警报对话框。Presents an alert dialog to the application user with a single cancel button.

(继承自 Page)

使用接受和取消按钮向应用程序用户显示警报对话框。Presents an alert dialog to the application user with an accept and a cancel button.

(继承自 Page)

供 Xamarin.Forms 平台内部使用。For internal use by the Xamarin.Forms platform.

(继承自 Element)

返回具有指定名称的元素。Returns the element that has the specified name.

(继承自 Element)

尝试将焦点设定到此元素上。Attemps to set focus to this element.

(继承自 VisualElement)

强制 Page 执行布局处理过程。Forces the Page to perform a layout pass.

(继承自 Page)

供 Xamarin.Forms 平台内部使用。For internal use by the Xamarin.Forms platform.

(继承自 MultiPage)

已过时。

Returns the SizeRequest of the element. 调用此方法开始布局循环的测量过程。Calling this method begins the measure pass of a layout cycle.

(继承自 VisualElement)

返回 BindableProperty 中包含的值。Returns the value that is contained in the BindableProperty.

(继承自 BindableObject)

已过时。

供 Xamarin.Forms 平台内部使用。For internal use by the Xamarin.Forms platform.

(继承自 BindableObject)

已过时。

供 Xamarin.Forms 平台内部使用。For internal use by the Xamarin.Forms platform.

(继承自 BindableObject)

调用此方法以使此 VisualElement 的布局无效。Method that is called to invalidate the layout of this VisualElement.

(继承自 VisualElement)

供 Xamarin.Forms 平台内部使用。For internal use by the Xamarin.Forms platform.

(继承自 VisualElement)

如果目标属性存在并且已设置,则返回 true。Returns true if the target property exists and has been set.

(继承自 BindableObject)

在布局循环中更新元素的边界。Updates the bounds of the element during the layout cycle.

(继承自 VisualElement)

返回在设备上显示可视元素所需的最小大小。Returns the minimum size that a visual element needs in order to be displayed on the device.

(继承自 VisualElement)

供 Xamarin.Forms 平台内部使用。For internal use by the Xamarin.Forms platform.

(继承自 VisualElement)

返回此 CarouselPage 的特定于平台的实例,可对其调用特定于平台的方法。Returns the platform-specific instance of this CarouselPage, on which a platform-specific method may be called.

替代后,允许应用程序开发者在 Page 变为可见之前立即自定义行为。When overridden, allows application developers to customize behavior immediately prior to the Page becoming visible.

(继承自 Page)

按下“后退”按钮时引发的事件。Event that is raised when the back button is pressed.

(继承自 MultiPage)

每当 Page 的绑定上下文发生更改时就会调用。Invoked whenever the binding context of the Page changes. 重写此方法可为此事件添加类处理。Override this method to add class handling for this event.

(继承自 Page)

Called when a child has been added to the MultiPage.

(继承自 MultiPage)

指示子级 Element 的首选大小已更改。Indicates that the preferred size of a child Element has changed.

(继承自 Page)

应用程序开发者可以重写此方法以在删除子级时进行响应。Application developers can override this method to respond when a child is removed.

(继承自 VisualElement)

Invoked whenever the ChildrenReordered event is about to be emitted. 实现此方法可为此事件添加类处理。Implement this method to add class handling for this event.

(继承自 VisualElement)

替代后,允许应用程序开发者在 Page 消失时自定义行为。When overridden, allows the application developer to customize behavior as the Page disappears.

(继承自 Page)

进行布局测量时调用的方法。Method that is called when a layout measurement happens.

(继承自 VisualElement)

当 Page 的 Parent 属性更改时调用。Called when the Page's Parent property has changed.

(继承自 Page)

在可绑定属性更改时调用。Called when a bindable property has changed.

(继承自 MultiPage)

从子类调用此方法以通知属性将要发生更改。Call this method from a child class to notify that a change is going to happen on a property.

(继承自 BindableObject)

指示已为 Page 分配了大小。Indicates that the Page has been assigned a size.

(继承自 Page)

已过时。

此方法在对布局循环的测量过程中调用,以获取需要的元素大小。This method is called during the measure pass of a layout cycle to get the desired size of an element.

(继承自 VisualElement)

删除先前设置的绑定。Removes a previously set binding.

(继承自 BindableObject)

移除先前设置的动态资源Removes a previously set dynamic resource

(继承自 Element)

供 Xamarin.Forms 平台内部使用。For internal use by the Xamarin.Forms platform.

(继承自 Page)

供 Xamarin.Forms 平台内部使用。For internal use by the Xamarin.Forms platform.

(继承自 Page)

将此元素的 BindableProperty 属性设置为通过 DynamicResource 使用提供的键来更新。Sets the BindableProperty property of this element to be updated via the DynamicResource with the provided key.

(继承自 Element)

若在派生类中被替代,则执行 content 的初始化。When overridden in a derived class, performs initialization of content.

(继承自 MultiPage)

设置指定属性的值。Sets the value of the specified property.

(继承自 BindableObject)

设置 propertyKey 的值。Sets the value of the propertyKey.

(继承自 BindableObject)

供 Xamarin.Forms 平台内部使用。For internal use by the Xamarin.Forms platform.

(继承自 BindableObject)

供 Xamarin.Forms 平台内部使用。For internal use by the Xamarin.Forms platform.

(继承自 Element)

供 Xamarin.Forms 平台内部使用。For internal use by the Xamarin.Forms platform.

(继承自 Element)

在布局循环过程中调用 SizeAllocated 以指示子树布局的开始。SizeAllocated is called during a layout cycle to signal the start of a sub-tree layout.

(继承自 VisualElement)

不应用所有以前设置的绑定。Unapplies all previously set bindings.

(继承自 BindableObject)

取消设置此元素的焦点。Unsets focus to this element.

(继承自 VisualElement)

应用程序开发人员替代此方法,以便为在 SetupContent(T, Int32) 中注册的项取消注册事件处理程序。Application developers override this method to unregister event handlers for items that they registered in SetupContent(T, Int32).

(继承自 MultiPage)

请求 Page 的子级 Element 更新其布局。Requests that the children Elements of the Page update their layouts.

(继承自 Page)

事件

指示将显示 Page。Indicates that the Page is about to appear.

(继承自 Page)

供 Xamarin.Forms 平台内部使用。For internal use by the Xamarin.Forms platform.

(继承自 VisualElement)

每当将子元素添加到元素时就会发生。Occurs whenever a child element is added to the element.

(继承自 Element)

每当从元素中删除子元素时就会发生。Occurs whenever a child element is removed from the element.

(继承自 Element)

重新排序 VisualElement 的子级时发生。Occurs when the Children of a VisualElement have been re-ordered.

(继承自 VisualElement)

每当将子元素添加到元素子树时就会发生。Occurs whenever a child element is added to the elements subtree.

(继承自 Element)

每当从元素子树中删除子元素时就会发生。Occurs whenever a child element is removed from the elements subtree.

(继承自 Element)

指示 Page 即将停止显示。Indicates that the Page is about to cease displaying.

(继承自 Page)

供 Xamarin.Forms 平台内部使用。For internal use by the Xamarin.Forms platform.

(继承自 VisualElement)

元素接收焦点时发生。Occurs when the element receives focus.

(继承自 VisualElement)

已更改 Page 的布局时引发。Raised when the layout of the Page has changed.

(继承自 Page)

可视元素的布局无效时引发的事件。Event that is raised when the layout of a visual element is invalidated.

(继承自 VisualElement)

Raised when the children pages of the MultiPage have changed.

(继承自 MultiPage)

在属性已更改时引发。Raised when a property has changed.

(继承自 BindableObject)

在属性将要更改时引发。Raised when a property is about to change.

(继承自 BindableObject)

当此元素上的 Width 或 Height 属性的值发生更改时发生。Occurs when either the Width or the Height properties change value on this element.

(继承自 VisualElement)

当元素丢失焦点时发生。Occurs when the element loses focus.

(继承自 VisualElement)

显式接口实现

供 Xamarin.Forms 平台内部使用。For internal use by the Xamarin.Forms platform.

(继承自 Element)

供 Xamarin.Forms 平台内部使用。For internal use by the Xamarin.Forms platform.

(继承自 MultiPage)

供 Xamarin.Forms 平台内部使用。For internal use by the Xamarin.Forms platform.

(继承自 MultiPage)

供 Xamarin.Forms 平台内部使用。For internal use by the Xamarin.Forms platform.

(继承自 MultiPage)

获取平台上元素的有效可视流方向,考虑区域设置和逻辑流设置。Gets the effective visual flow direction for the element on the platform, taking into account the locale and logical flow settings.

(继承自 VisualElement)

扩展方法

返回一个布尔值,该值指示 handle 指定的动画是否正在运行。Returns a Boolean value that indicates whether or not the animation that is specified by handle is running.

供 Xamarin.Forms 平台内部使用。For internal use by the Xamarin.Forms platform.

返回包含 element 的作用域中名称为 name 的类型 T 的实例。Returns the instance of type T that has name name in the scope that includes element.

返回一个任务,它执行 opacity、length 和 easing 参数描述的淡化。Returns a task that performs the fade that is described by the opacity, length, and easing parameters.

返回一个任务,它将 view 指定的 VisualElement 的边界简化为 bounds 参数指定的矩形。Returns a task that eases the bounds of the VisualElement that is specified by the view to the rectangle that is specified by the bounds parameter.

从当前旋转将 view 指定的 VisualElement 旋转为 drotation。Rotates the VisualElement that is specified by view from its current rotation by drotation.

返回一个任务,它将 view 指定的 VisualElement 从其当前比例缩放到 dscale。Returns a task that scales the VisualElement that is specified by view from its current scale to dscale.

返回一个任务,它执行 rotation、length 和 easing 参数描述的旋转。Returns a task that performs the rotation that is described by the rotation, length, and easing parameters.

返回将 Y 轴倾斜 opacity 的任务,花费时间 length 并使用 easing。Returns a task that skews the Y axis by opacity, taking time length and using easing.

返回将 X 轴倾斜 opacity 的任务,花费时间 length 并使用 easing。Returns a task that skews the X axis by opacity, taking time length and using easing.

返回一个任务,它将 view 指定的 VisualElement 缩放到绝对比例因子 scale。Returns a task that scales the VisualElement that is specified by view to the absolute scale factor scale.

将元素 TranslationX 和 TranslationY 属性从其当前值动画处理为新的值。Animates an elements TranslationX and TranslationY properties from their current values to the new values. 这可确保输入布局与视觉对象布局处于同一位置。This ensures that the input layout is in the same position as the visual layout.

如果 element 具有与之关联的一个或多个可视状态组,则返回 true。Returns true if element has one or more visual state groups associated with it. 否则返回 false。Otherwise, returns false.

适用于

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值