Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

How do I change the Resource Dictionary values programmatically?

$
0
0

I have this in my App.Xaml

<OnPlatform x:Key="XFactor" x:TypeArguments="x:Double">
                <On Platform="iOS" Value="0.25" />
                <On Platform="Android,UWP" Value="0.26" />
            </OnPlatform>```
I want to change the iOS value to 0.00 on the fly in the Code.
I added this the App_Start but no effect.


Here's is the code.

This is in the App.Xaml.cs

protected override void OnStart()
{
// Handle when your app starts

            Application.Current.Resources["XFactor"] = 0.00;

    }```

Any ideas?


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>