Create a button inside a Textbox - WPF/Mahapps

Asked

Viewed 32 times

1

I need to create a button style that creates a button inside a Textbox. I am using WPF and a framework called Mahapps.

inserir a descrição da imagem aqui

But the problem is it’s getting that way:

inserir a descrição da imagem aqui

<Style TargetType="{x:Type TextBox}"
               x:Key="OpenFileMetroTextBox"
               BasedOn="{StaticResource ButtonCommandMetroTextBox}">
                <Setter Property="Controls:TextBoxHelper.ButtonTemplate">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type Button}">
                            <Button>
                                <Rectangle Width="10" Height="10">
                                    <Rectangle.Resources>
                                        <SolidColorBrush x:Key="BlackBrush" Color="White" />
                                    </Rectangle.Resources>
                                    <Rectangle.Fill>
                                        <VisualBrush Stretch="Fill" Visual="{StaticResource appbar_add}" />
                                    </Rectangle.Fill>
                                </Rectangle>
                            </Button>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

Someone knows how to do?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.