BindableLayout 확장
확장은 BindableLayout
구성을 지원하는 EmptyView
ItemSource
일련의 확장 메서드를 ItemTemplate
제공합니다.
EmptyView
메서드는 EmptyView
에 속성을 EmptyView
ILayout
설정합니다.
다음 예제에서는 다음으로 EmptyView
new Label().Text("No Items Found")
설정합니다.
new VerticalStackLayout().EmptyView(new Label().Text("No Items Found"));
EmptyViewTemplate
메서드는 EmptyViewTemplate
에 속성을 EmptyViewTemplate
ILayout
설정합니다.
다음 예제에서는 다음으로 EmptyViewTemplate
new DataTemplate(() => new Label().Text("No Items Found"))
설정합니다.
new VerticalStackLayout().EmptyViewTemplate(new DataTemplate(() => new Label().Text("No Items Found")));
을 EmptyViewTemplate
초기화하는 데 사용되는 것을 허용하는 Func<object>
오버로드 메서드가 DataTemplate
있습니다.
new VerticalStackLayout().EmptyViewTemplate(() => new Label().Text("No Items Found"));
ItemsSource
메서드는 ItemsSource
에 속성을 ItemsSource
ILayout
설정합니다.
다음 예제에서는 다음으로 EmptyView
new Label().Bind(Label.TextProperty, "."))
설정합니다.
new VerticalStackLayout().ItemsSource(new Label().Bind(Label.TextProperty, Binding.SelfPath));
ItemTemplate
메서드는 ItemTemplate
에 속성을 ItemTemplate
ILayout
설정합니다.
다음 예제에서는 다음으로 EmptyViewTemplate
new DataTemplate(() => new Label().Bind(Label.TextProperty, ".")
설정합니다.
new VerticalStackLayout().ItemTemplate(new DataTemplate(() => new Label().Bind(Label.TextProperty, Binding.SelfPath)));
을 ItemTemplate
초기화하는 데 사용되는 것을 허용하는 Func<object>
오버로드 메서드가 DataTemplate
있습니다.
new VerticalStackLayout().ItemTemplate(() => new Label().Bind(Label.TextProperty, Binding.SelfPath));
ItemTemplateSelector
메서드는 ItemTemplateSelector
에 속성을 ItemTemplateSelector
ILayout
설정합니다.
다음 예제에서는 다음으로 ItemTemplateSelector
new CustomDataTemplateSelector()
설정합니다.
new VerticalStackLayout().ItemTemplateSelector(new CustomDataTemplateSelector())
class CustomDataTemplateSelector : DataTemplateSelector
{
// ...
}
.NET MAUI Community Toolkit
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기