Skip to content

How to bind TextBox.InnerLeftContent/InnerLeftContent to an image? #15832

Answered by stevemonaco
Bo-Liu-BL asked this question in Q&A
Discussion options

You must be logged in to vote

Not sure what you might be doing, but you should specify the control for the icon:

<AutoCompleteBox Text="Search">
    <AutoCompleteBox.InnerLeftContent>
        <PathIcon RenderTransform="scaley(-1)" Data="M203 213c53 0 96 43 96 96s-43 96 -96 96s-96 -43 -96 -96s43 -96 96 -96zM331 213l106 -106l-32 -32l-106 106v17l-6 6c-24 -21 -56 -33 -90 -33c-77 0 -139 61 -139 138s62 139 139 139s138 -62 138 -139c0 -34 -12 -66 -33 -90l6 -6h17z" />
    </AutoCompleteBox.InnerLeftContent>
</AutoCompleteBox>

I'm using a <PathIcon> here, but you could use an <Image> instead.

It's also a new feature on AutoCompleteBox for 11.1, so you should be using 11.1.0-beta2.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Bo-Liu-BL
Comment options

Answer selected by Bo-Liu-BL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants