Could we use resources from the .resw without the x:uid by directly binding the resource for the xaml property

Vishal G R 5 Reputation points

We are in the process of moving in-app strings to resource files for our Winui3 application. In this, we are now using x:uid for the XAML controls.

We would like to know whether we can use Resource Manager to get the resource for each property of the XAML controls

X:Uid Approach:
Screenshot 2023-05-17 155605

Resource Binding Approach:

Screenshot 2023-05-17 160139

Code behind:

User's image

Will this have any effect on the performance? or Is x:uid approach preferred for Winui3 applications

Windows App SDK
Windows App SDK
A set of Microsoft open-source libraries, frameworks, components, and tools to be used in apps to access Windows platform functionality on many versions of Windows. Previously known as Project Reunion.
750 questions
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,637 questions
A language based on Extensible Markup Language (XML) that enables developers to specify a hierarchy of objects with a set of properties and logic.
789 questions
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. Jeanine Zhang-MSFT 9,431 Reputation points Microsoft Vendor


    Welcome to Microsoft Q&A!

    As far as I'm concerned, both methods are fine, and you could choose whichever method you want in winui3.

    In my opinion, the x:Uid method is relatively simpler.

    Thank you.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    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.