Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

How can I change the DataTemplate of a TabbedPage on Button Click ?

$
0
0

Hi All,

Doing well I guess.

I'm working on a Feedback kind of page where I'm using a Tabbed Page to take multiple Q&A from users.
I've a DataTemplate defined in a Separate XAML file for the same.
Now once user is successfully answering all the Questions I want to show another DataTemplate, which is available as a separate XMAL file.
Most importantly I need this change on the Click event of a Button/Control which is available in XAML.

Please provide some solutions if you have.
The Tabbed Page code is like following.

public class MaturityPage : TabbedPage

{

>

    public MMMViewModel ViewModel { get; set; }

    public MaturityPage()
    {
        ViewModel = new MMMViewModel();

        this.BindingContext = ViewModel;
        this.Title = "User Feedback";


        this.ItemsSource = ViewModel.MaturityList;

        this.ItemTemplate = new DataTemplate(() =>
            {
                return new QuestionContentPage();
            }
        );

    }

}

The "QuestionContentPage" returned above is available as a separate XAML.

Regards & Thanks,
Dash


Viewing all articles
Browse latest Browse all 58056

Trending Articles