public Issue6932_emptyviewstring() { #if APP InitializeComponent(); BindingContext = _viewModel; BindableLayout.SetEmptyView(TheStack, _viewModel.EmptyViewStringDescription); #endif }
public void ValidateBindableProperties() { var layout = new StackLayout { IsPlatformEnabled = true, }; // EmptyView object emptyView = new object(); BindableLayout.SetEmptyView(layout, emptyView); Assert.AreEqual(emptyView, BindableLayout.GetEmptyView(layout)); Assert.AreEqual(emptyView, layout.GetValue(BindableLayout.EmptyViewProperty)); // EmptyViewTemplateProperty DataTemplate emptyViewTemplate = new DataTemplate(typeof(Label)); BindableLayout.SetEmptyViewTemplate(layout, emptyViewTemplate); Assert.AreEqual(emptyViewTemplate, BindableLayout.GetEmptyViewTemplate(layout)); Assert.AreEqual(emptyViewTemplate, layout.GetValue(BindableLayout.EmptyViewTemplateProperty)); // ItemsSourceProperty IEnumerable itemsSource = new object[0]; BindableLayout.SetItemsSource(layout, itemsSource); Assert.AreEqual(itemsSource, BindableLayout.GetItemsSource(layout)); Assert.AreEqual(itemsSource, layout.GetValue(BindableLayout.ItemsSourceProperty)); // ItemTemplateProperty DataTemplate itemTemplate = new DataTemplate(typeof(Label)); BindableLayout.SetItemTemplate(layout, itemTemplate); Assert.AreEqual(itemTemplate, BindableLayout.GetItemTemplate(layout)); Assert.AreEqual(itemTemplate, layout.GetValue(BindableLayout.ItemTemplateProperty)); // ItemTemplateSelectorProperty var itemTemplateSelector = new DataTemplateSelectorFrame(); BindableLayout.SetItemTemplateSelector(layout, itemTemplateSelector); Assert.AreEqual(itemTemplateSelector, BindableLayout.GetItemTemplateSelector(layout)); Assert.AreEqual(itemTemplateSelector, layout.GetValue(BindableLayout.ItemTemplateSelectorProperty)); }
public static TLayout EmptyView <TLayout>(this TLayout layout, object view) where TLayout : Layout <View> { BindableLayout.SetEmptyView(layout, view); return(layout); }
void ToggleEmptyView(bool isToggled) { object view = isToggled ? Resources["BasicEmptyView"] : Resources["AdvancedEmptyView"]; BindableLayout.SetEmptyView(achievementsStackLayout, view); }