Counterclockwise (default), IsLargeArc

image_pdfimage_print


   
   
<Canvas xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">


    <Path Stroke="Blue" StrokeThickness="3">
        <Path.Data>
            <PathGeometry>
                <PathFigure StartPoint="144 144">
                    <ArcSegment Point="240 240" Size="144 96"
                                RotationAngle="45"
                                IsLargeArc="True" />
                </PathFigure>
            </PathGeometry>
        </Path.Data>
    </Path>

</Canvas>

   
    
    
     


Clockwise, small arc (default)

image_pdfimage_print


   
   
<Canvas xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">


    <Path Stroke="Green" StrokeThickness="3">
        <Path.Data>
            <PathGeometry>
                <PathFigure StartPoint="144 144">
                    <ArcSegment Point="240 240" Size="144 96"
                                RotationAngle="45"
                                SweepDirection="ClockWise" />
                </PathFigure>
            </PathGeometry>
        </Path.Data>
    </Path>

</Canvas>

   
    
    
     


Clockwise, IsLargeArc

image_pdfimage_print


   
   
<Canvas xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">


    <Path Stroke="Purple" StrokeThickness="3">
        <Path.Data>
            <PathGeometry>
                <PathFigure StartPoint="144 144">
                    <ArcSegment Point="240 240" Size="144 96"
                                RotationAngle="45"
                                SweepDirection="ClockWise"
                                IsLargeArc="True" />
                </PathFigure>
            </PathGeometry>
        </Path.Data>
    </Path>

</Canvas>

   
    
    
     


Eclipse Sun

image_pdfimage_print


   
      

<Canvas xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <Path Fill="Gray" Stroke="Black" StrokeThickness="3">
        <Path.Data>
            <GeometryGroup>
                <EllipseGeometry Center="96 300" RadiusX="48" RadiusY="48" />
                <EllipseGeometry Center="300 100" RadiusX="48" RadiusY="48">
                    <EllipseGeometry.Transform>
                        <RotateTransform x:Name="rotate"
                                         CenterX="300" CenterY="300" />
                    </EllipseGeometry.Transform>
                </EllipseGeometry>
            </GeometryGroup>
        </Path.Data>
    </Path>

    <Canvas.Triggers>
        <EventTrigger RoutedEvent="Canvas.Loaded">
            <BeginStoryboard>
                <Storyboard>
                    <DoubleAnimation Storyboard.TargetName="rotate"
                                     Storyboard.TargetProperty="Angle"
                                     From="0" To="360" Duration="0:0:5"
                                     RepeatBehavior="Forever" />
                </Storyboard>
            </BeginStoryboard>
        </EventTrigger>
    </Canvas.Triggers>
</Canvas>

   
    
    
    
    
    
     


Large ArcSegments

image_pdfimage_print


   
      

<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      HorizontalAlignment="Stretch" VerticalAlignment="Stretch">


<Canvas>
  <Ellipse Fill="Cyan" Stroke="Black" Width="140" Height="60" />
  <Path Fill="Cyan" Stroke="Black" Canvas.Left="180">
    <Path.Data>
      <PathGeometry>

        <PathFigure StartPoint="240,1" IsClosed="True">
          <ArcSegment Point="290,51" Size="70,30"
                      SweepDirection="Counterclockwise" IsLargeArc="True" />
        </PathFigure>

      </PathGeometry>
    </Path.Data>
  </Path>
</Canvas>


</Page>

   
    
    
    
    
    
     


Clear Controls

image_pdfimage_print


   
  
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    x:Class="ElemCollMethods.Pane1"
    WindowTitle="UI Element Collection Methods Sample">
 <StackPanel>
    <TextBlock Name="txt" FontSize="16">UI Element Collection - Methods</TextBlock>

    <TabControl>
    
        <TabItem MouseLeftButtonUp="ClearButtons">
            <TabItem.Header>Clear Controls</TabItem.Header>
        </TabItem>
    </TabControl>
    <StackPanel Name="sp1"></StackPanel>

 </StackPanel>
</Page>

//File:Window.xaml.cs
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Data;
using System.Windows.Input;

namespace ElemCollMethods
{

  public partial class Pane1 : Page
  {
    System.Windows.Controls.Button btn, btn1, btn2, btn3;


    void ClearButtons(object sender, MouseButtonEventArgs e)
    {
            sp1.Children.Clear();
            btn = new Button();
      btn.Content = "Click to clear";
            sp1.Children.Add(btn);
            btn.Click += (ClearControls);
      btn1 = new Button();
      btn1.Content = "Click to clear";
            sp1.Children.Add(btn1);
            btn1.Click += (ClearControls);
      btn2 = new Button();
      btn2.Content = "Click to clear";
            sp1.Children.Add(btn2);
            btn2.Click += (ClearControls);
      btn3 = new Button();
      btn3.Content = "Click to clear";
            sp1.Children.Add(btn3);
            btn3.Click += (ClearControls);
    }
        
    void ClearControls(object sender, RoutedEventArgs e)
    {
            sp1.Children.Clear();
        }    
  }
}