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
2023-05-17T11:30:53.55+00:00

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 development | Windows App SDK
Developer technologies | XAML
Developer technologies | C#
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. Jeanine Zhang-MSFT 11,356 Reputation points Microsoft External Staff
    2023-05-18T02:24:30.5866667+00:00

    Hello,

    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.

    Jeanine


    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.


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.