Animated Clip Examples


   
    

<Window x:Class="Workspace.DockExample"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Workspace" Width="640" Height="480">
      <Image Source="c:image.jpg" 
        Width="200" Height="150" HorizontalAlignment="Left">
        <Image.Clip>
          <EllipseGeometry x:Name="MyEllipseGeometry1"
            RadiusX="100"
            RadiusY="75"
            Center="100,75"/>
        </Image.Clip>
        <Image.Triggers>
          <EventTrigger RoutedEvent="Image.Loaded">
            <BeginStoryboard>
              <Storyboard>
                <PointAnimation 
                  Storyboard.TargetName="MyEllipseGeometry1" 
                  Storyboard.TargetProperty="(EllipseGeometry.Center)"
                  From="0,0" To="200,150" Duration="0:0:3" RepeatBehavior="Forever" 
                  AutoReverse="True" />
                </Storyboard>
            </BeginStoryboard>
          </EventTrigger>
        </Image.Triggers>
      </Image> 

</Window>

   
    
    
    
     


Image with ContextMenu


   
    

<Window x:Class="ControlDemos.menu"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="ControlDemos" Height="300" Width="300">
      <Image Name="image1" Source="file:///c:/image.jpg">
        <Image.ContextMenu>
          <ContextMenu>
            <MenuItem Header="CheckStates">
              <MenuItem Header="A" IsCheckable="True" IsChecked="True" Name="mnuItem1" ></MenuItem>
              <MenuItem Header="B" IsCheckable="True" IsChecked="False"></MenuItem>
              <MenuItem Header="C" IsCheckable="False" IsChecked="False"></MenuItem>
              <MenuItem Header="D" IsCheckable="False" IsChecked="True">
                <MenuItem.ToolTip>
                  <StackPanel Orientation="Horizontal">
                    <Image Source="c:image.jpg"></Image>
                    <Label>picture tooltip</Label>
                  </StackPanel>
                </MenuItem.ToolTip>
              </MenuItem>
            </MenuItem>
          </ContextMenu>
        </Image.ContextMenu>
      </Image>
</Window>

   
    
    
    
     


Link To Another Page


   
 
<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>

   
     


External Web Links


   
 

<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>

   
     


HierarchicalDataTemplate with Menu


   
     
<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>

   
    
    
    
    
     


HierarchicalDataTemplate data binding


   
    

<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>

   
    
    
    
     


Expander Header


   
 
<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>