Button with Image and Text

tualatintualatin Member ✭✭

Hi,
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:

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

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

Tagged:

Best Answer

Answers

  • tualatintualatin Member ✭✭

    Thank you, works very well!

Sign In or Register to comment.