■ Button 엘리먼트 : Template 속성 사용하기

----------------------------------------------------------------------------------------------------

 

<Button Width="150" Height="150">

    <Button.Template>

        <ControlTemplate TargetType="{x:Type Button}">

            <Grid Margin="5">

                <Ellipse

                    Stroke="DarkBlue"

                    StrokeThickness="2">

                    <Ellipse.Fill>

                        <RadialGradientBrush

                            Center="0.3,0.2"

                            RadiusX="0.5"

                            RadiusY="0.5">

                            <GradientStop Offset="0.1" Color="Azure"          />

                            <GradientStop Offset="1.1" Color="CornflowerBlue" />

                        </RadialGradientBrush>

                    </Ellipse.Fill>

                </Ellipse>

                <ContentPresenter

                    Name="contentPresenter"

                    HorizontalAlignment="Center"

                    VerticalAlignment="Center" />

            </Grid>

        </ControlTemplate>

    </Button.Template>

    <Button.Content>

        Click Me!

    </Button.Content>

</Button>

----------------------------------------------------------------------------------------------------

Posted by 사용자 icodebroker

댓글을 달아 주세요