How do I assign a value from a static class to x:String in a resource dictionary?

ReedReed Member ✭✭
edited January 28 in Xamarin.Forms

I want my values in the array to reference static values. How can I achieve this?

Here's how the dictionary looks

   <ContentView.Resources>
            <ResourceDictionary>
                <x:Array x:Key="Values" Type="{x:Type x:String}">
                    <x:String>First</x:String>
                    <x:String>Second</x:String>
                </x:Array>
            </ResourceDictionary>
        </ContentView.Resources>

I want something like:

   <ContentView.Resources>
            <ResourceDictionary>
                <x:Array x:Key="Values" Type="{x:Type x:String}">
                    <x:String Value="{x:Static values:Values.First}"></x:String>
                    <x:String Value="{x:Static values:Values.Second}"></x:String>
                </x:Array>
            </ResourceDictionary>
        </ContentView.Resources>
Tagged:

Best Answer

Answers

Sign In or Register to comment.