Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

switching between css-StyleSheet's at runtime?

$
0
0

hi there :-)

loading a StyleSheet like this works fine:
var style = StyleSheet.FromAssemblyResource(IntrospectionExtensions.GetTypeInfo(typeof(Themes)).Assembly, "TestProjekt.Styles.DarkTheme.css"); Application.Current.Resources.Add(style);

but when I load another StyleSheet nothing happens :-(

Application.Current.Resources.Clear(); or Application.Current.Resources = new ResourceDictionary(); var style = StyleSheet.FromAssemblyResource(IntrospectionExtensions.GetTypeInfo(typeof(Themes)).Assembly, "TestProjekt.Styles.ColoredTheme.css"); Application.Current.Resources.Add(style);

when I try the same with Style-Class the changes get displayed immediately..
like Application.Current.Resources.Add(new Style(typeof(NavigationPage))...

any Ideas?


Viewing all articles
Browse latest Browse all 204402

Trending Articles



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