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

Trying to add icon sets to a theme option in my app.

$
0
0

Hello everyone!
I have a theming option in my app, that is not perfect, but functions well enough for my purpose, at least that's what I thought until I started making the light and dark themes and realized I needed to make a light and dark icons as well... Only problem is my icons are statically coded... So I figured, why not use the same <style ... tags for the icons as well?
Here is what I have in the code.
Here's a snippet from my theme code.

<Style x:Key="ic_Add" TargetType="{x:Type ToolbarItem}">
    <Setter Property="IconImageSource" Value="ic_plus_26px.png" />
</Style>

<Color x:Key="primary-title-color">#919191</Color>
<Color x:Key="NavigationPrimary">#6F6F6F</Color>
<Color x:Key="AppBackgroundColor">#373739</Color>

and when I attempt to implement it...

<ToolbarItem
        x:Name="btnAddLoad"
        Clicked="AddLoad_Clicked"
        StyleId="{StaticResource Key=ic_Add}"
        Text="Add" />

My problem is that the icon is not showing up... I've tried using the implementation as both StyleId and ClassId both with the same results...

Any ideas or recommendations?

Thanks!


Viewing all articles
Browse latest Browse all 91519

Trending Articles



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