This is a mirror of official site: http://jasper-net.blogspot.com/

הגדרה של Control Template בתוך Style .

| Sunday, October 14, 2012
Inline image 1

<Window.Resources>
        <Style TargetType="{x:Type ToggleButton}" >
            <Setter Property="Width" Value="30"/>
            <Setter Property="Height" Value="30"/>
            <Setter Property="Margin" Value="3"/>
            <Setter Property="Background" Value="Lavender" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate>
                        <Ellipse x:Name="elp" Fill="Lavender"/>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter TargetName="elp"  Property="Fill" Value="DarkBlue"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Window.Resources>
   
   
    <Grid>
       
        <StackPanel Orientation="Horizontal" Margin="71,35,163,27">
            <ToggleButton/>
            <ToggleButton/>
            <ToggleButton/>
        </StackPanel>
    </Grid>

Read more: מילים ב WPF
QR: Inline image 2

Posted via email from Jasper-net

0 comments: