Button with Image and Text

tualatintualatin Member ✭✭

I have a Button with an Image inside, but my users think that a picture with text would be better. The problem is, when the resolution is not too big, text and image takes too much place. A better solution is, when the display/resolution is big enough, show the picture with text otherwise the image only. I took a look into the VisualStateManager stuff, but do not know how I to trigger the different states by changing the resolution. This XAML style I place into the button style:

                    <VisualStateGroup x:Name="ShowTextStates">
                        <VisualState x:Name="ShowText">
                                <Setter Property="Text" Value="Test test test..." />
                        <VisualState x:Name="HideText">
                                <Setter Property="Text" Value="" />

How can I solve this problem? Any suggestions? Thank you!


Best Answer


  • tualatintualatin Member ✭✭

    Thank you, works very well!

Sign In or Register to comment.