wp中控件基类介绍

大部分wp控件都直接或间接的继承自:UIElment,FrameworkElment,Control这三个基类,他们层次关系是,Control继承FrameworkElment继承UIElment,每个类都增加了各自的属性和事件。然而有些控件继承自Control类,例如:Button控件。

<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
            <Button Content="按钮1" Height="72" Width="364" HorizontalAlignment="Left" Margin="46,47,0,0" Name="button1" VerticalAlignment="Top" Click="button1_Click"></Button>
            <Button Content="按钮2" FontSize="48" FontStyle="Italic" Foreground="Red" Background="Blue" BorderThickness="10" BorderBrush="Yellow" Padding="20" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="63,117,185,342"></Button>
            <Button HorizontalAlignment="Center" VerticalAlignment="Center" Margin="105,237,186,237" Width="165">
                <StackPanel>
                    <Image Source="Assets/ApplicationIcon.png" Stretch="None" Height="61" Width="94"></Image>
                </StackPanel>
            </Button>
        </Grid>

 

posted on 2013-06-17 22:25  wp456  阅读(207)  评论(0)    收藏  举报

导航