Adding entries to ResourceDictionary in Xaml

Do you want to add an entry in the ResourceDictionary in your Windows 10 App using Xaml ? . Below is a sample code snippet demonstrating the process to add two colors to the ResourceDictionary.

How to add entries to ResourceDictionary in Xaml ?

<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:secondaryns="http://schemas.microsoft.com/winfx/2006/xaml">
   <Color secondaryns:Key="1">Red</Color>
   <Color secondaryns:Key="2">Blue</Color>
</ResourceDictionary>

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

In this post, you’ll learn about the error message “FileOpenAccessDenied – You do not have permissions to open this file...
  • .NET
  • December 3, 2024
You might have had a situation where your code once worked fine in ASP.NET application but now throws the below...
  • .NET
  • December 3, 2024
C# uses the flower bracket “{” and “}” to identify the block or scope of the function or program ....
  • .NET
  • December 3, 2024