zoukankan      html  css  js  c++  java
  • C# 向PivotItem中添加子控件

    xaml语言:

    <controls:PivotItem Name="SecondPivotItem" Header="Second">                

      <ListBox x:Name="SecondListBox" Margin="0,0,-12,0" ItemsSource="{Binding Items}">                    

        <ListBox.ItemTemplate>                        

          <DataTemplate>                          

            <StackPanel Margin="0,0,0,17" Width="432" Height="78">                              

              <TextBlock Text="{Binding LineOne}" TextWrapping="Wrap" Style="{StaticResource PhoneTextExtraLargeStyle}"/>                              

              <TextBlock Text="{Binding LineTwo}" TextWrapping="Wrap" Margin="12,-6,12,0" Style="{StaticResource PhoneTextSubtleStyle}"/>                          

            </StackPanel>                        

           </DataTemplate>                    

        </ListBox.ItemTemplate>                

          </ListBox>            

    </controls:PivotItem>

    C# :

    ListBox listbox=new ListBox();

    listbox.Background=new SolidColorBrush(Colors.Red);

    listbox.Width=300;

    listbox.height=400;

    ListBoxItem item =new ListBoxItem();

    item="this is first time i‘m apperear here";

    listbox.items.add(item);

    SecondPivotItem.Content=listbox;//pivotitem的content属性可以设置子控件

  • 相关阅读:
    WPF 绘图 和动画
    BZOJ 4028 分块
    操作系统与计算机网络
    go排序-基数排序
    go排序-睡眠排序
    go排序-堆排序
    go排序-构建大顶堆
    go排序 插入排序
    go排序-选择排序
    go排序-冒泡排序
  • 原文地址:https://www.cnblogs.com/mokey/p/2248399.html
Copyright © 2011-2022 走看看