Duplicating Multiple Content Pages

Daryl V 41 Reputation points
2021-01-03T01:26:36.107+00:00

Hello,

I am preparing an app in Xamarin.Forms and would like to know the following:

Would it be possible to duplicate multiple content pages within the same solution?

I have to make many content pages for one section of the app and I will then need to make the same thing a few times over. I am hoping not to have to write the same (maybe 70 content pages?) repeatedly for each section since they are so similar. Any ideas other than manually writing each one?

Thanks in advance :)

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,363 questions
0 comments No comments
{count} votes

Accepted answer
  1. JessieZhang-MSFT 7,711 Reputation points Microsoft Vendor
    2021-01-04T09:48:08.373+00:00

    Hello,

    Welcome to our Microsoft Q&A platform!

    I have to make many content pages for one section of the app and I will then need to make the same thing a few times over.

    Do you want to use the same UI to display different data item(with similar structure)?

    If yes, you can pass your data as paramaters to the UI(e.g. ContentPage or ContentView).

    For how to pass paramater to ContentPage, you can check document Passing Data when Navigating .

    For more details about ContentView, you can check: https://learn.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/layouts/contentview .

    Hope it can help you.

    Best Regards,

    Jessie Zhang


    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.