Share via

Xamarin Forms design namespace

AS 21 Reputation points
2021-02-24T08:11:17.44+00:00

I am new to Xamarin and XAML and looking at some example codes I see two namespaces which are similar xmlns="http://xamarin.com/schemas/2014/forms" xmlns:d="http://xamarin.com/schemas/2014/forms/design" What is the difference ? , does one encompass the other ? . Also where could I find documentation to define where and when I should use a specific namespace and not the other or both.

Developer technologies | .NET | Xamarin
0 comments No comments

Answer accepted by question author

JarvanZhang 23,971 Reputation points
2021-02-24T09:30:53.153+00:00

Hello,​

Welcome to our Microsoft Q&A platform!

The xmlns:d namespace could be used to show the fake data for the controls in the XAML Previewer. When using binding to populate the data to views in Xamarin.Forms, it's hard to visualize without data in preview. That may be not convenient when coding. Design time data is fake data you set to make your controls easier to visualize in the XAML Previewer.

For example, you can add text to a label that usually has data bound to it.

   <Label Text="{Binding Name}" d:Text="Name!" />  

For more details, you could check the following tutorial:
https://learn.microsoft.com/en-us/xamarin/xamarin-forms/xaml/xaml-previewer/design-time-data

Best Regards,

Jarvan 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.

Was this answer helpful?

0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

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