Using a ListBoxItem as a ContentControl : ListBoxItem « UI Controls « Silverlight

Home
Silverlight
1.Animations
2.Communication
3.Containers
4.Data
5.Events
6.Graphics
7.Shapes
8.UI Controls
Silverlight » UI Controls » ListBoxItemScreenshots 
Using a ListBoxItem as a ContentControl
Using a ListBoxItem as a ContentControl
   

<UserControl x:Class='SilverlightApplication3.MainPage'
    xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' 
    xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'
    xmlns:d='http://schemas.microsoft.com/expression/blend/2008' 
    xmlns:mc='http://schemas.openxmlformats.org/markup-compatibility/2006' 
    mc:Ignorable='d' 
    d:DesignWidth='640' d:DesignHeight='480'>
    <Grid x:Name="LayoutRoot" Background="White">
        <ListBox x:Name="myListBox" Margin="10">
            <ListBox.Items>
                <ListBoxItem>
                    <StackPanel Height="80" Orientation="Horizontal">
                        <Canvas Width="87" Height="77">
                            <Image Source="http://server.com/month.png" />
                            <TextBlock Width="77" TextAlignment="Center" FontFamily="Arial" FontWeight="Bold" FontSize="32" Padding="30" Text="1" />
                        </Canvas>
                        <TextBlock FontFamily="Arial" FontWeight="Bold" FontSize="44" Padding="20">Sunday</TextBlock>
                    </StackPanel>
                </ListBoxItem>
                <ListBoxItem>
                    <StackPanel Height="80" Orientation="Horizontal">
                        <Canvas Width="87" Height="77">
                            <Image Source="http://server.com/month.png" />
                            <TextBlock Width="77" TextAlignment="Center" FontFamily="Arial" FontWeight="Bold" FontSize="32" Padding="30" Text="2" />
                        </Canvas>
                        <TextBlock FontFamily="Arial" FontWeight="Bold" FontSize="44" Padding="20">Monday</TextBlock>
                    </StackPanel>
                </ListBoxItem>
                <ListBoxItem>
                    <StackPanel Height="80" Orientation="Horizontal">
                        <Canvas Width="87" Height="77">
                            <Image Source="http://server.com/month.png" />
                            <TextBlock Width="77" TextAlignment="Center" FontFamily="Arial" FontWeight="Bold" FontSize="32" Padding="30" Text="3" />
                        </Canvas>
                        <TextBlock FontFamily="Arial" FontWeight="Bold" FontSize="44" Padding="20">Tuesday</TextBlock>
                    </StackPanel>
                </ListBoxItem>
                <ListBoxItem>
                    <StackPanel Height="80" Orientation="Horizontal">
                        <Canvas Width="87" Height="77">
                            <Image Source="http://server.com/month.png" />
                            <TextBlock Width="77" TextAlignment="Center" FontFamily="Arial" FontWeight="Bold" FontSize="32" Padding="30" Text="4" />
                        </Canvas>
                        <TextBlock FontFamily="Arial" FontWeight="Bold" FontSize="44" Padding="20">Wednesday</TextBlock>
                    </StackPanel>
                </ListBoxItem>
            </ListBox.Items>
        </ListBox>
    </Grid>
</UserControl>

   
    
    
  
Related examples in the same category
1.Customizing the Default ListBoxItem UICustomizing the Default ListBoxItem UI
2.ListBoxItem styleListBoxItem style
3.Using an ItemsPresenterto display the Itemsof an ItemsControlUsing an ItemsPresenterto display the Itemsof an ItemsControl
4.Declaring the ItemsPanel to arrange the Items of an ItemsControlDeclaring the ItemsPanel to arrange the Items of an ItemsControl
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.