通过


ImageCell 类

定义

注意

The controls which use ImageCell (ListView and TableView) are obsolete. Please use CollectionView instead.

包含图像的 TextCell

public ref class ImageCell : Microsoft::Maui::Controls::TextCell
[System.Obsolete("The controls which use ImageCell (ListView and TableView) are obsolete. Please use CollectionView instead.")]
public class ImageCell : Microsoft.Maui.Controls.TextCell
public class ImageCell : Microsoft.Maui.Controls.TextCell
[<System.Obsolete("The controls which use ImageCell (ListView and TableView) are obsolete. Please use CollectionView instead.")>]
type ImageCell = class
    inherit TextCell
type ImageCell = class
    inherit TextCell
Public Class ImageCell
Inherits TextCell
继承
属性

注解

ImageCell 对象用于将图像和随附的文本放入表中。

下面的示例演示了基本用法。

using System;
using Microsoft.Maui.Controls;

namespace FormsGallery
{
    class ImageCellDemoPage : ContentPage
    {
        public ImageCellDemoPage()
        {
            Label header = new Label
            {
                Text = "ImageCell",
                FontSize = Device.GetNamedSize (NamedSize.Large, typeof(Label)),
                HorizontalOptions = LayoutOptions.Center
            };

            TableView tableView = new TableView
            {
                Intent = TableIntent.Form,
                Root = new TableRoot
                {
                    new TableSection
                    {
                        new ImageCell
                        {
                            // Some differences with loading images in initial release.
                            ImageSource =
                                Device.OnPlatform(ImageSource.FromUri(new Uri("http://xamarin.com/images/index/ide-xamarin-studio.png")),
                                                  ImageSource.FromFile("ide_xamarin_studio.png"),
                                                  ImageSource.FromFile("Images/ide-xamarin-studio.png")),
                            Text = "This is an ImageCell",
                            Detail = "This is some detail text",
                        }
                    }
                }
            };

            // Accomodate iPhone status bar.
            this.Padding = new Thickness(10, Device.OnPlatform(20, 0, 0), 10, 5);

            // Build the page.
            this.Content = new StackLayout
            {
                Children =
                {
                    header,
                    tableView
                }
            };
        }
    }
}

构造函数

名称 说明
ImageCell()
已过时.

初始化 ImageCell 类的新实例。

字段

名称 说明
DefaultCellHeight
已过时.

单元的默认高度。

(继承自 Cell)
ImageSourceProperty
已过时.

的可绑定属性 ImageSource

transientNamescope
已过时.

包含图像的 TextCell

(继承自 Element)

属性

名称 说明
AutomationId
已过时.

获取或设置允许自动化框架查找此元素并与其交互的值。

(继承自 Element)
BindingContext
已过时.

获取或设置一个对象,该对象包含由属于此 BindableObject属性的绑定属性所面向的属性。 这是一种可绑定属性。

(继承自 BindableObject)
ClassId
已过时.

获取或设置用于标识语义相似元素集合的值。

(继承自 Element)
Command
已过时.

获取或设置要在点击 TextCell 时执行的 ICommand。 这是一种可绑定属性。

(继承自 TextCell)
CommandParameter
已过时.

获取或设置在调用该命令时要传递的参数。 这是一种可绑定属性。

(继承自 TextCell)
ContextActions
已过时.

获取当用户在 Cell 上执行特定于设备的上下文手势时要显示的菜单项列表。

(继承自 Cell)
Detail
已过时.

获取或设置 TextCell 中要显示的辅助文本。 这是一种可绑定属性。

(继承自 TextCell)
DetailColor
已过时.

获取或设置辅助文本的呈现颜色。 这是一种可绑定属性。

(继承自 TextCell)
Dispatcher
已过时.

获取创建此可绑定对象时可用的调度程序,否则会尝试查找最近的可用调度程序(可能是窗口的/应用)。

(继承自 BindableObject)
EffectControlProvider
已过时.

供 .NET MAUI 内部使用。

(继承自 Element)
Effects
已过时.

获取或设置将在运行时应用于元素的样式和属性。

(继承自 Element)
Handler
已过时.

获取或设置此元素的关联处理程序。

(继承自 Element)
HasContextActions
已过时.

获取一个值,该值指示单元在其 ContextActions 列表属性中是否至少具有一个菜单项。

(继承自 Cell)
Height
已过时.

获取或设置 Cell 的高度。

(继承自 Cell)
Id
已过时.

获取一个值,该值可用于在应用程序运行过程中唯一标识元素。

(继承自 Element)
ImageSource
已过时.

获取或设置要从中加载图像的 ImageSource。 这是一种可绑定属性。

IsContextActionsLegacyModeEnabled
已过时.

获取或设置上下文作是否使用旧模式。 默认值为 false

(继承自 Cell)
IsEnabled
已过时.

获取或设置 Cell 的 IsEnabled 状态。 这是一种可绑定属性。

(继承自 Cell)
LogicalChildren
已过时.

包含图像的 TextCell

(继承自 Element)
Parent
已过时.

获取或设置此元素的父 Element 级。

(继承自 Element)
RealParent
已过时.

供 .NET MAUI 内部使用。

(继承自 Element)
RenderHeight
已过时.

获取设备上呈现的单元的高度。

(继承自 Cell)
StyleId
已过时.

获取或设置用于唯一地标识元素的用户定义的值。

(继承自 Element)
Text
已过时.

获取或设置要显示的主要文本。 这是一种可绑定属性。

(继承自 TextCell)
TextColor
已过时.

获取或设置主要文本的呈现颜色。 这是一种可绑定属性。

(继承自 TextCell)

方法

名称 说明
AddLogicalChild(Element)
已过时.

向逻辑子级添加一个 Element

(继承自 Element)
ApplyBindings()
已过时.

将所有当前绑定应用于 BindingContext

(继承自 BindableObject)
ClearLogicalChildren()
已过时.

删除所有子项 Element

(继承自 Element)
ClearValue(BindableProperty)
已过时.

清除以前为可绑定属性设置的任何值。

(继承自 BindableObject)
ClearValue(BindablePropertyKey)
已过时.

清除以前为其键标识的可绑定属性设置的任何值。

(继承自 BindableObject)
CoerceValue(BindableProperty)
已过时.

强制指定可绑定属性的值。 这是通过调用 BindableProperty.CoerceValueDelegate 指定的可绑定属性来完成的。

(继承自 BindableObject)
CoerceValue(BindablePropertyKey)
已过时.

强制指定可绑定属性的值。 这是通过调用 BindableProperty.CoerceValueDelegate 指定的可绑定属性来完成的。

(继承自 BindableObject)
EffectIsAttached(String)
已过时.

供 .NET MAUI 内部使用。

(继承自 Element)
FindByName(String)
已过时.

返回具有指定名称的元素。

(继承自 Element)
ForceUpdateSize()
已过时.

立即更新单元的大小。

(继承自 Cell)
GetValue(BindableProperty)
已过时.

返回给定可绑定属性中包含的值。

(继承自 BindableObject)
InsertLogicalChild(Int32, Element)
已过时.

Element 指定的索引处插入逻辑子级。

(继承自 Element)
IsSet(BindableProperty)
已过时.

确定可绑定属性是否存在并设置了值。

(继承自 BindableObject)
On<T>()
已过时.

包含图像的 TextCell

(继承自 Cell)
OnAppearing()
已过时.

包含图像的 TextCell

(继承自 Cell)
OnBindingContextChanged()
已过时.

包含图像的 TextCell

OnChildAdded(Element)
已过时.

引发 ChildAdded 事件。 实现此方法可为此事件添加类处理。

(继承自 Element)
OnChildRemoved(Element, Int32)
已过时.

引发 ChildRemoved 事件。 实现此方法以添加此事件的类处理

(继承自 Element)
OnDisappearing()
已过时.

包含图像的 TextCell

(继承自 Cell)
OnHandlerChanged()
已过时.

在派生类中重写时,应引发该 HandlerChanged 事件。

(继承自 Element)
OnHandlerChanging(HandlerChangingEventArgs)
已过时.

在派生类中重写时,应引发该 HandlerChanging 事件。

(继承自 Element)
OnParentChanged()
已过时.

在派生类中重写时,应引发该 ParentChanged 事件。

(继承自 Element)
OnParentChanging(ParentChangingEventArgs)
已过时.

在派生类中重写时,应引发该 ParentChanging 事件。

(继承自 Element)
OnParentSet()
已过时.

包含图像的 TextCell

(继承自 Cell)
OnPropertyChanged(String)
已过时.

更改绑定属性时调用的方法。

(继承自 Element)
OnPropertyChanging(String)
已过时.

包含图像的 TextCell

(继承自 Cell)
OnTapped()
已过时.

包含图像的 TextCell

(继承自 TextCell)
RemoveBinding(BindableProperty)
已过时.

从可绑定属性中删除以前设置的绑定。

(继承自 BindableObject)
RemoveDynamicResource(BindableProperty)
已过时.

删除以前设置的动态资源。

(继承自 Element)
RemoveLogicalChild(Element)
已过时.

从逻辑子级中删除特定 Element 项的第一个匹配项。

(继承自 Element)
SendAppearing()
已过时.

Microsoft.Maui.Controls 平台使用的内部 API。

(继承自 Cell)
SendDisappearing()
已过时.

Microsoft.Maui.Controls 平台使用的内部 API。

(继承自 Cell)
SetBinding(BindableProperty, BindingBase)
已过时.

将绑定分配给可绑定属性。

(继承自 BindableObject)
SetDynamicResource(BindableProperty, String)
已过时.

BindableProperty使用提供的键设置要通过 DynamicResource 更新的此元素的属性。

(继承自 Element)
SetValue(BindableProperty, Object)
已过时.

设置指定的可绑定属性的值。

(继承自 BindableObject)
SetValue(BindablePropertyKey, Object)
已过时.

设置指定的可绑定属性的值。

(继承自 BindableObject)
SetValueFromRenderer(BindableProperty, Object)
已过时.

供 .NET MAUI 内部使用。

(继承自 Element)
SetValueFromRenderer(BindablePropertyKey, Object)
已过时.

供 .NET MAUI 内部使用。

(继承自 Element)
UnapplyBindings()
已过时.

从当前上下文中删除所有当前绑定。

(继承自 BindableObject)

活动

名称 说明
Appearing
已过时.

包含图像的 TextCell

(继承自 Cell)
BindingContextChanged
已过时.

BindingContext 属性的值更改时发生。

(继承自 BindableObject)
ChildAdded
已过时.

每当将子元素添加到元素时引发。

(继承自 Element)
ChildRemoved
已过时.

每当从元素中删除子元素时引发。

(继承自 Element)
DescendantAdded
已过时.

每当将子元素添加到元素的子树时引发。

(继承自 Element)
DescendantRemoved
已过时.

每当从元素子树中删除子元素时引发。

(继承自 Element)
Disappearing
已过时.

包含图像的 TextCell

(继承自 Cell)
ForceUpdateSizeRequested
已过时.

包含图像的 TextCell

(继承自 Cell)
HandlerChanged
已过时.

每当元素的处理程序发生更改时引发。

(继承自 Element)
HandlerChanging
已过时.

每当元素的处理程序开始更改时引发。

(继承自 Element)
ParentChanged
已过时.

每当元素的父级发生更改时引发。

(继承自 Element)
ParentChanging
已过时.

每当元素开始更改时引发。

(继承自 Element)
PropertyChanged
已过时.

在属性值更改时发生。

(继承自 BindableObject)
PropertyChanging
已过时.

在属性值更改时发生。

(继承自 BindableObject)
Tapped
已过时.

包含图像的 TextCell

(继承自 Cell)

显式接口实现

名称 说明
IContextFlyoutElement.ContextFlyout
已过时.

获取 ContextFlyout 视图。 菜单浮出控件、菜单浮出控件子项和菜单浮出控件分隔符可以添加到上下文浮出控件中。

(继承自 Element)
IDynamicResourceHandler.SetDynamicResource(BindableProperty, String)
已过时.

包含图像的 TextCell

(继承自 BindableObject)
IEffectControlProvider.RegisterEffect(Effect)
已过时.

注册此元素的指定 effect 项。

(继承自 Element)
IElement.Parent
已过时.

获取元素的父级。

(继承自 Element)
IElementController.Descendants()
已过时.

供 .NET MAUI 内部使用。

(继承自 Element)
IElementController.LogicalChildren
已过时.

供 .NET MAUI 内部使用。

(继承自 Element)
IElementController.SetValueFromRenderer(BindableProperty, Object)
已过时.

供 .NET MAUI 内部使用。

(继承自 Element)
INameScope.RegisterName(String, Object)
已过时.

供 .NET MAUI 内部使用。

(继承自 Element)
INameScope.UnregisterName(String)
已过时.

供 .NET MAUI 内部使用。

(继承自 Element)
IToolTipElement.ToolTip
已过时.

表示一个小矩形弹出窗口,当用户将指针放在视图上时,显示视图用途的简要说明。

(继承自 Element)
IVisualTreeElement.GetVisualChildren()
已过时.

包含图像的 TextCell

(继承自 Cell)
IVisualTreeElement.GetVisualParent()
已过时.

获取元素的视觉父级。

(继承自 Element)

扩展方法

名称 说明
FindByName<T>(Element, String)
已过时.

包含图像的 TextCell

GetPath(Cell)
已过时.

获取单元格的节和行索引路径。

GetPropertyIfSet<T>(BindableObject, BindableProperty, T)
已过时.

包含图像的 TextCell

GetVisualElementWindow(IVisualTreeElement)
已过时.

获取包含可视化树元素的窗口(如果元素包含在一个中)。

GetVisualTreeDescendants(IVisualTreeElement)
已过时.

获取子代的整个层次结构,作为给定可视化树元素的子级列表。

GetVisualTreeElements(IVisualTreeElement, Double, Double, Double, Double)
已过时.

基于由其坐标定义的矩形(而不是像素)定义的矩形的可视化树元素子项的列表,这些坐标在平台单位中指定。

GetVisualTreeElements(IVisualTreeElement, Double, Double)
已过时.

获取基于给定 x、y 点的可视化树元素子项的列表。

GetVisualTreeElements(IVisualTreeElement, Point)
已过时.

基于给定点获取可视化树元素的子元素的列表。

GetVisualTreeElements(IVisualTreeElement, Rect)
已过时.

获取基于矩形的可视化树元素子项的列表。

SetAppTheme<T>(BindableObject, BindableProperty, T, T)
已过时.

包含图像的 TextCell

SetAppThemeColor(BindableObject, BindableProperty, Color, Color)
已过时.

包含图像的 TextCell

SetBinding(BindableObject, BindableProperty, String, BindingMode, IValueConverter, String)
已过时.

创建绑定并将其应用到属性。

SetBinding<TSource,TProperty>(BindableObject, BindableProperty, Func<TSource,TProperty>, BindingMode, IValueConverter, Object, String, Object, Object, Object)
已过时.

在源对象上的属性和目标对象的属性之间创建绑定。

ToHandler(IElement, IMauiContext)
已过时.

包含图像的 TextCell

ToPlatform(IElement, IMauiContext)
已过时.

包含图像的 TextCell

适用于