You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
228 lines
9.6 KiB
228 lines
9.6 KiB
<!--*********************************************************************
|
|
|
|
Extended WPF Toolkit
|
|
|
|
Copyright (C) 2010-2012 Xceed Software Inc.
|
|
|
|
This program is provided to you under the terms of the Microsoft Public
|
|
License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license
|
|
|
|
This program can be provided to you by Xceed Software Inc. under a
|
|
proprietary commercial license agreement for use in non-Open Source
|
|
projects. The commercial version of Extended WPF Toolkit also includes
|
|
priority technical support, commercial updates, and many additional
|
|
useful WPF controls if you license Xceed Business Suite for WPF.
|
|
|
|
Visit http://xceed.com and follow @datagrid on Twitter.
|
|
|
|
********************************************************************-->
|
|
<sample:DemoView x:Class="Samples.Modules.Pie.Views.HomeView"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:sample="clr-namespace:Samples.Infrastructure.Controls;assembly=Samples.Infrastructure"
|
|
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
|
xmlns:local="clr-namespace:Samples.Modules.Pie.Views"
|
|
Title="Pie"
|
|
Description="The Pie shape is a WPF shape that represents a portion of an ellipse. It is in the same shape as a slice of pie (hence the name). More precisely, the Pie shape is represented as either a full ellipse (Slice = 1.0), nothing (Slice = 0.0), or an arc of an ellipse joined to its center by two line segments."
|
|
x:Name="demo">
|
|
<sample:DemoView.Resources>
|
|
<xctk:ColorToSolidColorBrushConverter x:Key="colorConverter" />
|
|
</sample:DemoView.Resources>
|
|
|
|
<Grid HorizontalAlignment="Stretch"
|
|
VerticalAlignment="Stretch">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto"/>
|
|
<ColumnDefinition Width="*"/>
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<GroupBox Header="Features"
|
|
HorizontalAlignment="Left"
|
|
VerticalAlignment="Stretch"
|
|
Margin="20,0,0,0">
|
|
<Grid DataContext="{Binding ElementName=pie}"
|
|
Width="337">
|
|
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="113" />
|
|
<ColumnDefinition Width="145" />
|
|
<ColumnDefinition Width="79" />
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="45" />
|
|
<RowDefinition Height="45" />
|
|
<RowDefinition Height="45" />
|
|
<RowDefinition Height="45" />
|
|
<RowDefinition Height="45" />
|
|
<RowDefinition Height="45" />
|
|
<RowDefinition Height="45" />
|
|
</Grid.RowDefinitions>
|
|
|
|
<TextBlock Grid.Row="0"
|
|
Grid.Column="0"
|
|
Text="Mode"
|
|
VerticalAlignment="Center"
|
|
Height="Auto"
|
|
HorizontalAlignment="Left"
|
|
Margin="20,0,0,0"
|
|
/>
|
|
<ComboBox Grid.Row="0"
|
|
Grid.Column="1"
|
|
Grid.ColumnSpan="1"
|
|
HorizontalAlignment="Stretch"
|
|
Height="26"
|
|
Width="Auto"
|
|
Margin="10,5,10,5"
|
|
SelectedItem="{Binding Mode}"
|
|
SelectionChanged="ComboBox_SelectionChanged">
|
|
<x:StaticExtension Member="xctk:PieMode.Manual" />
|
|
<x:StaticExtension Member="xctk:PieMode.EndAngle" />
|
|
<x:StaticExtension Member="xctk:PieMode.Slice" />
|
|
</ComboBox>
|
|
|
|
<TextBlock Grid.Row="1"
|
|
Grid.Column="0"
|
|
Text="Start Angle"
|
|
VerticalAlignment="Center"
|
|
Height="Auto"
|
|
HorizontalAlignment="Left"
|
|
Margin="20,0,0,0" />
|
|
<Slider Grid.Row="1"
|
|
Grid.Column="1"
|
|
VerticalAlignment="Center"
|
|
Minimum="0"
|
|
Maximum="360"
|
|
Width="Auto"
|
|
Value="{Binding StartAngle}"
|
|
Height="Auto"
|
|
HorizontalAlignment="Stretch"
|
|
Margin="10,5,10,5"
|
|
Grid.ColumnSpan="1" />
|
|
<TextBlock Grid.Row="1"
|
|
Grid.Column="2"
|
|
Width="50"
|
|
Text="{Binding StartAngle}"
|
|
VerticalAlignment="Center"
|
|
Height="Auto"
|
|
TextTrimming="CharacterEllipsis" />
|
|
|
|
<TextBlock Grid.Row="2"
|
|
Grid.Column="0"
|
|
Text="End Angle"
|
|
VerticalAlignment="Center"
|
|
Height="Auto"
|
|
HorizontalAlignment="Left"
|
|
Margin="20,0,0,0" />
|
|
<Slider x:Name="endAngleSlider"
|
|
Grid.Row="2"
|
|
Grid.Column="1"
|
|
VerticalAlignment="Center"
|
|
Minimum="0"
|
|
Maximum="360"
|
|
Width="Auto"
|
|
Value="{Binding EndAngle}"
|
|
Height="Auto"
|
|
HorizontalAlignment="Stretch"
|
|
Margin="10,5,10,5"
|
|
Grid.ColumnSpan="1" />
|
|
<TextBlock Grid.Row="2"
|
|
Grid.Column="2"
|
|
Width="50"
|
|
Text="{Binding EndAngle}"
|
|
VerticalAlignment="Center"
|
|
Height="Auto"
|
|
TextTrimming="CharacterEllipsis" />
|
|
|
|
<TextBlock Grid.Row="3"
|
|
Grid.Column="0"
|
|
Text="Slice"
|
|
VerticalAlignment="Center"
|
|
Height="Auto"
|
|
HorizontalAlignment="Left"
|
|
Margin="20,0,0,0" />
|
|
<Slider x:Name="sliceSlider"
|
|
Grid.Row="3"
|
|
Grid.Column="1"
|
|
VerticalAlignment="Center"
|
|
Minimum="0"
|
|
Maximum="1"
|
|
Width="Auto"
|
|
Value="{Binding Slice}"
|
|
Height="Auto"
|
|
HorizontalAlignment="Stretch"
|
|
Margin="10,5,10,5"
|
|
Grid.ColumnSpan="1" />
|
|
<TextBlock Grid.Row="3"
|
|
Grid.Column="2"
|
|
Width="50"
|
|
Text="{Binding Slice}"
|
|
VerticalAlignment="Center"
|
|
Height="Auto"
|
|
TextTrimming="CharacterEllipsis" />
|
|
|
|
<TextBlock Grid.Row="4"
|
|
Grid.Column="0"
|
|
Margin="20,5,0,5"
|
|
Text="Sweep Direction"
|
|
HorizontalAlignment="Left"
|
|
VerticalAlignment="Center" />
|
|
<ComboBox Grid.Row="4"
|
|
Grid.Column="1"
|
|
Grid.ColumnSpan="1"
|
|
HorizontalAlignment="Stretch"
|
|
Height="26"
|
|
Width="Auto"
|
|
Margin="10,5,10,5"
|
|
SelectedValue="{Binding SweepDirection}"
|
|
SelectedValuePath="Content">
|
|
<ComboBoxItem Content="{x:Static SweepDirection.Clockwise}" />
|
|
<ComboBoxItem Content="{x:Static SweepDirection.Counterclockwise}" />
|
|
</ComboBox>
|
|
|
|
<TextBlock Grid.Row="5"
|
|
Grid.Column="0"
|
|
Margin="20,5,0,5"
|
|
Text="Fill Color"
|
|
HorizontalAlignment="Left"
|
|
VerticalAlignment="Center" />
|
|
<xctk:ColorPicker x:Name="FillSelector"
|
|
Grid.Row="5"
|
|
Grid.Column="1"
|
|
Grid.ColumnSpan="1"
|
|
HorizontalAlignment="Stretch"
|
|
SelectedColor="#FF5318A5"
|
|
Height="26"
|
|
Margin="10,5,10,5"
|
|
Width="Auto" />
|
|
<TextBlock Grid.Row="6"
|
|
Grid.Column="0"
|
|
Margin="20,5,0,5"
|
|
Text="Stroke Color"
|
|
HorizontalAlignment="Left"
|
|
VerticalAlignment="Center" />
|
|
<xctk:ColorPicker x:Name="StrokeSelector"
|
|
Grid.Row="6"
|
|
Grid.Column="1"
|
|
Grid.ColumnSpan="1"
|
|
HorizontalAlignment="Stretch"
|
|
SelectedColor="Black"
|
|
Height="26"
|
|
Margin="10,5,10,5"
|
|
Width="Auto" />
|
|
</Grid>
|
|
</GroupBox>
|
|
<xctk:Pie x:Name="pie"
|
|
Grid.Column="1"
|
|
Height="{Binding ElementName=pie, Path=ActualWidth}"
|
|
Fill="{Binding ElementName=FillSelector, Path=SelectedColor, Mode=OneWay, Converter={StaticResource colorConverter}}"
|
|
Stroke="{Binding ElementName=StrokeSelector, Path=SelectedColor, Mode=OneWay, Converter={StaticResource colorConverter}}"
|
|
StrokeThickness="2"
|
|
StartAngle="180"
|
|
SweepDirection="Clockwise"
|
|
Margin="20,0,0,0"
|
|
HorizontalAlignment="Stretch"
|
|
VerticalAlignment="Center" />
|
|
|
|
</Grid>
|
|
</sample:DemoView>
|
|
|