WPF: capturing XAML into subclassed control

Posted by Sonic Soul on Stack Overflow See other posts from Stack Overflow or by Sonic Soul
Published on 2010-06-14T18:50:25Z Indexed on 2010/06/14 19:42 UTC
Read the original article Hit count: 184

Filed under:
|

hello,

i narrowed down what i want my wpf button to look like using XAML.

now i would like to create a sub classed button control that i can just re-use w/out having to write all that markup

<Button Click="TestGridColumnButton_Click" Background="Transparent" Width="16" Height="16" Margin="0,0,0,0" Padding="0,0,0,0" BorderBrush="{x:Null}">
    <Button.Template>
        <ControlTemplate>
            <Image HorizontalAlignment="Center" VerticalAlignment="Center" Style="{StaticResource SourceStyle}" />
        </ControlTemplate>
    </Button.Template>
</Button>

how can i set all these properties using C# ?

© Stack Overflow or respective owner

Related posts about wpf

Related posts about xaml