GroupBox Demo

image_pdfimage_print


   
  
<Window x:Class="SimpleStyles.Window1"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  Title="SimpleStyles"
  Background="#F8F8F8">
  <ScrollViewer>
    <WrapPanel>
      <HeaderedItemsControl Header="GroupBox">
        <StackPanel>
          <GroupBox Margin="8" Header="This is the Header" Width="200" >
            <Border Height="100" />
          </GroupBox>
        </StackPanel>
      </HeaderedItemsControl>
   
    </WrapPanel>
  </ScrollViewer>
</Window>

   
    
     


GroupBox Header with mixed content

image_pdfimage_print


   
            

<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      HorizontalAlignment="Center" VerticalAlignment="Center">
<GroupBox>
  <GroupBox.Header>
    <StackPanel Orientation="Horizontal">
      <TextBlock Text="A" FontStyle="Italic" VerticalAlignment="Center" />
      <TextBlock Text="B" VerticalAlignment="Center" />
      <Ellipse Fill="Red" Width="20" Height="60" />
      <TextBlock Text="C" VerticalAlignment="Center" FontWeight="Bold" />
      <Button Content="_header" VerticalAlignment="Center" />
    </StackPanel>
  </GroupBox.Header>
  <TextBlock Text="Boring content" />
</GroupBox>
</Page>

   
    
    
    
    
    
    
    
    
    
    
    
     


Expander Header

image_pdfimage_print


   
 
<Window x:Class="SimpleStyles.Window1"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  Title="SimpleStyles"
  Background="#F8F8F8">
  <ScrollViewer>
    <WrapPanel>
      <HeaderedItemsControl Header="Expander">
        <StackPanel Orientation="Horizontal">
          <Expander Width="200" Margin="8"  Header="This is the Header">
            <Border Height="100" />
          </Expander>
        </StackPanel>
      </HeaderedItemsControl>
   
    </WrapPanel>
  </ScrollViewer>
</Window>

   
     


HierarchicalDataTemplate data binding

image_pdfimage_print


   
    

<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="XML Data Binding">
<Grid xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  <Grid.Resources>
    <HierarchicalDataTemplate DataType="Employees" ItemsSource="{Binding XPath=*}">
      <TextBlock FontStyle="Italic" Text="All Game Stats"/>
    </HierarchicalDataTemplate>
    <HierarchicalDataTemplate DataType="Employee" ItemsSource="{Binding XPath=*}">
      <TextBlock FontWeight="Bold" FontSize="20" Text="{Binding XPath=@Type}"/>
    </HierarchicalDataTemplate>
    <DataTemplate DataType="YearOfWorking">
      <TextBlock Foreground="Blue" Text="{Binding XPath=.}"/>
    </DataTemplate>
    <XmlDataProvider x:Key="dataProvider" XPath="Employees">
      <x:XData>
        <Employees xmlns="">
          <Employee Type="Beginner">
            <YearOfWorking>1</YearOfWorking>
          </Employee>
          <Employee Type="Intermediate">
            <YearOfWorking>2</YearOfWorking>
          </Employee>
          <Employee Type="Advanced">
            <YearOfWorking>3</YearOfWorking>
          </Employee>
        </Employees>
      </x:XData>
    </XmlDataProvider>
  </Grid.Resources>
    <TreeView ItemsSource="{Binding Source={StaticResource dataProvider},XPath=.}" />
</Grid>

</Window>

   
    
    
    
     


HierarchicalDataTemplate with Menu

image_pdfimage_print


   
     
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="XML Data Binding">
  <Window.Resources>
    <HierarchicalDataTemplate DataType="Employees" ItemsSource="{Binding XPath=*}">
      <TextBlock FontStyle="Italic" Text="All Game Stats"/>
    </HierarchicalDataTemplate>
    <HierarchicalDataTemplate DataType="Employee" ItemsSource="{Binding XPath=*}">
      <TextBlock FontWeight="Bold" FontSize="20" Text="{Binding XPath=@Type}"/>
    </HierarchicalDataTemplate>
    <DataTemplate DataType="YearOfWorking">
      <TextBlock Foreground="Blue" Text="{Binding XPath=.}"/>
    </DataTemplate>
    <XmlDataProvider x:Key="dataProvider" XPath="Employees">
      <x:XData>
        <Employees xmlns="">
          <Employee Type="Beginner">
            <YearOfWorking>1</YearOfWorking>
          </Employee>
          <Employee Type="Intermediate">
            <YearOfWorking>2</YearOfWorking>
          </Employee>
          <Employee Type="Advanced">
            <YearOfWorking>3</YearOfWorking>
          </Employee>
        </Employees>
      </x:XData>
    </XmlDataProvider>
  </Window.Resources>
  <Grid>
    <Menu ItemsSource="{Binding Source={StaticResource dataProvider},XPath=.}" />
  </Grid>
</Window>

   
    
    
    
    
     


External Web Links

image_pdfimage_print


   
 

<Page x:Class="NavigationApplication.ExternalLinks"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="ExternalLinks" 
    >
  <TextBlock Margin="3" TextWrapping="Wrap">
    Visit the website
    <Hyperlink NavigateUri="http://www.kutayzorlu.com/java2s/com">www.kutayzorlu.com/java2s/com</Hyperlink>.
    <LineBreak />
  </TextBlock>
</Page>

   
     


Link To Another Page

image_pdfimage_print


   
 
<Page x:Class="NavigationApplication.LinkToAssemblyPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="LinkToAssemblyPage">
  <StackPanel Margin="3">
    <TextBlock Margin="3" TextWrapping="Wrap">
      This is a simple page.
      Click <Hyperlink NavigateUri="/PageLibrary;component/SharedPage.xaml">here</Hyperlink>.
    </TextBlock>


  </StackPanel>
</Page>