You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi!
I would like to make a CarouselView that has dynamic view/model types, but sadly I can't make it working.
I wanted to mix it with your CarouselViewWithVMViews implementation that uses a ListView to show dynamic view/model items.
I've merged this sample app with your dynamic ListView item sample code from here:
My modifications are:
public class DynamicTemplateLayout : ContentView// ViewCell
{
protected override void OnBindingContextChanged()
{
base.OnBindingContextChanged();
var vm = BindingContext as ICarouselViewModel;
var page = vm.View;
page.BindingContext = vm;
this.Content = page;
}
}
public class HomePage2 : ContentPage
{
RelativeLayout relativeLayout;
CarouselLayout.IndicatorStyleEnum _indicatorStyle = CarouselLayout.IndicatorStyleEnum.Dots;
SwitcherPageViewModel viewModel;
and in the SwitcherPage, the dots button's command was changed to use this new HomePage2:
Command = new Command((obj) => Navigation.PushAsync(new HomePage2()))
What did I miss here?
It compiles, but when you choose "Dots" button on the main screen, it throws runtime exception on Android (on iOS I did not try) inside the HomePage2's CreatePagesCarousel() method when it tries to instantiate the CarouselLayout.
The text was updated successfully, but these errors were encountered:
Hi!
I would like to make a CarouselView that has dynamic view/model types, but sadly I can't make it working.
I wanted to mix it with your CarouselViewWithVMViews implementation that uses a ListView to show dynamic view/model items.
I've merged this sample app with your dynamic ListView item sample code from here:
My modifications are:
public class DynamicTemplateLayout : ContentView// ViewCell
{
protected override void OnBindingContextChanged()
{
base.OnBindingContextChanged();
public class HomePage2 : ContentPage
{
RelativeLayout relativeLayout;
CarouselLayout.IndicatorStyleEnum _indicatorStyle = CarouselLayout.IndicatorStyleEnum.Dots;
SwitcherPageViewModel viewModel;
and in the SwitcherPage, the dots button's command was changed to use this new HomePage2:
Command = new Command((obj) => Navigation.PushAsync(new HomePage2()))
What did I miss here?
It compiles, but when you choose "Dots" button on the main screen, it throws runtime exception on Android (on iOS I did not try) inside the HomePage2's CreatePagesCarousel() method when it tries to instantiate the CarouselLayout.
The text was updated successfully, but these errors were encountered: