Create a button inside a TextBox - WPF / Mahapps

1

I need to create a button style that creates a button inside a Textbox. I'm using WPF and a framework called MahApps.

Buttheproblemisthatit'sgettingthisway:

<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>

Does anyone know how to do it?

    
asked by anonymous 05.11.2017 / 23:52

0 answers