I
I
Ilya2021-04-30 22:12:52
WPF
Ilya, 2021-04-30 22:12:52

Why does the button disappear after adding a style?

<Window.Resources>
        <Style TargetType="Button" x:Key="songStyle">
            <Setter Property="Margin" Value="5"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid/>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Window.Resources>


Because of this style, the button is no longer displayed, what should I do?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sumor, 2021-04-30
@Sumor

You use a simple Grid without dimensions to display the button - it is pressed to zero.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question