We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How would you do Magic Gradients within the XAML on a Xamarin.Forms application that uses AppTheming or different colors for Light and Dark?
The text was updated successfully, but these errors were encountered:
Hi @Orgbrat here is a link to full source code from example below
Also, here is a link to Demo video on YouTube
ContentPage.Resources> <x:String x:Key="LightGradient"> repeating-linear-gradient(...) </x:String> <x:String x:Key="DarkGradient"> repeating-linear-gradient(...) </x:String> </ContentPage.Resources> <magic:GradientView> <magic:CssGradientSource Stylesheet="{x:AppThemeBinding Light={StaticResource LightGradient}, Dark={StaticResource DarkGradient}}"/> </magic:GradientView>
.lightGradient { background: repeating-linear-gradient(...); } .darkGradient{ background: repeating-linear-gradient(...); }
//MainPage.xaml.cs public MainPage() { InitializeComponent(); Application.Current.RequestedThemeChanged += (s, a) => { GradientView.StyleClass = new[] { a.RequestedTheme == OSAppTheme.Light ? "lightGradient" : "darkGradient" }; }; }
If you don't have any other related questions with App Theming - please close this issue 😉
Sorry, something went wrong.
Thanks, I believe that is just what I needed...
No branches or pull requests
How would you do Magic Gradients within the XAML on a Xamarin.Forms application that uses AppTheming or different colors for Light and Dark?
The text was updated successfully, but these errors were encountered: