Language

DataTemplate クラス

定義

テンプレート化された項目のビジュアル構造を定義します。 一貫性のある外観のデータ オブジェクトを表示するために使用します。

public ref class DataTemplate : Microsoft::Maui::Controls::ElementTemplate, Microsoft::Maui::Controls::Internals::IDataTemplateController
public class DataTemplate : Microsoft.Maui.Controls.ElementTemplate, Microsoft.Maui.Controls.Internals.IDataTemplateController
type DataTemplate = class
    inherit ElementTemplate
    interface IDataTemplateController
Public Class DataTemplate
Inherits ElementTemplate
Implements IDataTemplateController
継承
DataTemplate
派生
実装

注釈

XAML では、アプリケーション開発者はDataTemplate タグ内にマークアップを入れ子にして、メンバーがItemsSourceリストに含まれるデータ オブジェクトのプロパティにバインドされているViewを作成できます。

コンストラクター

Name 説明
DataTemplate()

DataTemplate クラスの新しいインスタンスを初期化します。

DataTemplate(Func<Object>)

テンプレート コンテンツを作成するファクトリ関数を使用して、新しいインスタンスを初期化します。

DataTemplate(Type)

指定した型を使用して、 DataTemplate クラスの新しいインスタンスを初期化します。

プロパティ

Name 説明
Bindings

テンプレート化された項目に適用するバインドのディクショナリを取得します。

LoadTemplate

テンプレート化された項目のビジュアル構造を定義します。 一貫性のある外観のデータ オブジェクトを表示するために使用します。

(継承元 ElementTemplate)
Values

テンプレート化された項目に適用するプロパティ値のディクショナリを取得します。

メソッド

Name 説明
CreateContent()

XAML インフラストラクチャがデータ テンプレートを読み込み、結果の UI の内容を設定するために使用されます。

(継承元 ElementTemplate)
SetBinding(BindableProperty, BindingBase)

テンプレート化された項目のプロパティのバインドを設定します。

SetValue(BindableProperty, Object)

テンプレート項目のプロパティの静的な値を設定します。

明示的なインターフェイスの実装

Name 説明
IDataTemplateController.Id

テンプレート化された項目のビジュアル構造を定義します。 一貫性のある外観のデータ オブジェクトを表示するために使用します。

IDataTemplateController.IdString

テンプレート化された項目のビジュアル構造を定義します。 一貫性のある外観のデータ オブジェクトを表示するために使用します。

拡張メソッド

Name 説明
CreateContent(DataTemplate, Object, BindableObject)

適切なテンプレートを選択し、指定した項目のコンテンツを作成します。

SelectDataTemplate(DataTemplate, Object, BindableObject)

テンプレートが DataTemplateSelectorの場合はセレクター ロジックを呼び出して、適切なテンプレートを返します。

SetBinding(DataTemplate, BindableProperty, String)

指定したプロパティとパスのテンプレートにバインドを作成します。

適用対象