Silverlight TabControl和Accordion控件使用介绍

1、引入Silverlight Toolkit中控件Controls的引用

xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"

 

2、页面中添加控件

<sdk:TabControl  Style="{StaticResource tabStyle}" HorizontalAlignment="Left" Margin="0" x:Name="tabControl1" Width="276" Height="400" VerticalAlignment="Top">
                            <!--第一个TabItem-->
                            <sdk:TabItem Style="{StaticResource tabItemStyle}" Header="    防 汛 抢 险 " x:Name="tabItem2" Width="122" HorizontalAlignment="Center" VerticalAlignment="Center">
                                <Grid Width="269" Margin="0" HorizontalAlignment="Left" Height="362" VerticalAlignment="Top">
                                    <layoutToolkit:Accordion x:Name="accordion" Margin="0,1,3,3" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" FontSize="14.667" BorderBrush="DarkGray" Width="266">
                                        <layoutToolkit:AccordionItem Header="仓库物资" IsSelected="False" Cursor="Hand" VerticalAlignment="Center">
                                            <layoutToolkit:AccordionItem.Content>
                                                <Grid>
                                                    
                                                </Grid>
                                            </layoutToolkit:AccordionItem.Content>
                                        </layoutToolkit:AccordionItem>
                                        <layoutToolkit:AccordionItem Header="抢险队伍" IsSelected="False">
                                            <layoutToolkit:AccordionItem.Content>
                                                <Grid Width="269" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Top" Height="292">
                                                    
                                                </Grid>
                                            </layoutToolkit:AccordionItem.Content>
                                        </layoutToolkit:AccordionItem>
                                        <layoutToolkit:AccordionItem Header="防汛责任人">
                                            <layoutToolkit:AccordionItem.Content>
                                                <Grid Width="272" Margin="0" HorizontalAlignment="Left" Height="300" VerticalAlignment="Top">
                                                  
                                                </Grid>
                                            </layoutToolkit:AccordionItem.Content>
                                        </layoutToolkit:AccordionItem>
                                    </layoutToolkit:Accordion>
                                </Grid>
                            </sdk:TabItem>
                            <!--第二个TabItem-->
                            <sdk:TabItem  Style="{StaticResource tabItemStyle}" Header=" 预 警 短 信 发 送" x:Name="tabItem1" FontFamily="Microsoft YaHei" FontSize="13.333" VerticalAlignment="Center" Cursor="Hand" Width="146">
                                <Grid>
                                   
                                </Grid>
                            </sdk:TabItem>
                        </sdk:TabControl>

 

3、效果如下图:

 Silverlight TabControl和Accordion控件使用介绍_第1张图片

 

 

你可能感兴趣的:(Silverlight TabControl和Accordion控件使用介绍)