BoucherS_cp 12 years ago
parent
commit
e9b0e7a50c
  1. 93
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartAxisView.xaml.cs.txt
  2. 197
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartAxisView.xaml.txt
  3. 3
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartLegendView.xaml.cs.txt
  4. 131
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartLegendView.xaml.txt
  5. 122
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartSeriesBasicTypesView.xaml.cs.txt
  6. 137
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartSeriesBasicTypesView.xaml.txt
  7. 3
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartSeriesDataPointsBindingView.xaml.cs.txt
  8. 40
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartSeriesDataPointsBindingView.xaml.txt
  9. 3
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingAxesGridView.xaml.cs.txt
  10. 182
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingAxesGridView.xaml.txt
  11. 3
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingColumnSeriesView.xaml.cs.txt
  12. 171
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingColumnSeriesView.xaml.txt
  13. 12
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingLineSeriesView.xaml.cs.txt
  14. 137
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingLineSeriesView.xaml.txt
  15. 3
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingPieSeriesView.xaml.cs.txt
  16. 171
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingPieSeriesView.xaml.txt
  17. 2
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChildWindowView.xaml.txt
  18. 159
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/DisplayLocalizationRes.fr.resx.txt
  19. 159
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/DisplayLocalizationRes.resx.txt
  20. 8
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ListBoxView.xaml.cs.txt
  21. 1097
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ListBoxView.xaml.txt
  22. 25
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MultiColumnComboBoxView.xaml.cs.txt
  23. 134
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MultiColumnComboBoxView.xaml.txt
  24. 122
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PileFlowPanelView.xaml.cs.txt
  25. 312
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PileFlowPanelView.xaml.txt
  26. 4
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridAttributesView.xaml.cs.txt
  27. 11
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridCustomPropertyView.xaml.cs.txt
  28. 55
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridCustomPropertyView.xaml.txt
  29. 20
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridDefinitionKeyView.xaml.cs.txt
  30. 18
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridDefinitionKeyView.xaml.txt
  31. 93
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridDisplayLocalizationView.xaml.cs.txt
  32. 29
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridDisplayLocalizationView.xaml.txt
  33. 45
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridEditorDefinitionsView.xaml.cs.txt
  34. 101
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridEditorDefinitionsView.xaml.txt
  35. 3
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridMultiSelectedObjectsView.xaml.cs.txt
  36. 33
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridMultiSelectedObjectsView.xaml.txt
  37. 50
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridPropertiesSourceView.xaml.cs.txt
  38. 49
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridPropertiesSourceView.xaml.txt
  39. 12
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridPropertiesView.xaml.cs.txt
  40. 69
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridPropertiesView.xaml.txt
  41. 2
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridSpecifyingPropertiesView.xaml.cs.txt
  42. 12
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridSpecifyingPropertiesView.xaml.txt
  43. 23
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/RadialGaugeView.xaml.cs.txt
  44. 1019
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/RadialGaugeView.xaml.txt
  45. 33
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/RatingView.xaml.cs.txt
  46. 432
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/RatingView.xaml.txt
  47. 66
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/StylableWindowView.xaml.cs.txt
  48. 38
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/StylableWindowView.xaml.txt
  49. 466
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/SwitchPanelView.xaml.cs.txt
  50. 830
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/SwitchPanelView.xaml.txt
  51. 129
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingAvalonDockView.xaml.cs.txt
  52. 352
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingAvalonDockView.xaml.txt
  53. 158
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingCoreWPFView.xaml.cs.txt
  54. 1003
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingCoreWPFView.xaml.txt
  55. 94
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingDataGridView.xaml.cs.txt
  56. 537
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingDataGridView.xaml.txt
  57. 99
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingExtendedToolkitView.xaml.cs.txt
  58. 502
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingExtendedToolkitView.xaml.txt
  59. 154
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingListBoxView.xaml.cs.txt
  60. 347
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingListBoxView.xaml.txt
  61. 1
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/WindowContainerView.xaml.cs.txt
  62. 2
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/CollectionControl/Implementation/CollectionControlDialog.xaml.cs
  63. 11
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Core/Primitives/UpDownBase.cs
  64. 21
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/DateTimeUpDown/Implementation/DateTimeUpDown.cs
  65. 2
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/NumericUpDown/Themes/Aero2.NormalColor.xaml
  66. 2
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/NumericUpDown/Themes/Generic.xaml
  67. 5
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/PropertyGrid/Implementation/Definitions/PropertyDefinitionBase.cs
  68. 11
      Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/PropertyGrid/Implementation/ObjectContainerHelperBase.cs
  69. 2
      Main/Source/ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/CollectionControl/Implementation/CollectionControlDialog.xaml.cs
  70. 11
      Main/Source/ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/Core/Primitives/UpDownBase.cs
  71. 21
      Main/Source/ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/DateTimeUpDown/Implementation/DateTimeUpDown.cs
  72. 2
      Main/Source/ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/NumericUpDown/Themes/Aero2.NormalColor.xaml
  73. 2
      Main/Source/ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/NumericUpDown/Themes/Generic.xaml
  74. 5
      Main/Source/ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/PropertyGrid/Implementation/Definitions/PropertyDefinitionBase.cs
  75. 11
      Main/Source/ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/PropertyGrid/Implementation/ObjectContainerHelperBase.cs

93
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartAxisView.xaml.cs.txt

@ -14,6 +14,9 @@
************************************************************************************/ ************************************************************************************/
#if !OPEN_SOURCE
using Xceed.Wpf.Toolkit.Chart;
#endif
using System.Windows.Media; using System.Windows.Media;
using System.Windows.Controls; using System.Windows.Controls;
using System; using System;
@ -26,33 +29,119 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Chart.Views
/// </summary> /// </summary>
public partial class ChartAxisView : DemoView public partial class ChartAxisView : DemoView
{ {
#if !OPEN_SOURCE
#region Members
private static DataPointsList<DataPoint> _numericDataPoints = new DataPointsList<DataPoint>()
{ new DataPoint(1, 1)
, new DataPoint(2, 2)
, new DataPoint(1.5, 3)
, new DataPoint(5, 3.5)
};
private static DataPointsList<DataPoint> _dateTimeDataPoints = new DataPointsList<DataPoint>()
{
new DataPoint( new System.DateTime( 2000, 1, 1 ).ToOADate(), 1 )
, new DataPoint( new System.DateTime( 2001, 1, 1 ).ToOADate(), 2 )
, new DataPoint( new System.DateTime( 2002, 5, 5 ).ToOADate(), 4 )
, new DataPoint( new System.DateTime( 2003, 1, 1 ).ToOADate(), 3 )
};
private static DataPointsList<DataPoint> _labelsDataPoints = new DataPointsList<DataPoint>()
{
new DataPoint( 0, 5, "Zeus" )
, new DataPoint( 0, 2, "Poseidon" )
, new DataPoint( 0, 3, "Hades" )
, new DataPoint( 0, 4, "Hestia" )
, new DataPoint( 0, 1, "Hera" )
};
#endregion
#region Dependency Properties
public static readonly DependencyProperty SelectedAxisProperty = DependencyProperty.Register(
"SelectedAxis",
typeof( Axis ),
typeof( ChartAxisView ),
new UIPropertyMetadata( null ) );
#endregion
#region Properties
public Axis SelectedAxis
{
get
{
return ( Axis )GetValue( SelectedAxisProperty );
}
set
{
SetValue( SelectedAxisProperty, value );
}
}
#endregion
#endif
#region Initialization #region Initialization
public ChartAxisView() public ChartAxisView()
{ {
InitializeComponent(); InitializeComponent();
#if !OPEN_SOURCE
_axisComboBox.SelectedIndex = 0;
_xAxis.DateTimeFormat = System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern;
#endif
} }
#endregion #endregion
#if !OPEN_SOURCE
#region Event Handlers
private void OnAxisComboBoxSelectionChanged( object sender, SelectionChangedEventArgs e )
{
ComboBox comboBox = ( ComboBox )sender;
this.SelectedAxis = ( comboBox.SelectedIndex == 0 ) ? _xAxis : _yAxis;
}
private void OnAxisLabelsTypeChanged( object sender, SelectionChangedEventArgs e )
{
ComboBox comboBox = ( ComboBox )sender;
switch( (LabelsType)comboBox.SelectedItem )
{
case LabelsType.Numeric:
this.SetSeriesDataPoints( _numericDataPoints );
break;
case LabelsType.DateTime:
this.SetSeriesDataPoints( _dateTimeDataPoints );
break;
case LabelsType.Labels :
this.SetSeriesDataPoints( _labelsDataPoints );
this.SelectedAxis.GraduationMode = AxisGraduationMode.Manual;
break;
}
}
#endregion
#endif
#region Implementation #region Implementation
#if !OPEN_SOURCE
private void SetSeriesDataPoints( DataPointsList<DataPoint> list )
{
if( _series != null )
{
_series.DataPoints.Clear();
foreach( DataPoint dataPoint in list )
_series.DataPoints.Add( dataPoint );
}
}
#endif
#endregion #endregion
} }
} }

197
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartAxisView.xaml.txt

@ -25,29 +25,196 @@
<local:DemoView.Description> <local:DemoView.Description>
<Paragraph FontSize="14" FontFamily="Segoe"> <Paragraph FontSize="14" FontFamily="Segoe">
<Run>The chart's Axis class represents the x- and y-axis of an area (Area class) in a chart. They can be individually configured with many properties.</Run> <Run>The chart's Axis class represents the x- and y-axis of an area (Area class) in a chart. They can be individually configured with many properties.</Run>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
<LineBreak /> <LineBreak />
<Hyperlink NavigateUri="http://www.xceed.com/Extended_WPF_Toolkit_Intro.html" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="http://www.xceed.com/Extended_WPF_Toolkit_Intro.html" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Extended WPF Toolkit Plus. Click here for more details about Xceed Extended WPF Toolkit Plus.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
<!--##EXCLUDE_OPEN_SOURCE-->
<local:DemoView.Resources>
<ObjectDataProvider x:Key="AxisLabelsType" MethodName="GetValues"
ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="xctk:LabelsType" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<ObjectDataProvider x:Key="AxisGraduationMode" MethodName="GetValues"
ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="xctk:AxisGraduationMode" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<ObjectDataProvider x:Key="AxisScaleMode" MethodName="GetValues"
ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="xctk:AxisScaleMode" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<ObjectDataProvider x:Key="AxisLabelLayout" MethodName="GetValues"
ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="xctk:AxisLabelLayout" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<x:Array x:Key="AxisArray" Type="sys:String">
<sys:String>X Axis</sys:String>
<sys:String>Y Axis</sys:String>
</x:Array>
<conv:GraduationModeToComboBoxConverter x:Key="GraduationModeToComboBoxConverter" />
<conv:LabelsTypeToPropertyEnabledConverter x:Key="LabelsTypeToPropertyEnabledConverter" />
<conv:ScaleModeToPropertyEnabledConverter x:Key="ScaleModeToPropertyEnabledConverter" />
<conv:AxesLabelsTypePropertyEnabledConverter x:Key="AxesLabelsTypePropertyEnabledConverter" />
<sys:String x:Key="AxisLabelsLayoutTooltip">
Resize the window along the orientation of the selected axis to see all labels (staggered) or only the ones that fit (every second, third label, etc., is omitted).
</sys:String>
</local:DemoView.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<GroupBox Header="Features" Grid.Row="0" Margin="5">
<Grid Margin="5" HorizontalAlignment="Left">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<!-- 1st column -->
<TextBlock Text="Axis: " VerticalAlignment="Center" FontWeight="Bold" FontSize="13"/>
<ComboBox x:Name="_axisComboBox" FontWeight="Bold" FontSize="13" Grid.Column="1" ItemsSource="{StaticResource AxisArray}" SelectionChanged="OnAxisComboBoxSelectionChanged" Width="100" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5"/>
<TextBlock Text="Labels Type: " Grid.Row="1" VerticalAlignment="Center" />
<ComboBox x:Name="_labelsType" Grid.Row="1" Grid.Column="1" ItemsSource="{Binding Source={StaticResource AxisLabelsType}}" SelectedItem="{Binding SelectedAxis.LabelsType, ElementName=_demo}" SelectionChanged="OnAxisLabelsTypeChanged" IsEnabled="{Binding SelectedIndex, ElementName=_axisComboBox, Converter={StaticResource AxesLabelsTypePropertyEnabledConverter}}" Width="100" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" />
<TextBlock Text="Graduation Mode: " Grid.Row="2" VerticalAlignment="Center" IsEnabled="{Binding IsEnabled, ElementName=_graduationMode}" />
<ComboBox x:Name="_graduationMode" Grid.Row="2" Grid.Column="1" ItemsSource="{Binding Source={StaticResource AxisGraduationMode}}" Width="100" IsEnabled="{Binding SelectedItem, ElementName=_labelsType, Converter={StaticResource LabelsTypeToPropertyEnabledConverter}}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5">
<ComboBox.SelectedItem>
<MultiBinding Converter="{StaticResource GraduationModeToComboBoxConverter}" >
<Binding Path="SelectedAxis.GraduationMode" ElementName="_demo" />
<Binding Path="SelectedAxis.LabelsType" ElementName="_demo" />
</MultiBinding>
</ComboBox.SelectedItem>
</ComboBox>
<TextBlock Text="Scale Mode: " Grid.Row="3" VerticalAlignment="Center" />
<ComboBox x:Name="_scaleMode" Grid.Row="3" Grid.Column="1" ItemsSource="{Binding Source={StaticResource AxisScaleMode}}" SelectedItem="{Binding SelectedAxis.ScaleMode, ElementName=_demo}" Width="100" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" />
<TextBlock Text="Custom Range Start: " Grid.Row="4" VerticalAlignment="Center" IsEnabled="{Binding SelectedItem, ElementName=_scaleMode, Converter={StaticResource ScaleModeToPropertyEnabledConverter}}" Style="{StaticResource DisableGrayText}"/>
<xctk:DoubleUpDown x:Name="_customRangeStart" Grid.Row="4" Grid.Column="1" Minimum="0" Maximum="{Binding Value, ElementName=_customRangeEnd}" Value="{Binding SelectedAxis.CustomRangeStart, ElementName=_demo}" Width="100" IsEnabled="{Binding SelectedItem, ElementName=_scaleMode, Converter={StaticResource ScaleModeToPropertyEnabledConverter}}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" />
<TextBlock Text="Custom Range End: " Grid.Row="5" VerticalAlignment="Center" IsEnabled="{Binding SelectedItem, ElementName=_scaleMode, Converter={StaticResource ScaleModeToPropertyEnabledConverter}}" Style="{StaticResource DisableGrayText}"/>
<xctk:DoubleUpDown x:Name="_customRangeEnd" Grid.Row="5" Grid.Column="1" Minimum="{Binding Value, ElementName=_customRangeStart}" Maximum="100" Value="{Binding SelectedAxis.CustomRangeEnd, ElementName=_demo}" Width="100" IsEnabled="{Binding SelectedItem, ElementName=_scaleMode, Converter={StaticResource ScaleModeToPropertyEnabledConverter}}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" />
<!-- 2nd column -->
<TextBlock Text="Title: " Grid.Column="2" VerticalAlignment="Center" Margin="10,0,0,0"/>
<TextBox Grid.Column="3" Text="{Binding SelectedAxis.Title, ElementName=_demo, UpdateSourceTrigger=PropertyChanged}" Width="100" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" />
<TextBlock Text="Title Margin: " Grid.Row="1" Grid.Column="2" VerticalAlignment="Center" Margin="10,0,0,0"/>
<xctk:IntegerUpDown Grid.Row="1" Grid.Column="3" Minimum="0" Maximum="100" Value="{Binding SelectedAxis.TitleMargin, ElementName=_demo}" Width="100" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" />
<TextBlock Text="Axis Labels Layout: " Grid.Row="2" Grid.Column="2" VerticalAlignment="Center" Margin="10,0,0,0"/>
<ComboBox Grid.Row="2" Grid.Column="3" ItemsSource="{Binding Source={StaticResource AxisLabelLayout}}" SelectedItem="{Binding SelectedAxis.AxisLabelsLayout, ElementName=_demo}" ToolTip="{StaticResource AxisLabelsLayoutTooltip}" Width="100" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" />
<TextBlock Text="Ticks Count: " Grid.Row="3" Grid.Column="2" VerticalAlignment="Center" Margin="10,0,0,0"/>
<xctk:IntegerUpDown Grid.Row="3" Grid.Column="3" Minimum="0" Maximum="100" Value="{Binding SelectedAxis.TicksCount, ElementName=_demo}" Width="100" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" />
<TextBlock Text="Reversed: " Grid.Row="4" Grid.Column="2" VerticalAlignment="Center" Margin="10,0,0,0"/>
<CheckBox Grid.Row="4" Grid.Column="3" IsChecked="{Binding SelectedAxis.Reversed, ElementName=_demo}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" />
<!-- 3rd column -->
<TextBlock Text="Show Arrow: " Grid.Column="4" VerticalAlignment="Center" Margin="10,0,0,0"/>
<CheckBox Grid.Column="5" IsChecked="{Binding SelectedAxis.ShowArrow, ElementName=_demo}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" />
<TextBlock Text="Show Axis: " Grid.Row="1" Grid.Column="4" VerticalAlignment="Center" Margin="10,0,0,0"/>
<CheckBox Grid.Row="1" Grid.Column="5" IsChecked="{Binding SelectedAxis.ShowAxis, ElementName=_demo}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" />
<TextBlock Text="Show Grid Lines: " Grid.Row="2" Grid.Column="4" VerticalAlignment="Center" Margin="10,0,0,0"/>
<CheckBox Grid.Row="2" Grid.Column="5" IsChecked="{Binding SelectedAxis.ShowGridLines, ElementName=_demo}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" />
<TextBlock Text="Show Ticks: " Grid.Row="3" Grid.Column="4" VerticalAlignment="Center" Margin="10,0,0,0"/>
<CheckBox Grid.Row="3" Grid.Column="5" IsChecked="{Binding SelectedAxis.ShowTicks, ElementName=_demo}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" />
<TextBlock Text="Show Tick Labels: " Grid.Row="4" Grid.Column="4" VerticalAlignment="Center" Margin="10,0,0,0"/>
<CheckBox Grid.Row="4" Grid.Column="5" IsChecked="{Binding SelectedAxis.ShowTickLabels, ElementName=_demo}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" />
<TextBlock Text="Show Axis Label: " Grid.Row="5" Grid.Column="4" VerticalAlignment="Center" Margin="10,0,0,0"/>
<CheckBox Grid.Row="5" Grid.Column="5" IsChecked="{Binding SelectedAxis.ShowAxisLabel, ElementName=_demo}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" />
</Grid>
</GroupBox>
<TextBlock Grid.Row="1" Text="Usage:" Style="{StaticResource Header}" Margin="10"/>
<xctk:Chart Grid.Row="2" MinHeight="200" ShowLegend="False">
<xctk:Chart.Areas>
<xctk:Area Title="Area #1">
<xctk:Area.XAxis>
<xctk:Axis x:Name="_xAxis"
LabelsType="Numeric"
GraduationMode="Automatic"
TicksCount="10"
ScaleMode="Automatic"
CustomRangeStart="0"
CustomRangeEnd="10"
Title="X Axis"
TitleMargin="10"
AxisLabelsLayout="ShowAll"
ShowArrow="False"
ShowAxis="True"
ShowGridLines="True"
ShowTicks="True"
ShowTickLabels="True"
ShowAxisLabel="True"
Reversed="False"/>
</xctk:Area.XAxis>
<xctk:Area.YAxis>
<xctk:Axis x:Name="_yAxis"
LabelsType="Numeric"
GraduationMode="Automatic"
TicksCount="10"
ScaleMode="Automatic"
CustomRangeStart="0"
CustomRangeEnd="10"
Title="Y Axis"
TitleMargin="10"
AxisLabelsLayout="ShowAll"
ShowArrow="False"
ShowAxis="True"
ShowGridLines="True"
ShowTicks="True"
ShowTickLabels="True"
ShowAxisLabel="True"
Reversed="False"/>
</xctk:Area.YAxis>
<xctk:Area.Series>
<xctk:Series x:Name="_series"
DefaultInterior="Red">
<xctk:Series.Layout>
<xctk:ColumnLayout/>
</xctk:Series.Layout>
</xctk:Series>
</xctk:Area.Series>
</xctk:Area>
</xctk:Chart.Areas>
</xctk:Chart>
</Grid>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<Image Source="..\OpenSourceImages\ChartAxis.png" Width="600" Height="400"/> <Image Source="..\OpenSourceImages\ChartAxis.png" Width="600" Height="400"/>
##END-->
</local:DemoView> </local:DemoView>

3
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartLegendView.xaml.cs.txt

@ -14,6 +14,9 @@
**************************************************************************************/ **************************************************************************************/
#if !OPEN_SOURCE
using Xceed.Wpf.Toolkit.Chart;
#endif
using System.Windows.Media; using System.Windows.Media;
using System.Diagnostics; using System.Diagnostics;
namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Chart.Views namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Chart.Views

131
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartLegendView.xaml.txt

@ -28,24 +28,135 @@
<LineBreak /> <LineBreak />
<LineBreak /> <LineBreak />
<Run>A legend can be moved around, resized, and docked. Please note that a legend can be resized only when its Dock property is set to Float and if the AllowResize property is set to true.</Run> <Run>A legend can be moved around, resized, and docked. Please note that a legend can be resized only when its Dock property is set to Float and if the AllowResize property is set to true.</Run>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
<LineBreak /> <LineBreak />
<Hyperlink NavigateUri="http://www.xceed.com/Extended_WPF_Toolkit_Intro.html" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="http://www.xceed.com/Extended_WPF_Toolkit_Intro.html" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Extended WPF Toolkit Plus. Click here for more details about Xceed Extended WPF Toolkit Plus.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
<!--##EXCLUDE_OPEN_SOURCE-->
<local:DemoView.Resources>
<ObjectDataProvider x:Key="LegendDock" MethodName="GetValues"
ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="xctk:LegendDock" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
</local:DemoView.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<GroupBox Header="Features" Grid.Row="0" Margin="5">
<Grid Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<!-- 1st column-->
<TextBlock Text="Dock: " VerticalAlignment="Center" />
<ComboBox Grid.Column="1" ItemsSource="{Binding Source={StaticResource LegendDock}}" SelectedItem="{Binding Dock, ElementName=_legend}" Width="75" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" />
<TextBlock Text="Title: " Grid.Row="1" VerticalAlignment="Center" />
<TextBox Grid.Row="1" Grid.Column="1" Text="{Binding Title, ElementName=_legend, UpdateSourceTrigger=PropertyChanged}" Width="100" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" />
<!-- 2nd column-->
<TextBlock Text="Allow Resize: " Grid.Column="2" VerticalAlignment="Center" Margin="10,0,0,0"/>
<CheckBox Grid.Column="3" IsChecked="{Binding AllowResize, ElementName=_legend}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" />
<TextBlock Text="Allow Move: " Grid.Row="1" Grid.Column="2" VerticalAlignment="Center" Margin="10,0,0,0"/>
<CheckBox x:Name="_allowMove" Grid.Row="1" Grid.Column="3" IsChecked="{Binding AllowMove, ElementName=_legend}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" />
<!--3rd column-->
<TextBlock Text="Allow Dock: " Grid.Column="4" VerticalAlignment="Center" IsEnabled="{Binding IsChecked, ElementName=_allowMove}" Margin="10,0,0,0" Style="{StaticResource DisableGrayText}"/>
<CheckBox Grid.Column="5" IsChecked="{Binding AllowDock, ElementName=_legend}" IsEnabled="{Binding IsChecked, ElementName=_allowMove}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" />
</Grid>
</GroupBox>
<TextBlock Grid.Row="1" Text="Usage:" Style="{StaticResource Header}" Margin="10"/>
<xctk:Chart Grid.Row="2" MinHeight="350">
<xctk:Chart.Legend>
<xctk:Legend x:Name="_legend"
Dock="Left"
AllowResize="True"
AllowDock="True"
AllowMove="True"
Title="Legend"/>
</xctk:Chart.Legend>
<xctk:Chart.Areas>
<xctk:Area Title="Wins/month">
<xctk:Area.XAxis>
<xctk:Axis ShowAxisLabel="False" ShowTickLabels="False" ShowTicks="False"/>
</xctk:Area.XAxis>
<xctk:Area.YAxis>
<xctk:Axis ShowAxisLabel="False" ShowTickLabels="False" ShowTicks="False"/>
</xctk:Area.YAxis>
<xctk:Area.Series>
<xctk:Series Title="Months"
DefaultInterior="Green"
ShowPointsInLegend="True"
ShowHintLabels="True">
<xctk:Series.Layout>
<xctk:PieLayout />
</xctk:Series.Layout>
<xctk:Series.DataPoints>
<xctk:DataPoint X="6" Y="6" Label="Jan" />
<xctk:DataPoint X="7" Y="7" Label="Feb"/>
<xctk:DataPoint X="4" Y="4" Label="Mar" />
<xctk:DataPoint X="2" Y="2" Label="Apr"/>
</xctk:Series.DataPoints>
</xctk:Series>
</xctk:Area.Series>
</xctk:Area>
<xctk:Area Title="Goals/player">
<xctk:Area.XAxis>
<xctk:Axis Title="Player's Name" LabelsType="Labels" GraduationMode="Manual"/>
</xctk:Area.XAxis>
<xctk:Area.YAxis>
<xctk:Axis Title="Goals" AxisLabelsLayout="ShowToFit"/>
</xctk:Area.YAxis>
<xctk:Area.Series>
<xctk:Series Title="Players"
DefaultInterior="Orange">
<xctk:Series.Layout>
<xctk:ColumnLayout />
</xctk:Series.Layout>
<xctk:Series.DataPoints>
<xctk:DataPoint Y="36" Label="Tom" />
<xctk:DataPoint Y="7" Label="Steven"/>
<xctk:DataPoint Y="24" Label="Kirk" />
<xctk:DataPoint Y="12" Label="Erik"/>
<xctk:DataPoint Y="10" Label="Scott"/>
</xctk:Series.DataPoints>
</xctk:Series>
</xctk:Area.Series>
</xctk:Area>
</xctk:Chart.Areas>
</xctk:Chart>
</Grid>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<Image Source="..\OpenSourceImages\ChartLegend.png" Width="600" Height="400"/> <Image Source="..\OpenSourceImages\ChartLegend.png" Width="600" Height="400"/>
##END-->
</local:DemoView> </local:DemoView>

122
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartSeriesBasicTypesView.xaml.cs.txt

@ -14,6 +14,9 @@
*************************************************************************************/ *************************************************************************************/
#if !OPEN_SOURCE
using Xceed.Wpf.Toolkit.Chart;
#endif
using System.Windows.Media; using System.Windows.Media;
using System.Windows; using System.Windows;
using Xceed.Wpf.Toolkit.Panels; using Xceed.Wpf.Toolkit.Panels;
@ -26,8 +29,16 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Chart.Views
/// </summary> /// </summary>
public partial class ChartSeriesBasicTypesView : DemoView public partial class ChartSeriesBasicTypesView : DemoView
{ {
#if !OPEN_SOURCE
#region Members
private Series _columnSeries;
private Series _lineSeries;
private Series _pieSeries;
private Series _areaSeries;
#endregion
#endif
#region Initialization #region Initialization
@ -38,15 +49,126 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Chart.Views
#endregion #endregion
#if !OPEN_SOURCE
#region Envent Handlers
private void OnSeriesCollectionChecked( object sender, RoutedEventArgs e )
{
this.AddDefaultSeries();
}
private void OnSeriesCollectionUnchecked( object sender, RoutedEventArgs e )
{
this.CleanDefaultSeries();
}
private void OnLayoutSelectionChanged( object sender, RoutedEventArgs e )
{
if( _seriesCollectionCheckBox.IsChecked.HasValue && _seriesCollectionCheckBox.IsChecked.Value )
{
this.CleanDefaultSeries();
this.AddDefaultSeries();
}
}
#endregion
#endif
#region Implementation #region Implementation
#if !OPEN_SOURCE
private void CleanDefaultSeries()
{
if( _area1.Series.Contains( _pieSeries ) )
{
_area1.Series.Remove( _pieSeries );
}
if( _area1.Series.Contains( _areaSeries ) )
{
_area1.Series.Remove( _areaSeries );
}
if( _area1.Series.Contains( _columnSeries ) )
{
_area1.Series.Remove( _columnSeries );
}
if( _area1.Series.Contains( _lineSeries ) )
{
_area1.Series.Remove( _lineSeries );
}
}
private void AddDefaultSeries()
{
if( _series.Layout.LayoutType != PredefinedLayoutTypes.Pie )
{
if( _pieSeries == null )
{
//init pieSeries
_pieSeries = new Series();
_pieSeries.DataPoints.Add( new DataPoint( 0, 1, "Cars" ) );
_pieSeries.DataPoints.Add( new DataPoint( 1, 2, "Toys" ) );
_pieSeries.DataPoints.Add( new DataPoint( 2, 2.5, "Trees" ) );
_pieSeries.DataPoints.Add( new DataPoint( 3, 4, "Pens" ) );
_pieSeries.Layout = new PieLayout();
_pieSeries.Title = "Pie Series";
_pieSeries.ShowPointsInLegend = true;
_pieSeries.DefaultInterior = Brushes.YellowGreen;
}
_area1.Series.Add( _pieSeries );
}
if( _series.Layout.LayoutType != PredefinedLayoutTypes.Area )
{
if( _areaSeries == null )
{
//init areaSeries
_areaSeries = new Series();
_areaSeries.DataPoints.Add( new DataPoint( -2, 0 ) );
_areaSeries.DataPoints.Add( new DataPoint( 0, 3.5 ) );
_areaSeries.DataPoints.Add( new DataPoint( 3, 1 ) );
_areaSeries.DataPoints.Add( new DataPoint( 5, 2.8 ) );
_areaSeries.DataPoints.Add( new DataPoint( 4, 1.5 ) );
_areaSeries.Layout = new AreaLayout();
_areaSeries.Title = "Area Series";
_areaSeries.DefaultInterior = Brushes.Orange;
}
_area1.Series.Add( _areaSeries );
}
if( _series.Layout.LayoutType != PredefinedLayoutTypes.Column )
{
if( _columnSeries == null )
{
//init columnSeries
_columnSeries = new Series();
_columnSeries.DataPoints.Add( new DataPoint( 1, 1 ) );
_columnSeries.DataPoints.Add( new DataPoint( 2, 2 ) );
_columnSeries.DataPoints.Add( new DataPoint( 2.5, 4 ) );
_columnSeries.DataPoints.Add( new DataPoint( 4, 3 ) );
_columnSeries.Title = "Column Series";
_columnSeries.DefaultInterior = Brushes.Red;
}
_area1.Series.Add( _columnSeries );
}
if( _series.Layout.LayoutType != PredefinedLayoutTypes.Line )
{
if( _lineSeries == null )
{
//init lineSeries
_lineSeries = new Series();
_lineSeries.DataPoints.Add( new DataPoint( 1, 1 ) );
_lineSeries.DataPoints.Add( new DataPoint( 2, 1 ) );
_lineSeries.DataPoints.Add( new DataPoint( 0.5, 1.5 ) );
_lineSeries.DataPoints.Add( new DataPoint( 3, 3 ) );
_lineSeries.DataPoints.Add( new DataPoint( 6, 2 ) );
_lineSeries.DataPoints.Add( new DataPoint( 5, 0.5 ) );
_lineSeries.Layout = new LineLayout();
_lineSeries.Title = "Line Series";
_lineSeries.DefaultInterior = Brushes.Black;
}
_area1.Series.Add( _lineSeries );
}
}
#endif
#endregion #endregion
} }

137
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartSeriesBasicTypesView.xaml.txt

@ -25,26 +25,139 @@
<local:DemoView.Description> <local:DemoView.Description>
<Paragraph FontSize="14" FontFamily="Segoe"> <Paragraph FontSize="14" FontFamily="Segoe">
<Run>A series contains DataPoint objects and are layed out in an area (Area class) of a chart. They can be displayed with predefined layouts, such as column (bar), line, area, or pie, or they can be displayed using a custom layout (not implemented in this sample).</Run> <Run>A series contains DataPoint objects and are layed out in an area (Area class) of a chart. They can be displayed with predefined layouts, such as column (bar), line, area, or pie, or they can be displayed using a custom layout (not implemented in this sample).</Run>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
<LineBreak /> <LineBreak />
<Hyperlink NavigateUri="http://www.xceed.com/Extended_WPF_Toolkit_Intro.html" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="http://www.xceed.com/Extended_WPF_Toolkit_Intro.html" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Extended WPF Toolkit Plus. Click here for more details about Xceed Extended WPF Toolkit Plus.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
<!--##EXCLUDE_OPEN_SOURCE-->
<local:DemoView.Resources>
<ObjectDataProvider x:Key="SeriesLayout" MethodName="GetValues"
ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="xctk:PredefinedLayoutTypes" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<conv:LayoutEngineToPredefinedLayoutConverter x:Key="LayoutEngineToPredefinedLayoutConverter" />
<conv:PredefinedLayoutToPropertyEnabledConverter x:Key="PredefinedLayoutToPropertyEnabledConverter" />
<conv:LineLengthToPropertyEnabledConverter x:Key="LineLengthToPropertyEnabledConverter" />
<xctkconv:SolidColorBrushToColorConverter x:Key="SolidColorBrushToColorConverter" />
<Style x:Key="ComboBoxItemStyle" TargetType="{x:Type ComboBoxItem}">
<Style.Triggers>
<DataTrigger Binding="{Binding}" Value="Custom">
<Setter Property="IsEnabled" Value="False"/>
</DataTrigger>
</Style.Triggers>
</Style>
</local:DemoView.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<GroupBox Header="Features" Grid.Row="0" Margin="5">
<Grid Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<!-- 1st column-->
<TextBlock Text="Layout: " VerticalAlignment="Center" />
<ComboBox x:Name="_layoutComboBox" Grid.Column="1" SelectedValue="{Binding Layout, ElementName=_series, Converter={StaticResource LayoutEngineToPredefinedLayoutConverter}}" SelectedValuePath="Content" ItemContainerStyle="{StaticResource ComboBoxItemStyle}" SelectionChanged="OnLayoutSelectionChanged" Width="75" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5">
<ComboBoxItem Content="{x:Static xctk:PredefinedLayoutTypes.Area}" />
<ComboBoxItem Content="{x:Static xctk:PredefinedLayoutTypes.Column}" />
<ComboBoxItem Content="{x:Static xctk:PredefinedLayoutTypes.Line}" />
<ComboBoxItem Content="{x:Static xctk:PredefinedLayoutTypes.Pie}" />
</ComboBox>
<TextBlock Grid.Row="1" Text="Title: " VerticalAlignment="Center" IsEnabled="{Binding IsEnabled, ElementName=_title}"/>
<TextBox x:Name="_title" Grid.Row="1" Grid.Column="1" Text="{Binding Title, ElementName=_series, UpdateSourceTrigger=PropertyChanged}" Width="75" IsEnabled="{Binding SelectedItem, ElementName=_layoutComboBox, Converter={StaticResource PredefinedLayoutToPropertyEnabledConverter}, ConverterParameter=title}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" />
<TextBlock Grid.Row="2" Text="Default Interior: " VerticalAlignment="Center" IsEnabled="{Binding IsEnabled, ElementName=_defaultInterior}"/>
<xctk:ColorPicker x:Name="_defaultInterior" Grid.Row="2" Grid.Column="1" SelectedColor="{Binding DefaultInterior, ElementName=_series, Converter={StaticResource SolidColorBrushToColorConverter}}" Width="75" IsEnabled="{Binding SelectedItem, ElementName=_layoutComboBox, Converter={StaticResource PredefinedLayoutToPropertyEnabledConverter}, ConverterParameter=defaultInterior}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" />
<!-- 2nd column-->
<TextBlock Grid.Column="2" Text="Show Hint Labels: " VerticalAlignment="Center" IsEnabled="{Binding IsEnabled, ElementName=_showHintLabels}" Margin="10,0,0,0" Style="{StaticResource DisableGrayText}"/>
<CheckBox x:Name="_showHintLabels" Grid.Column="3" IsChecked="{Binding ShowHintLabels, ElementName=_series}" IsEnabled="{Binding SelectedItem, ElementName=_layoutComboBox, Converter={StaticResource PredefinedLayoutToPropertyEnabledConverter}, ConverterParameter=showHintLabels}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" />
<TextBlock Grid.Row="1" Grid.Column="2" Text="Show Points in Legend: " IsEnabled="{Binding IsEnabled, ElementName=_showPointsInLegend}" VerticalAlignment="Center" Margin="10,0,0,0" Style="{StaticResource DisableGrayText}"/>
<CheckBox x:Name="_showPointsInLegend" Grid.Row="1" Grid.Column="3" IsChecked="{Binding ShowPointsInLegend, ElementName=_series}" IsEnabled="{Binding SelectedItem, ElementName=_layoutComboBox, Converter={StaticResource PredefinedLayoutToPropertyEnabledConverter}, ConverterParameter=showPointsInLegend}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" />
<!-- 3rd column-->
<TextBlock Grid.Column="4" Text="Hint Line Length: " VerticalAlignment="Center" IsEnabled="{Binding IsEnabled, ElementName=_hintLineLength}" Margin="10,0,0,0" Style="{StaticResource DisableGrayText}"/>
<xctk:IntegerUpDown x:Name="_hintLineLength" Grid.Column="5" Minimum="0" Maximum="200" Value="{Binding HintLineLength, ElementName=_series}" Width="75" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5">
<xctk:IntegerUpDown.IsEnabled>
<MultiBinding Converter="{StaticResource LineLengthToPropertyEnabledConverter}">
<Binding Path="SelectedItem" ElementName="_layoutComboBox" Converter="{StaticResource PredefinedLayoutToPropertyEnabledConverter}" ConverterParameter="hintLineLength" />
<Binding Path="IsChecked" ElementName="_showHintLabels" />
</MultiBinding>
</xctk:IntegerUpDown.IsEnabled>
</xctk:IntegerUpDown>
<TextBlock Grid.Row="1" Grid.Column="4" Text="Spacing: " VerticalAlignment="Center" IsEnabled="{Binding IsEnabled, ElementName=_spacing}" Margin="10,0,0,0" Style="{StaticResource DisableGrayText}"/>
<xctk:IntegerUpDown x:Name="_spacing" Grid.Row="1" Grid.Column="5" Minimum="0" Maximum="100" Value="{Binding Spacing, ElementName=_series}" Width="75" IsEnabled="{Binding SelectedItem, ElementName=_layoutComboBox, Converter={StaticResource PredefinedLayoutToPropertyEnabledConverter}, ConverterParameter=spacing}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" />
</Grid>
</GroupBox>
<TextBlock Grid.Row="1" Text="Usage:" Style="{StaticResource Header}" Margin="10"/>
<xctk:Chart Grid.Row="2" MinHeight="200">
<xctk:Chart.Areas>
<xctk:Area x:Name="_area1" Title="Area #1">
<xctk:Area.Series>
<xctk:Series x:Name="_series"
DefaultInterior="BlueViolet"
Spacing="20"
Title="Average"
ShowPointsInLegend="false"
ShowHintLabels="false"
HintLineLength="20">
<xctk:Series.Layout>
<xctk:LineLayout />
</xctk:Series.Layout>
<xctk:Series.DataPoints>
<xctk:DataPoint X="1" Y="1" Label="Oct" />
<xctk:DataPoint X="2" Y="2" Label="Jan"/>
<xctk:DataPoint X="2.5" Y="1.5" Label="Feb" />
<xctk:DataPoint X="4" Y="1" Label="Jun"/>
<xctk:DataPoint X="1.5" Y="3" Label="Dec"/>
<xctk:DataPoint X="5" Y="5" Label="Apr"/>
<xctk:DataPoint X="3" Y="1" Label="Nov"/>
<xctk:DataPoint X="4.5" Y="7" Label="Jul"/>
<xctk:DataPoint X="3.5" Y="4.5" Label="Aug"/>
</xctk:Series.DataPoints>
</xctk:Series>
</xctk:Area.Series>
</xctk:Area>
</xctk:Chart.Areas>
</xctk:Chart>
<TextBlock Grid.Row="3" Text="A collection of Series instances can be added to an Area. Use the following Checkbox to display 3 new Series along with the current one." TextWrapping="Wrap" Margin="0,15,0,5" />
<CheckBox Grid.Row="4" x:Name="_seriesCollectionCheckBox" IsChecked="False" Checked="OnSeriesCollectionChecked" Unchecked="OnSeriesCollectionUnchecked" Content="Display 4 Series in one Area" Margin="0,0,0,10" />
</Grid>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<Image Source="..\OpenSourceImages\ChartBasicTypes.png" Width="600" Height="400"/> <Image Source="..\OpenSourceImages\ChartBasicTypes.png" Width="600" Height="400"/>
##END-->
</local:DemoView> </local:DemoView>

3
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartSeriesDataPointsBindingView.xaml.cs.txt

@ -14,6 +14,9 @@
************************************************************************************/ ************************************************************************************/
#if !OPEN_SOURCE
using Xceed.Wpf.Toolkit.Chart;
#endif
using System.Windows.Media; using System.Windows.Media;
using System; using System;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;

40
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartSeriesDataPointsBindingView.xaml.txt

@ -26,17 +26,57 @@
<local:DemoView.Description> <local:DemoView.Description>
<Paragraph FontSize="14" FontFamily="Segoe"> <Paragraph FontSize="14" FontFamily="Segoe">
<Run>The DataPoint objects of a chart's series can be set by binding with the Series.DataPointsSource property. From there, a DataPointBinding can be set on the X, Y, or Label property of a DataPoint.</Run> <Run>The DataPoint objects of a chart's series can be set by binding with the Series.DataPointsSource property. From there, a DataPointBinding can be set on the X, Y, or Label property of a DataPoint.</Run>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
<LineBreak /> <LineBreak />
<Hyperlink NavigateUri="http://www.xceed.com/Extended_WPF_Toolkit_Intro.html" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="http://www.xceed.com/Extended_WPF_Toolkit_Intro.html" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xced Extended WPF Toolkit Plus. Click here for more details about Xced Extended WPF Toolkit Plus.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
<!--##EXCLUDE_OPEN_SOURCE-->
<local:DemoView.Resources>
<sample:Persons x:Key="Persons"/>
<CollectionViewSource x:Key="PersonCollection" Source="{Binding Source={StaticResource Persons}, Path=PersonList}" />
</local:DemoView.Resources>
<Grid Margin="10">
<xctk:Chart MinHeight="300" ShowLegend="False">
<xctk:Chart.Areas>
<xctk:Area>
<xctk:Area.XAxis>
<xctk:Axis Title="Persons" GraduationMode="Manual" LabelsType="Labels"/>
</xctk:Area.XAxis>
<xctk:Area.YAxis>
<xctk:Axis Title="Skill Level" />
</xctk:Area.YAxis>
<xctk:Area.Series>
<xctk:Series DataPointsSource="{Binding Source={StaticResource PersonCollection}}">
<xctk:Series.DataPointBindings>
<xctk:BindingInfo PropertyName="Y">
<xctk:BindingInfo.Binding>
<Binding Path="Skill"/>
</xctk:BindingInfo.Binding>
</xctk:BindingInfo>
<xctk:BindingInfo PropertyName="Label">
<xctk:BindingInfo.Binding>
<Binding Path="Name"/>
</xctk:BindingInfo.Binding>
</xctk:BindingInfo>
</xctk:Series.DataPointBindings>
</xctk:Series>
</xctk:Area.Series>
</xctk:Area>
</xctk:Chart.Areas>
</xctk:Chart>
</Grid>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<Image Source="..\OpenSourceImages\ChartSeriesDataPointsBinding.png" Width="600" Height="400"/> <Image Source="..\OpenSourceImages\ChartSeriesDataPointsBinding.png" Width="600" Height="400"/>
##END-->
</local:DemoView> </local:DemoView>

3
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingAxesGridView.xaml.cs.txt

@ -14,6 +14,9 @@
************************************************************************************/ ************************************************************************************/
#if !OPEN_SOURCE
using Xceed.Wpf.Toolkit.Chart;
#endif
using System.Windows.Media; using System.Windows.Media;
using System.Windows.Controls; using System.Windows.Controls;
using System; using System;

182
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingAxesGridView.xaml.txt

@ -24,32 +24,178 @@
<local:DemoView.Description> <local:DemoView.Description>
<Paragraph FontSize="14" FontFamily="Segoe"> <Paragraph FontSize="14" FontFamily="Segoe">
<Run>This sample shows how AxesGrid elements can be styled using a DataTemplate.</Run> <Run>This sample shows how AxesGrid elements can be styled using a DataTemplate.</Run>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
<LineBreak /> <LineBreak />
<Hyperlink NavigateUri="http://www.xceed.com/Extended_WPF_Toolkit_Intro.html" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="http://www.xceed.com/Extended_WPF_Toolkit_Intro.html" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Extended WPF Toolkit Plus. Click here for more details about Xceed Extended WPF Toolkit Plus.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
<!--##EXCLUDE_OPEN_SOURCE-->
<local:DemoView.Resources>
<DataTemplate x:Key="BackgroundTemplate">
<Rectangle Margin="-5,-5,-5,-5" RadiusX="25" RadiusY="25" StrokeThickness="3" Stroke="Blue" Fill="#FFFFE1">
<Rectangle.BitmapEffect>
<DropShadowBitmapEffect/>
</Rectangle.BitmapEffect>
</Rectangle>
</DataTemplate>
<DataTemplate x:Key="AxisTitleTemplate">
<Border DockPanel.Dock="Top" BorderThickness="1" CornerRadius="4">
<Border.Background>
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
<GradientStop Color="White" Offset="0.0" />
<GradientStop Color="SkyBlue" Offset="1.0" />
</LinearGradientBrush>
</Border.Background>
<TextBlock FontFamily="Comic Sans MS" FontSize="18" Margin="2,2,2,1"
HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Binding Path=Text}">
<TextBlock.Foreground>
<SolidColorBrush Color="Black"/>
</TextBlock.Foreground>
</TextBlock>
</Border>
</DataTemplate>
<DataTemplate x:Key="GridTemplateX">
<Canvas Width="{Binding Path=W}" Height="{Binding Path=H}">
<Polyline Points="{Binding Path=Points}" StrokeThickness="1" Stroke="Red" StrokeDashArray="1 5 1 1" />
</Canvas>
</DataTemplate>
<DataTemplate x:Key="GridTemplateY">
<Canvas Width="{Binding Path=W}" Height="{Binding Path=H}">
<Polyline Points="{Binding Path=Points}" StrokeThickness="1" Stroke="Green" StrokeDashArray="8 3 1 3"/>
</Canvas>
</DataTemplate>
<DataTemplate x:Key="TickTemplateX">
<Canvas Width="{Binding Path=W}" Height="{Binding Path=H}">
<Line X1="{Binding Path=XStart}" Y1="{Binding Path=YStart}" X2="{Binding Path=XEnd}" Y2="{Binding Path=YEnd}" StrokeThickness="5" Stroke="Red"/>
</Canvas>
</DataTemplate>
<DataTemplate x:Key="TickTemplateY">
<Canvas Width="{Binding Path=W}" Height="{Binding Path=H}">
<Line X1="{Binding Path=XStart}" Y1="{Binding Path=YStart}" X2="{Binding Path=XEnd}" Y2="{Binding Path=YEnd}" StrokeThickness="5" Stroke="Green"/>
</Canvas>
</DataTemplate>
<DataTemplate x:Key="ArrowTemplate">
<Polyline Points="{Binding Path=Points}"
StrokeThickness="2" Stroke="Blue"/>
</DataTemplate>
<DataTemplate x:Key="LabelTemplateX">
<Border DockPanel.Dock="Top" BorderThickness="1" CornerRadius="4">
<Border.Background>
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
<GradientStop Color="Yellow" Offset="0.0" />
<GradientStop Color="Red" Offset="1.0" />
</LinearGradientBrush>
</Border.Background>
<TextBlock FontFamily="Comic Sans MS" FontSize="18" Margin="2,2,2,1"
HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Binding Path=Text}">
<TextBlock.Foreground>
<SolidColorBrush Color="Black"/>
</TextBlock.Foreground>
</TextBlock>
</Border>
</DataTemplate>
<DataTemplate x:Key="LabelTemplateY">
<Border DockPanel.Dock="Top" BorderThickness="1" CornerRadius ="4">
<Border.Background>
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
<GradientStop Color="Yellow" Offset="0.0" />
<GradientStop Color="LimeGreen" Offset="1.0" />
</LinearGradientBrush>
</Border.Background>
<TextBlock FontFamily="Comic Sans MS" FontSize="18" Margin="2,2,2,1"
HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Binding Path=Text}">
<TextBlock.Foreground>
<SolidColorBrush Color="Black"/>
</TextBlock.Foreground>
</TextBlock>
</Border>
</DataTemplate>
<DataTemplate x:Key="AxisTemplate">
<Polyline Points="{Binding Path=Points}"
StrokeThickness="2" Stroke="Blue"/>
</DataTemplate>
</local:DemoView.Resources>
<Grid>
<xctk:Chart MinHeight="300" ShowLegend="False">
<xctk:Chart.Areas>
<xctk:Area BackgroundTemplate="{StaticResource BackgroundTemplate}" Margin="25,25,25,25">
<xctk:Area.XAxis>
<xctk:Axis AxisTitleTemplate="{StaticResource AxisTitleTemplate}"
GridTemplate="{StaticResource GridTemplateX}"
TickTemplate="{StaticResource TickTemplateX}"
ArrowTemplate="{StaticResource ArrowTemplate}"
LabelTemplate="{StaticResource LabelTemplateX}">
<xctk:Axis.Template>
<ControlTemplate TargetType="{x:Type xctk:Axis}">
<ContentPresenter ContentTemplate="{StaticResource AxisTemplate}"/>
</ControlTemplate>
</xctk:Axis.Template>
<xctk:Axis.Arrow>
<xctk:Arrow Length="20" Thickness="10"/>
</xctk:Axis.Arrow>
</xctk:Axis>
</xctk:Area.XAxis>
<xctk:Area.YAxis>
<xctk:Axis Reversed="true"
AxisTitleTemplate="{StaticResource AxisTitleTemplate}"
GridTemplate="{StaticResource GridTemplateY}"
TickTemplate="{StaticResource TickTemplateY}"
ArrowTemplate="{StaticResource ArrowTemplate}"
LabelTemplate="{StaticResource LabelTemplateY}">
<xctk:Axis.Template>
<ControlTemplate TargetType="{x:Type xctk:Axis}">
<ContentPresenter ContentTemplate="{StaticResource AxisTemplate}"/>
</ControlTemplate>
</xctk:Axis.Template>
<xctk:Axis.Arrow>
<xctk:Arrow Length="20" Thickness="10"/>
</xctk:Axis.Arrow>
</xctk:Axis>
</xctk:Area.YAxis>
<xctk:Area.Series>
<xctk:Series>
<xctk:Series.DataPoints>
<xctk:DataPoint X="1" Y="1" />
<xctk:DataPoint X="2" Y="3"/>
<xctk:DataPoint X="3" Y="2"/>
<xctk:DataPoint X="4" Y="5"/>
<xctk:DataPoint X="5" Y="4"/>
</xctk:Series.DataPoints>
<xctk:Series.Layout>
<xctk:LineLayout/>
</xctk:Series.Layout>
</xctk:Series>
</xctk:Area.Series>
</xctk:Area>
</xctk:Chart.Areas>
</xctk:Chart>
</Grid>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<Image Source="..\OpenSourceImages\ChartStylingAxesGrid.png" Width="600" Height="400"/> <Image Source="..\OpenSourceImages\ChartStylingAxesGrid.png" Width="600" Height="400"/>
##END-->
</local:DemoView> </local:DemoView>

3
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingColumnSeriesView.xaml.cs.txt

@ -14,6 +14,9 @@
*************************************************************************************/ *************************************************************************************/
#if !OPEN_SOURCE
using Xceed.Wpf.Toolkit.Chart;
#endif
using System.Windows.Media; using System.Windows.Media;
using System.Windows.Controls; using System.Windows.Controls;
using System.Diagnostics; using System.Diagnostics;

171
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingColumnSeriesView.xaml.txt

@ -25,26 +25,175 @@
<local:DemoView.Description> <local:DemoView.Description>
<Paragraph FontSize="14" FontFamily="Segoe"> <Paragraph FontSize="14" FontFamily="Segoe">
<Run>This sample shows how a series with a column layout type and a legend can be styled using DataTemplates.</Run> <Run>This sample shows how a series with a column layout type and a legend can be styled using DataTemplates.</Run>
<!--##EXCLUDE_OPEN_SOURCE-->
<Run>Please move mouse on line and markers to see simple effects.</Run>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
<LineBreak /> <LineBreak />
<Hyperlink NavigateUri="http://www.xceed.com/Extended_WPF_Toolkit_Intro.html" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="http://www.xceed.com/Extended_WPF_Toolkit_Intro.html" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Extended WPF Toolkit Plus. Click here for more details about Xceed Extended WPF Toolkit Plus.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
<!--##EXCLUDE_OPEN_SOURCE-->
<local:DemoView.Resources>
<sample:Persons x:Key="persons"/>
<CollectionViewSource x:Key="PersonCollection" Source="{Binding Source={StaticResource persons}, Path=PersonList}"/>
<DataTemplate x:Key="legendTemplate">
<DockPanel VerticalAlignment="Center">
<Image Source="{Binding Path=Photo}" Width="32" Height="32" Margin="5,1,1,1"/>
<TextBlock Text="{Binding Path=Name}" FontSize="11" VerticalAlignment="Center" Margin="5,1,2,1"/>
</DockPanel>
</DataTemplate>
<Style x:Key="TextBoxTextStyle" TargetType="TextBlock">
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="FontFamily" Value="Comic Sans MS"/>
<Setter Property="FontSize" Value="12"/>
<Style.Triggers>
<EventTrigger RoutedEvent="Mouse.MouseEnter">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="FontSize" To="19" Duration="0:0:0.4"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
<EventTrigger RoutedEvent="Mouse.MouseLeave">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="FontSize" To="12" Duration="0:0:0.4" />
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
</Style.Triggers>
</Style>
<Style TargetType="Button">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<ContentPresenter/>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="ContentTemplate">
<Setter.Value>
<DataTemplate>
<Grid Width="{Binding Path=ActualWidth, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Button}}}"
Height="{Binding Path=ActualHeight, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Button}}}">
<Rectangle RadiusX="5" RadiusY="5" >
<Rectangle.Triggers>
<EventTrigger RoutedEvent="Mouse.MouseEnter">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="Opacity" To="0.5" Duration="0:0:0.4"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
<EventTrigger RoutedEvent="Mouse.MouseLeave">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="Opacity" To="1" Duration="0:0:0.4" />
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
</Rectangle.Triggers>
<Rectangle.Fill>
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
<GradientStop Color="Yellow" Offset="0.0" />
<GradientStop Color="Orange" Offset="0.25" />
<GradientStop Color="CornflowerBlue" Offset="0.75" />
<GradientStop Color="LimeGreen" Offset="1.0" />
</LinearGradientBrush>
</Rectangle.Fill>
</Rectangle>
<ContentPresenter VerticalAlignment="Center" Content="{Binding Path=Content, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Button}}}"/>
</Grid>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
<DataTemplate x:Key="seriesTemplate">
<Button x:Name="Bar">
<StackPanel>
<DockPanel>
<TextBlock Text="Name: " Style="{StaticResource TextBoxTextStyle}" />
<TextBlock Text="{Binding Path=Content.Name}" Style="{StaticResource TextBoxTextStyle}" />
</DockPanel>
<DockPanel>
<TextBlock Text="Skill: " Style="{StaticResource TextBoxTextStyle}" />
<TextBlock Text="{Binding Path=Content.Skill}" Style="{StaticResource TextBoxTextStyle}" />
</DockPanel>
<TextBlock Text="Photo:" Style="{StaticResource TextBoxTextStyle}"/>
<Image Source="{Binding Path=Content.Photo}"/>
</StackPanel>
</Button>
</DataTemplate>
</local:DemoView.Resources>
<Grid>
<xctk:Chart MinHeight="400">
<xctk:Chart.Legend>
<xctk:Legend ItemTemplate="{StaticResource legendTemplate}" ItemsSource="{Binding Source={StaticResource PersonCollection}}" Title="Persons"/>
</xctk:Chart.Legend>
<xctk:Chart.Areas>
<xctk:Area >
<xctk:Area.XAxis>
<xctk:Axis GraduationMode="Manual" LabelsType="Labels"/>
</xctk:Area.XAxis>
<xctk:Area.YAxis>
<xctk:Axis Title="Skill"/>
</xctk:Area.YAxis>
<xctk:Area.Series>
<xctk:Series DataPointsSource="{Binding Source={StaticResource PersonCollection}}"
Template="{StaticResource seriesTemplate}"
ShowPointsInLegend="true">
<xctk:Series.DataPointBindings>
<xctk:BindingInfo PropertyName="X">
<xctk:BindingInfo.Binding>
<Binding Path="Age"/>
</xctk:BindingInfo.Binding>
</xctk:BindingInfo>
<xctk:BindingInfo PropertyName="Y">
<xctk:BindingInfo.Binding>
<Binding Path="Skill"/>
</xctk:BindingInfo.Binding>
</xctk:BindingInfo>
<xctk:BindingInfo PropertyName="Label">
<xctk:BindingInfo.Binding>
<Binding Path="Name"/>
</xctk:BindingInfo.Binding>
</xctk:BindingInfo>
</xctk:Series.DataPointBindings>
</xctk:Series>
</xctk:Area.Series>
</xctk:Area>
</xctk:Chart.Areas>
</xctk:Chart>
</Grid>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<Image Source="..\OpenSourceImages\ChartStylingColumnSeries.png" Width="600" Height="400"/> <Image Source="..\OpenSourceImages\ChartStylingColumnSeries.png" Width="600" Height="400"/>
##END-->
</local:DemoView> </local:DemoView>

12
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingLineSeriesView.xaml.cs.txt

@ -14,6 +14,9 @@
*************************************************************************************/ *************************************************************************************/
#if !OPEN_SOURCE
using Xceed.Wpf.Toolkit.Chart;
#endif
using System.Windows.Media; using System.Windows.Media;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows; using System.Windows;
@ -31,7 +34,16 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Chart.Views
InitializeComponent(); InitializeComponent();
} }
#if !OPEN_SOURCE
#region Event Handler
private void LegendButtonClick( object sender, RoutedEventArgs e )
{
Random r = new Random();
_series.DataPoints.Add( new DataPoint( _series.DataPoints.Count, r.NextDouble() ) );
}
#endregion
#endif
} }
} }

137
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingLineSeriesView.xaml.txt

@ -24,23 +24,144 @@
<local:DemoView.Description> <local:DemoView.Description>
<Paragraph FontSize="14" FontFamily="Segoe"> <Paragraph FontSize="14" FontFamily="Segoe">
<Run>This sample demonstrates how a series with a line layout type and a legend can be styled via DataTemplates. The legend contains a button to add new DataPoints.</Run> <Run>This sample demonstrates how a series with a line layout type and a legend can be styled via DataTemplates. The legend contains a button to add new DataPoints.</Run>
<!--##EXCLUDE_OPEN_SOURCE-->
<Run>Please move mouse along the line and over the markers to see simple effects.</Run>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
<LineBreak /> <LineBreak />
<Hyperlink NavigateUri="http://www.xceed.com/Extended_WPF_Toolkit_Intro.html" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="http://www.xceed.com/Extended_WPF_Toolkit_Intro.html" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Extended WPF Toolkit Plus. Click here for more details about Xceed Extended WPF Toolkit Plus.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
<!--##EXCLUDE_OPEN_SOURCE-->
<local:DemoView.Resources>
<DataTemplate x:Key="legendTemplate">
<DockPanel VerticalAlignment="Center">
<Path Width="32" Height="32" StrokeThickness="3" Data="M 0,24 Q 8,0 16,16 Q 24,32 32,8" >
<Path.Stroke>
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
<GradientStop Color="Green" Offset="1" />
<GradientStop Color="Yellow" Offset="0.5" />
<GradientStop Color="Red" Offset="0" />
</LinearGradientBrush>
</Path.Stroke>
</Path>
<TextBlock Text="{Binding Path=Text}" FontSize="11" VerticalAlignment="Center" Margin="5,1,2,1"/>
<Button Click="LegendButtonClick">Add DataPoint</Button>
</DockPanel>
</DataTemplate>
<DataTemplate x:Key="seriesTemplate">
<Canvas Width="{Binding Path=W}" Height="{Binding Path=H}">
<Polyline Points="{Binding Path=Points}" StrokeThickness="10" >
<Polyline.Triggers>
<EventTrigger RoutedEvent="Mouse.MouseEnter">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="StrokeThickness" To="20" Duration="0:0:0.4"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
<EventTrigger RoutedEvent="Mouse.MouseLeave">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="StrokeThickness" To="10" Duration="0:0:0.4" />
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
</Polyline.Triggers>
<Polyline.Stroke>
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
<GradientStop Color="Green" Offset="1" />
<GradientStop Color="Yellow" Offset="0.75" />
<GradientStop Color="Red" Offset="0" />
</LinearGradientBrush>
</Polyline.Stroke>
</Polyline>
</Canvas>
</DataTemplate>
<DataTemplate x:Key="markerTemplate">
<Ellipse Width="20" Height="20" >
<Ellipse.Triggers>
<EventTrigger RoutedEvent="Mouse.MouseEnter">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="Width" To="30" Duration="0:0:0.4"/>
<DoubleAnimation Storyboard.TargetProperty="Height" To="30" Duration="0:0:0.4"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
<EventTrigger RoutedEvent="Mouse.MouseLeave">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="Width" To="20" Duration="0:0:0.4" />
<DoubleAnimation Storyboard.TargetProperty="Height" To="20" Duration="0:0:0.4"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
</Ellipse.Triggers>
<Ellipse.Fill>
<RadialGradientBrush Center="0.3, 0.3" RadiusX="0.6" RadiusY="0.6">
<GradientStop Color="LightBlue" Offset="0" />
<GradientStop Color="Blue" Offset="1" />
</RadialGradientBrush>
</Ellipse.Fill>
</Ellipse>
</DataTemplate>
</local:DemoView.Resources>
<Grid>
<xctk:Chart MinHeight="300">
<xctk:Chart.Legend>
<xctk:Legend ItemTemplate="{StaticResource legendTemplate}"/>
</xctk:Chart.Legend>
<xctk:Chart.Areas>
<xctk:Area Title="Area1">
<xctk:Area.Series>
<xctk:Series x:Name="_series"
Title="Average/Month"
Template="{StaticResource seriesTemplate}"
MarkerTemplate="{StaticResource markerTemplate}">
<xctk:Series.DataPoints>
<xctk:DataPoint X="0" Y="0" />
<xctk:DataPoint X="1" Y="0.1" />
<xctk:DataPoint X="2" Y="0.3" />
<xctk:DataPoint X="3" Y="0.5" />
<xctk:DataPoint X="4" Y="0.88" />
<xctk:DataPoint X="5" Y="0.9" />
<xctk:DataPoint X="6" Y="0.95" />
</xctk:Series.DataPoints>
<xctk:Series.Layout>
<xctk:LineLayout/>
</xctk:Series.Layout>
</xctk:Series>
</xctk:Area.Series>
</xctk:Area>
</xctk:Chart.Areas>
</xctk:Chart>
</Grid>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<Image Source="..\OpenSourceImages\ChartStylingLineSeries.png" Width="600" Height="400"/> <Image Source="..\OpenSourceImages\ChartStylingLineSeries.png" Width="600" Height="400"/>
##END-->
</local:DemoView> </local:DemoView>

3
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingPieSeriesView.xaml.cs.txt

@ -14,6 +14,9 @@
*************************************************************************************/ *************************************************************************************/
#if !OPEN_SOURCE
using Xceed.Wpf.Toolkit.Chart;
#endif
using System.Windows.Media; using System.Windows.Media;
using System.Windows.Controls; using System.Windows.Controls;
using System; using System;

171
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingPieSeriesView.xaml.txt

@ -24,26 +24,175 @@
<local:DemoView.Description> <local:DemoView.Description>
<Paragraph FontSize="14" FontFamily="Segoe"> <Paragraph FontSize="14" FontFamily="Segoe">
<Run>This sample demonstrates how a series with a pie layout type can be styled via DataTemplates. The series, hint line, and hint label are all styled.</Run> <Run>This sample demonstrates how a series with a pie layout type can be styled via DataTemplates. The series, hint line, and hint label are all styled.</Run>
<!--##EXCLUDE_OPEN_SOURCE-->
<Run>Please move the mouse over the pie slices to view the tooltips of the pie layout DataTemplate.</Run>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
<LineBreak /> <LineBreak />
<Hyperlink NavigateUri="http://www.xceed.com/Extended_WPF_Toolkit_Intro.html" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="http://www.xceed.com/Extended_WPF_Toolkit_Intro.html" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Extended WPF Toolkit Plus. Click here for more details about Xceed Extended WPF Toolkit Plus.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
<!--##EXCLUDE_OPEN_SOURCE-->
<local:DemoView.Resources>
<sys:String x:Key="Name1">Mary</sys:String>
<sys:String x:Key="Name2">Brad</sys:String>
<sys:String x:Key="Name3">Anne</sys:String>
<sys:String x:Key="Name4">Eric</sys:String>
<sys:String x:Key="Name5">Lisa</sys:String>
<sys:String x:Key="Name6">Carl</sys:String>
<sys:String x:Key="Name7">Whole Team</sys:String>
<DataTemplate x:Key="GridBackgroundTemplate">
<Rectangle Width="{Binding Path=W}" Height="{Binding Path=H}" Margin="-5,-5,-5,-5"
RadiusX="25" RadiusY="25" StrokeThickness="1" Stroke="Gray" Fill="#FFFFE1">
<Rectangle.BitmapEffect>
<DropShadowBitmapEffect/>
</Rectangle.BitmapEffect>
</Rectangle>
</DataTemplate>
<DataTemplate x:Key="PieTemplate">
<Canvas Width="{Binding Path=W}" Height="{Binding Path=H}">
<Path x:Name="PieSlice" Stroke="Gray" StrokeThickness="2" Data="{Binding Path=Geometry}" Fill="{Binding Path=Interior}">
<Path.ToolTip>
<ToolTip>
<StackPanel Orientation="Vertical">
<TextBlock Text="Name:"/>
<TextBlock Text="{Binding Path=DataPoint.Label}"/>
<TextBlock Text="Skills:"/>
<TextBlock Text="{Binding Path=DataPoint.Y}"/>
</StackPanel>
</ToolTip>
</Path.ToolTip>
<Path.Triggers>
<EventTrigger RoutedEvent="Mouse.MouseEnter">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="Opacity" To="0.3" Duration="0:0:0.4"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
<EventTrigger RoutedEvent="Mouse.MouseLeave">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="Opacity" To="1" Duration="0:0:0.4" />
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
</Path.Triggers>
</Path>
</Canvas>
</DataTemplate>
<DataTemplate x:Key="HintLineTemplate">
<Canvas Width="{Binding Path=W}" Height="{Binding Path=H}">
<Polyline Points="{Binding Path=Points}" StrokeThickness="3" StrokeDashArray="2 1">
<Polyline.Stroke>
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
<GradientStop Color="Orange" Offset="1" />
<GradientStop Color="Blue" Offset="0.50" />
<GradientStop Color="Green" Offset="0" />
</LinearGradientBrush>
</Polyline.Stroke>
</Polyline>
</Canvas>
</DataTemplate>
<DataTemplate x:Key="HintLabelTemplate">
<Border DockPanel.Dock="Top" BorderThickness="1" CornerRadius ="4">
<Border.BorderBrush>
<SolidColorBrush Color="Gray"/>
</Border.BorderBrush>
<Border.Background>
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
<GradientStop Color="White" Offset="0.0" />
<GradientStop Color="SkyBlue" Offset="1.0" />
</LinearGradientBrush>
</Border.Background>
<StackPanel>
<TextBlock FontFamily="Sans Serif" FontSize="18" FontStyle="Oblique" Margin="2,2,2,1"
HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Binding Path=DataPoint.Label}"/>
<Image x:Name="_image" Width="20" Height="20"/>
</StackPanel>
</Border>
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding DataPoint.Label}" Value="{StaticResource Name1}">
<Setter Property="Source" Value="../Photo/1.bmp" TargetName="_image" />
</DataTrigger>
<DataTrigger Binding="{Binding DataPoint.Label}" Value="{StaticResource Name2}">
<Setter Property="Source" Value="../Photo/2.bmp" TargetName="_image" />
</DataTrigger>
<DataTrigger Binding="{Binding DataPoint.Label}" Value="{StaticResource Name3}">
<Setter Property="Source" Value="../Photo/3.bmp" TargetName="_image" />
</DataTrigger>
<DataTrigger Binding="{Binding DataPoint.Label}" Value="{StaticResource Name4}">
<Setter Property="Source" Value="../Photo/4.bmp" TargetName="_image" />
</DataTrigger>
<DataTrigger Binding="{Binding DataPoint.Label}" Value="{StaticResource Name5}">
<Setter Property="Source" Value="../Photo/5.bmp" TargetName="_image" />
</DataTrigger>
<DataTrigger Binding="{Binding DataPoint.Label}" Value="{StaticResource Name6}">
<Setter Property="Source" Value="../Photo/6.bmp" TargetName="_image" />
</DataTrigger>
</DataTemplate.Triggers>
</DataTemplate>
</local:DemoView.Resources>
<Grid>
<xctk:Chart MinHeight="400">
<xctk:Chart.Areas >
<xctk:Area Title="Area1" BackgroundTemplate="{StaticResource GridBackgroundTemplate}" Margin="10,25,20,25">
<xctk:Area.XAxis>
<xctk:Axis ShowAxisLabel="false" ShowGridLines="false" ShowAxis="false" ShowArrow="false" ShowTickLabels="false" ShowTicks="false" />
</xctk:Area.XAxis>
<xctk:Area.YAxis>
<xctk:Axis ShowAxisLabel="false" ShowGridLines="false" ShowAxis="false" ShowArrow="false" ShowTickLabels="false" ShowTicks="false" />
</xctk:Area.YAxis>
<xctk:Area.Series>
<xctk:Series Title="Family Members"
ShowPointsInLegend="true"
Template="{StaticResource PieTemplate}"
ShowHintLabels="true"
HintLineTemplate="{StaticResource HintLineTemplate}"
HintLabelTemplate="{StaticResource HintLabelTemplate}"
HintLineLength="30">
<xctk:Series.DataPoints>
<xctk:DataPoint Y="-3" Label="{StaticResource Name1}" />
<xctk:DataPoint Y="-2" Label="{StaticResource Name2}" />
<xctk:DataPoint Y="-1" Label="{StaticResource Name3}" />
<xctk:DataPoint Y="1" Label="{StaticResource Name4}"/>
<xctk:DataPoint Y="1" Label="{StaticResource Name5}"/>
<xctk:DataPoint Y="2" Label="{StaticResource Name6}"/>
<xctk:DataPoint Y="5" Label="{StaticResource Name7}"/>
</xctk:Series.DataPoints>
<xctk:Series.Layout>
<xctk:PieLayout/>
</xctk:Series.Layout>
</xctk:Series>
</xctk:Area.Series>
</xctk:Area>
</xctk:Chart.Areas>
</xctk:Chart>
</Grid>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<Image Source="..\OpenSourceImages\ChartStylingPieSeries.png" Width="600" Height="400"/> <Image Source="..\OpenSourceImages\ChartStylingPieSeries.png" Width="600" Height="400"/>
##END-->
</local:DemoView> </local:DemoView>

2
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChildWindowView.xaml.txt

@ -25,6 +25,7 @@
<local:DemoView.Description> <local:DemoView.Description>
<Paragraph FontSize="14" FontFamily="Segoe"> <Paragraph FontSize="14" FontFamily="Segoe">
<Run>The ChildWindow control can be used to create a window that is displayed within the bounds of a specific parent container.</Run> <Run>The ChildWindow control can be used to create a window that is displayed within the bounds of a specific parent container.</Run>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<LineBreak /> <LineBreak />
<Run>In addition to the following features, the "Plus" version allows ChildWindow to be resizable and to use a Maximize/Restore button.</Run> <Run>In addition to the following features, the "Plus" version allows ChildWindow to be resizable and to use a Maximize/Restore button.</Run>
@ -32,6 +33,7 @@
<Hyperlink NavigateUri="http://www.xceed.com/Extended_WPF_Toolkit_Intro.html" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="http://www.xceed.com/Extended_WPF_Toolkit_Intro.html" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Extended WPF Toolkit Plus. Click here for more details about Xceed Extended WPF Toolkit Plus.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>

159
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/DisplayLocalizationRes.fr.resx.txt

@ -1,159 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="DetailsCategory" xml:space="preserve">
<value>Détails</value>
</data>
<data name="FavoriteActor1" xml:space="preserve">
<value>Acteur favori 1 (aucun DisplayName)</value>
</data>
<data name="FavoriteActor1Desc" xml:space="preserve">
<value>Le type de cette propriété est un enum où les valeurs n'ont aucun attribut "DisplayName". Les valeurs affichées sont retournées par la méthode ToString().</value>
</data>
<data name="FavoriteActor2" xml:space="preserve">
<value>Acteur favori 2 (avec DisplayName)</value>
</data>
<data name="FavoriteActor2Desc" xml:space="preserve">
<value>Le type de cette propriété est un enum où les valeurs sont décorés avec l'attribut "DisplayName". Les valeurs affichées sont celles spécifiées par l'attribut ExtendedDisplayName.</value>
</data>
<data name="FavoriteActor3" xml:space="preserve">
<value>Acteur favori 3</value>
</data>
<data name="FavoriteActor3Desc" xml:space="preserve">
<value>La valeur "(Non proposé)" démontre que les valeurs des enums peuvent aussi être localisées.</value>
</data>
<data name="FirstName" xml:space="preserve">
<value>Prénom</value>
</data>
<data name="FirstNameDesc" xml:space="preserve">
<value>Prénom de la personne</value>
</data>
<data name="InfoCategory" xml:space="preserve">
<value>Information</value>
</data>
<data name="LastName" xml:space="preserve">
<value>Nom de famille</value>
</data>
<data name="LastNameDesc" xml:space="preserve">
<value>Le nom de famille de la personne</value>
</data>
<data name="NotListed" xml:space="preserve">
<value>(Non proposé)</value>
</data>
</root>

159
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/DisplayLocalizationRes.resx.txt

@ -1,159 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="DetailsCategory" xml:space="preserve">
<value>Details</value>
</data>
<data name="FavoriteActor1" xml:space="preserve">
<value>Favorite actor 1 (no DisplayName)</value>
</data>
<data name="FavoriteActor1Desc" xml:space="preserve">
<value>This property's type is an enum whose values have no DisplayName attributes. These values displayed are provided by the ToString() method.</value>
</data>
<data name="FavoriteActor2" xml:space="preserve">
<value>Favorite actor 2 (with DisplayName)</value>
</data>
<data name="FavoriteActor2Desc" xml:space="preserve">
<value>This property's type is an enum whose values are decorated with the ExtendedDisplayName attribute. Combined with the EnumDisplayNameConverter, this allows display values to be customized.</value>
</data>
<data name="FavoriteActor3" xml:space="preserve">
<value>Favorite actor 3</value>
</data>
<data name="FavoriteActor3Desc" xml:space="preserve">
<value>"(Not listed)" enum value shows that enum values can also be localized.</value>
</data>
<data name="FirstName" xml:space="preserve">
<value>First name</value>
</data>
<data name="FirstNameDesc" xml:space="preserve">
<value>First name of that person</value>
</data>
<data name="InfoCategory" xml:space="preserve">
<value>Information</value>
</data>
<data name="LastName" xml:space="preserve">
<value>Last name</value>
</data>
<data name="LastNameDesc" xml:space="preserve">
<value>Usually the familly name of the person</value>
</data>
<data name="NotListed" xml:space="preserve">
<value>(Not listed)</value>
</data>
</root>

8
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ListBoxView.xaml.cs.txt

@ -32,9 +32,17 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.ListBox.Views
public ListBoxView() public ListBoxView()
{ {
#if !OPEN_SOURCE
this.DataContext = SampleDataProvider.GetOrders();
#endif
InitializeComponent(); InitializeComponent();
#if !OPEN_SOURCE
//Add the default GroupDescriptions to the ListBox's GroupDescriptions collection.
_listBox.GroupDescriptions.Add( this.Resources[ "shipCountryGroupDescription" ] as GroupDescription );
_listBox.GroupDescriptions.Add( this.Resources[ "shipCityGroupDescription" ] as GroupDescription );
#endif
} }
#endregion #endregion

1097
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ListBoxView.xaml.txt

File diff suppressed because it is too large

25
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MultiColumnComboBoxView.xaml.cs.txt

@ -30,9 +30,32 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.DataGrid.Views
{ {
public MultiColumnComboBoxView() public MultiColumnComboBoxView()
{ {
#if !OPEN_SOURCE
this.DataContext = SampleDataProvider.GetOrders();
#endif
InitializeComponent(); InitializeComponent();
} }
#if !OPEN_SOURCE
private void OnGroupCheck( object sender, System.Windows.RoutedEventArgs e )
{
DataGridCollectionView collectionView = ( DataGridCollectionView )_combo.ItemsSource;
bool isChecked = ( ( CheckBox )sender ).IsChecked.GetValueOrDefault( false );
bool isGrouped = ( collectionView.GroupDescriptions.Count > 0 );
if( isGrouped != isChecked )
{
if( isChecked )
{
collectionView.GroupDescriptions.Add( new PropertyGroupDescription( "ShipCountry" ) );
collectionView.GroupDescriptions.Add( new PropertyGroupDescription( "ShipCity" ) );
}
else
{
collectionView.GroupDescriptions.Clear();
}
}
}
#endif
} }
} }

134
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MultiColumnComboBoxView.xaml.txt

@ -24,25 +24,137 @@
<local:DemoView.Description> <local:DemoView.Description>
<Paragraph FontSize="14" FontFamily="Segoe"> <Paragraph FontSize="14" FontFamily="Segoe">
<Run>The multi-column combo box uses the power of Xceed's datagrid control to create an advanced ComboBox.</Run> <Run>The multi-column combo box uses the power of Xceed's datagrid control to create an advanced ComboBox.</Run>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<Run>This Control is only available in the "Plus" version.</Run> <Run>This Control is only available in the "Plus" version.</Run>
<LineBreak /> <LineBreak />
<Hyperlink NavigateUri="http://www.xceed.com/Extended_WPF_Toolkit_Intro.html" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="http://www.xceed.com/Extended_WPF_Toolkit_Intro.html" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Extended WPF Toolkit Plus. Click here for more details about Xceed Extended WPF Toolkit Plus.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
<!--##EXCLUDE_OPEN_SOURCE-->
<local:DemoView.Resources>
<xcdg:DataGridCollectionViewSource x:Key="cvsOrder"
Source="{Binding}" >
<xcdg:DataGridCollectionViewSource.GroupDescriptions>
<PropertyGroupDescription PropertyName="ShipCountry" />
<PropertyGroupDescription PropertyName="ShipCity" />
</xcdg:DataGridCollectionViewSource.GroupDescriptions>
</xcdg:DataGridCollectionViewSource>
<!--Important! Base the style on the predefined default style for the DataGrid-->
<Style x:Key="baseStyle" TargetType="{x:Type xcdg:DataGridControl}"
BasedOn="{StaticResource {x:Static xcdg:MultiColumnComboBox.DefaultDataGridStyleResourceKey}}">
<Setter Property="View">
<Setter.Value>
<!-- Setting a view to allow group drop-down navigation. -->
<!-- Because it declare a new view, this style can only -->
<!-- be used by one MultiColumnComboBox instance -->
<xcdg:TableflowView />
</Setter.Value>
</Setter>
</Style>
<Style x:Key="coloredDataGridStyle" TargetType="{x:Type xcdg:DataGridControl}" BasedOn="{StaticResource baseStyle}" >
<Style.Resources>
<Style TargetType="{x:Type xcdg:DataRow}">
<Setter Property="Background" Value="LemonChiffon" />
</Style>
</Style.Resources>
</Style>
<conv:FlagPathConverter x:Key="flagPathConverter" />
<!-- DataTemplate to display a Country -->
<DataTemplate x:Key="countryDataTemplate">
<StackPanel Orientation="Horizontal"
VerticalAlignment="Center"
Margin="5,0,0,0">
<!--The flagPathConverter resource changes the value of a
group (e.g., "Canada") to an image. -->
<Image MaxHeight="15"
Margin="0, 0, 5, 0"
Source="{Binding Converter={StaticResource flagPathConverter}}" />
<TextBlock Text="{Binding}"
TextTrimming="WordEllipsis"
VerticalAlignment="Center" />
</StackPanel>
</DataTemplate>
</local:DemoView.Resources>
<StackPanel>
<GroupBox Header="Features" Grid.Row="0" Margin="5">
<Grid Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<!-- Show headers option -->
<TextBlock Grid.Row="0" Grid.Column="0" VerticalAlignment="Center"
Text="ShowColumnHeaders: "/>
<CheckBox Grid.Row="0" Grid.Column="1" VerticalAlignment="Center" Margin="5"
IsChecked="{Binding ShowColumnHeaders, ElementName=_combo}" />
<!-- Show GroupBy control option -->
<TextBlock Grid.Row="1" Grid.Column="0" VerticalAlignment="Center"
Text="ShowGroupByControl: " />
<CheckBox Grid.Row="1" Grid.Column="1" VerticalAlignment="Center" Margin="5"
IsChecked="{Binding ShowGroupByControl, ElementName=_combo}" />
<!-- Group source option -->
<TextBlock Grid.Row="0" Grid.Column="2" VerticalAlignment="Center" Margin="10,0,0,0"
Text="Grouped: " />
<CheckBox Grid.Row="0" Grid.Column="3" VerticalAlignment="Center" Margin="5"
IsChecked="True"
Click="OnGroupCheck"/>
<!-- DataGrid Styling -->
<TextBlock Grid.Row="1" Grid.Column="2" VerticalAlignment="Center" Margin="10,0,0,0"
Text="Applied DataGrid Style: "/>
<ComboBox x:Name="styles" Grid.Row="1" Grid.Column="3" SelectedIndex="0" Width="225" VerticalAlignment="Center" Margin="5">
<ComboBoxItem Content="No Style" Tag="{StaticResource baseStyle}" />
<ComboBoxItem Content="Styled with yellow row background" Tag="{StaticResource coloredDataGridStyle}" />
</ComboBox>
</Grid>
</GroupBox>
<TextBlock Text="Usage:" Style="{StaticResource Header}" />
<xcdg:MultiColumnComboBox x:Name="_combo"
Width="200"
HorizontalAlignment="Left"
AutoCreateColumns="False"
ItemsSource="{Binding Source={StaticResource cvsOrder}}"
DataGridStyle="{Binding ElementName=styles, Path=SelectedItem.Tag}">
<xcdg:MultiColumnComboBox.Columns>
<xcdg:Column FieldName="OrderID" Title="Order ID" />
<xcdg:Column FieldName="CustomerID" Title="Customer ID" />
<xcdg:Column FieldName="ShipCountry" Title="Ship Country" CellContentTemplate="{StaticResource countryDataTemplate}"/>
<xcdg:Column FieldName="ShipCity" Title="Ship City" />
</xcdg:MultiColumnComboBox.Columns>
<xcdg:MultiColumnComboBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding OrderID}" />
<TextBlock Margin="10,0,0,0"
Text="{Binding CustomerID, StringFormat= ({0})}"/>
</StackPanel>
</DataTemplate>
</xcdg:MultiColumnComboBox.ItemTemplate>
</xcdg:MultiColumnComboBox>
</StackPanel>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<Image Source="..\OpenSourceImages\MultiColumnsComboBox.png" Width="500" Height="300"/> <Image Source="..\OpenSourceImages\MultiColumnsComboBox.png" Width="500" Height="300"/>
##END-->
</local:DemoView> </local:DemoView>

122
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PileFlowPanelView.xaml.cs.txt

@ -37,30 +37,140 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PileFlowPanel.Views
public PileFlowPanelView() public PileFlowPanelView()
{ {
#if !OPEN_SOURCE
this.DataContext = SampleDataProvider.SharedEmployees;
#endif
InitializeComponent(); InitializeComponent();
#if !OPEN_SOURCE
_pileFlowPanel.PileFlowItemActivated += new Xceed.Wpf.Toolkit.PileFlowPanel.PileFlowItemActivatedHandler( this.PileFlowItemActivated );
_pileFlowPanel.PileFlowItemDeactivated += new Xceed.Wpf.Toolkit.PileFlowPanel.PileFlowItemDeactivatedHandler( this.PileFlowItemDeactivated );
ObservableCollection<Product> products = SampleDataProvider.GetProducts();
foreach( Product product in products )
{
this.AddImage( product );
}
#endif
} }
#endregion #endregion
#if !OPEN_SOURCE
#region Event Handlers
private void PileFlowItemActivated( object sender, Xceed.Wpf.Toolkit.PileFlowPanel.PileFlowActivationEventArgs e )
{
//# Modify the text label.
_pileFlowPanel.ContentLabel.Visibility = Visibility.Visible;
_pileFlowLabel.Text = e.Item.Element.Tag as string;
//# Enable the first PileFlowItem.
if( object.Equals( ( ( PileFlowItem )sender ).Element, _employeesPileFlowCard ) )
{
_employeeListBox.IsEnabled = true;
}
}
private void PileFlowItemDeactivated( object sender, EventArgs e )
{
//# Hide the text Label.
_pileFlowPanel.ContentLabel.Visibility = Visibility.Collapsed;
_pileFlowLabel.Text = null;
//# Enable the first PileFlowItem.
if( object.Equals( ( ( PileFlowItem )sender ).Element, _employeesPileFlowCard ) )
{
_employeeListBox.IsEnabled = false;
}
}
private void OnEmployeeButtonPress( object sender, EventArgs e )
{
Xceed.Wpf.Toolkit.MessageBox.Show( "Employee data has been saved.", "Employee", MessageBoxButton.OK, MessageBoxImage.Asterisk);
}
private void OnShowReflectionsClick( object sender, RoutedEventArgs e )
{
CheckBox checkBox = ( CheckBox )sender;
foreach( UIElement item in _pileFlowPanel.Children )
{
if( item is PileFlowCard )
{
(( PileFlowCard )item).ShowReflection = ( bool )checkBox.IsChecked;
}
}
}
private void OnBeginReflectionOpacityChanged( object sender, RoutedPropertyChangedEventArgs<object> e )
{
this.ModifyReflection( sender, true );
}
private void OnEndReflectionOpacityChanged( object sender, RoutedPropertyChangedEventArgs<object> e )
{
this.ModifyReflection( sender, false );
}
#endregion
#endif
#region Implementation #region Implementation
#if !OPEN_SOURCE
private void ModifyReflection( object sender, bool isBeginReflectionOpacity )
{
if( _pileFlowPanel != null )
{
DoubleUpDown opacity = ( DoubleUpDown )sender;
foreach( UIElement item in _pileFlowPanel.Children )
{
if( item is PileFlowCard )
{
PileFlowCard card = ( PileFlowCard )item;
double opacityValue = ( opacity.Value != null ) ? ( double )opacity.Value : 0d;
if( isBeginReflectionOpacity )
{
card.BeginReflectionOpacity = opacityValue;
}
else
{
card.EndReflectionOpacity = opacityValue;
}
}
}
}
}
private void AddImage( Product product )
{
BitmapImage imageSource = null;
byte[] imageBytes = product.Photo;
if( imageBytes != null )
{
Stream imageStream = new MemoryStream( imageBytes );
imageSource = new BitmapImage();
imageSource.BeginInit();
imageSource.CacheOption = BitmapCacheOption.OnLoad;
imageSource.StreamSource = imageStream;
imageSource.EndInit();
//# Use a border to delimit the photos
Border border = new Border();
border.BorderBrush = new SolidColorBrush( Colors.Black );
border.BorderThickness = new Thickness( 2 );
border.Background = new ImageBrush( imageSource );
//# Use a PileFlowCard to use Reflection.
PileFlowCard card = new PileFlowCard();
card.Child = border;
card.Tag = product.ProductName;
_pileFlowPanel.Children.Add( card );
}
}
#endif
#endregion #endregion
} }

312
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PileFlowPanelView.xaml.txt

@ -31,40 +31,300 @@
<LineBreak /> <LineBreak />
<Run> <Run>
The PileFlowPanel class also contains a label that can be configured to display the PileFlowItem data via the property ContentLabel. When the PileFlowPanel has focus, this sample lets the arrow buttons or the mouse wheel modify the selection.</Run> The PileFlowPanel class also contains a label that can be configured to display the PileFlowItem data via the property ContentLabel. When the PileFlowPanel has focus, this sample lets the arrow buttons or the mouse wheel modify the selection.</Run>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
<LineBreak /> <LineBreak />
<Hyperlink NavigateUri="http://www.xceed.com/Extended_WPF_Toolkit_Intro.html" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="http://www.xceed.com/Extended_WPF_Toolkit_Intro.html" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Extended WPF Toolkit Plus. Click here for more details about Xceed Extended WPF Toolkit Plus.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
<!--##EXCLUDE_OPEN_SOURCE-->
<local:DemoView.Resources>
<Style TargetType="{x:Type Border}" x:Key="BorderStyle">
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="CornerRadius" Value="5"/>
<Setter Property="BorderBrush">
<Setter.Value>
<SolidColorBrush Color="Black"/>
</Setter.Value>
</Setter>
</Style>
<conv:SizeToIntegerConverter x:Key="SizeToIntegerConverter" />
<conv:FullNameStringConverter x:Key="FullNameStringConverter" />
<SolidColorBrush x:Key="mouseOverBrush" Color="Blue" />
<SolidColorBrush x:Key="mouseOverLabelBrush" Color="LightBlue" />
<SolidColorBrush x:Key="normalLabelBrush" Color="Snow" />
<DataTemplate x:Key="seriesTemplate">
<Canvas Width="{Binding Path=W}" Height="{Binding Path=H}">
<Rectangle x:Name="rect" RadiusX="5" RadiusY="5" Width="{Binding Path=W}" Height="{Binding Path=H}" Fill="{Binding Path=Interior}">
<Rectangle.Triggers>
<EventTrigger RoutedEvent="Mouse.MouseEnter">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="rect" Storyboard.TargetProperty="Fill">
<DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{StaticResource mouseOverBrush}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
<EventTrigger RoutedEvent="Mouse.MouseLeave">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="rect" Storyboard.TargetProperty="Fill">
<DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{Binding Path=Interior}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
</Rectangle.Triggers>
</Rectangle>
</Canvas>
</DataTemplate>
<DataTemplate x:Key="LabelTemplate">
<Border x:Name="border" DockPanel.Dock="Top" BorderThickness="1" CornerRadius ="4" Background="{StaticResource normalLabelBrush}">
<Border.BorderBrush>
<SolidColorBrush Color="Black"/>
</Border.BorderBrush>
<TextBlock FontFamily="Sans Serif" FontSize="12" Margin="2,2,2,1"
HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Binding Path=Text}">
<TextBlock.Foreground>
<SolidColorBrush Color="Navy"/>
</TextBlock.Foreground>
</TextBlock>
<Border.Triggers>
<EventTrigger RoutedEvent="Mouse.MouseEnter">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="border" Storyboard.TargetProperty="Background">
<DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{StaticResource mouseOverLabelBrush}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
<EventTrigger RoutedEvent="Mouse.MouseLeave">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="border" Storyboard.TargetProperty="Background">
<DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{StaticResource normalLabelBrush}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
</Border.Triggers>
</Border>
</DataTemplate>
</local:DemoView.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<GroupBox Header="PileFlowPanel Features" Grid.Row="0" Margin="0,5,0,5">
<Grid Margin="0,5,5,5" HorizontalAlignment="Left">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<!-- 1st column -->
<TextBlock Text="Content Label Offset Y: " VerticalAlignment="Center" />
<xctk:IntegerUpDown Grid.Column="1" Minimum="-150" Maximum="170" Value="{Binding ContentLabelOffsetY, ElementName=_pileFlowPanel}" Width="75" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" />
<TextBlock Text="Content Label Size X: " Grid.Row="1" VerticalAlignment="Center" />
<xctk:IntegerUpDown Grid.Row="1" Grid.Column="1" Minimum="0" Maximum="500" Value="{Binding ContentLabelSize, ElementName=_pileFlowPanel, Converter={StaticResource SizeToIntegerConverter}, ConverterParameter=width}" Width="75" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" />
<TextBlock Text="Content Label Size Y: " Grid.Row="2" VerticalAlignment="Center" />
<xctk:IntegerUpDown Grid.Row="2" Grid.Column="1" Minimum="0" Maximum="500" Value="{Binding ContentLabelSize, ElementName=_pileFlowPanel, Converter={StaticResource SizeToIntegerConverter}, ConverterParameter=height}" Width="75" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" />
<TextBlock Text="Animation Duration: " Grid.Row="3" VerticalAlignment="Center" />
<xctk:IntegerUpDown Grid.Row="3" Grid.Column="1" Minimum="0" Maximum="3000" Increment="10" Value="{Binding AnimationDuration, ElementName=_pileFlowPanel}" Width="75" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" />
<TextBlock Text="Last Move decelarion Ratio: " Grid.Row="4" VerticalAlignment="Center" />
<xctk:DoubleUpDown Grid.Row="4" Grid.Column="1" FormatString="N1" Minimum="0" Maximum="1" Increment="0.1" Value="{Binding LastMoveDecelerationRatio, ElementName=_pileFlowPanel}" Width="75" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" />
<TextBlock Text="Center Offset X " Grid.Row="5" VerticalAlignment="Center" />
<xctk:IntegerUpDown Grid.Row="5" Grid.Column="1" Minimum="0" Maximum="300" Increment="2" Value="{Binding CenterOffsetX, ElementName=_pileFlowPanel}" Width="75" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" />
<!-- 2nd column -->
<TextBlock Text="Flow Items Count: " Grid.Column="2" VerticalAlignment="Center" Margin="5,0,0,0"/>
<xctk:IntegerUpDown Grid.Column="3" Minimum="1" Value="{Binding FlowItemsCount, ElementName=_pileFlowPanel}" Width="75" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" />
<TextBlock Text="Flow Items Ratio: " Grid.Row="1" Grid.Column="2" VerticalAlignment="Center" Margin="5,0,0,0"/>
<xctk:IntegerUpDown Grid.Row="1" Grid.Column="3" Minimum="0" Maximum="100" Value="{Binding FlowItemRatio, ElementName=_pileFlowPanel}" Width="75" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" />
<TextBlock Text="Item Width: " Grid.Row="2" Grid.Column="2" VerticalAlignment="Center" Margin="5,0,0,0"/>
<xctk:IntegerUpDown Grid.Row="2" Grid.Column="3" Minimum="0" Maximum="300" Value="{Binding ItemWidth, ElementName=_pileFlowPanel}" Width="75" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" />
<TextBlock Text="Item Height: " Grid.Row="3" Grid.Column="2" VerticalAlignment="Center" Margin="5,0,0,0"/>
<xctk:IntegerUpDown Grid.Row="3" Grid.Column="3" Minimum="0" Maximum="300" Value="{Binding ItemHeight, ElementName=_pileFlowPanel}" Width="75" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" />
<TextBlock Text="Flow Offset X " Grid.Row="4" Grid.Column="2" VerticalAlignment="Center" Margin="5,0,0,0"/>
<xctk:IntegerUpDown Grid.Row="4" Grid.Column="3" Minimum="0" Maximum="300" Value="{Binding FlowOffsetX, ElementName=_pileFlowPanel}" Width="75" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" />
<TextBlock Text="Flow Offset Y " Grid.Row="5" Grid.Column="2" VerticalAlignment="Center" Margin="5,0,0,0"/>
<xctk:IntegerUpDown Grid.Row="5" Grid.Column="3" Minimum="0" Maximum="300" Value="{Binding FlowOffsetY, ElementName=_pileFlowPanel}" Width="75" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" />
</Grid>
</GroupBox>
<GroupBox Header="PileFlowCard Features" Grid.Row="0" Grid.Column="1" Margin="0,5,2,5">
<Grid Margin="0,5,2,5" HorizontalAlignment="Left">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock Text="Show Reflection: " VerticalAlignment="Center" />
<CheckBox x:Name="_showReflection" Grid.Column="1" IsChecked="True" Click="OnShowReflectionsClick" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5,5,2,5" />
<TextBlock Text="Begin Reflection Opacity: " Grid.Row="1" VerticalAlignment="Center" IsEnabled="{Binding IsChecked, ElementName=_showReflection}" Style="{StaticResource DisableGrayText}"/>
<xctk:DoubleUpDown Grid.Row="1" Grid.Column="1" Minimum="0" Maximum="1" Increment="0.02" AllowInputSpecialValues="None" Value="0.58" ValueChanged="OnBeginReflectionOpacityChanged" IsEnabled="{Binding IsChecked, ElementName=_showReflection}" Width="50" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5,5,2,5" />
<TextBlock Text="End Reflection Opacity: " Grid.Row="2" VerticalAlignment="Center" IsEnabled="{Binding IsChecked, ElementName=_showReflection}" Style="{StaticResource DisableGrayText}"/>
<xctk:DoubleUpDown Grid.Row="2" Grid.Column="1" Minimum="0" Maximum="1" Increment="0.02" AllowInputSpecialValues="None" Value="0" ValueChanged="OnEndReflectionOpacityChanged" IsEnabled="{Binding IsChecked, ElementName=_showReflection}" Width="50" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5,5,2,5" />
</Grid>
</GroupBox>
<TextBlock Grid.Row="1" Text="Usage:" Style="{StaticResource Header}" />
<ScrollViewer Grid.Row="2" Grid.ColumnSpan="2" VerticalScrollBarVisibility="Hidden" HorizontalScrollBarVisibility="Visible" CanContentScroll="true">
<xctk:PileFlowPanel x:Name="_pileFlowPanel"
MinHeight="175"
ContentLabelOffsetY="100"
ContentLabelSize="200,28"
AnimationDuration="1000"
LastMoveDecelerationRatio="0.6"
FlowItemsCount="6"
FlowItemRatio="70"
ItemWidth="200"
ItemHeight="200"
FlowOffsetX="20"
FlowOffsetY="20"
CenterOffsetX="30">
<xctk:PileFlowPanel.ContentLabel>
<Border Background="#ffff50" DockPanel.Dock="Left" Style="{StaticResource BorderStyle}">
<TextBlock x:Name="_pileFlowLabel" Margin="0,5,0,0" TextAlignment="Center" />
<Border.BitmapEffect>
<DropShadowBitmapEffect />
</Border.BitmapEffect>
</Border>
</xctk:PileFlowPanel.ContentLabel>
<xctk:PileFlowCard x:Name="_employeesPileFlowCard" Tag="Employees">
<StackPanel>
<TextBlock Text="List of Employees" TextAlignment="Center" />
<xctk:CheckListBox x:Name="_employeeListBox" ItemsSource="{Binding}" DisplayMemberPath="LastName" />
</StackPanel>
</xctk:PileFlowCard>
<xctk:PileFlowCard>
<xctk:PileFlowCard.Tag>
<MultiBinding Converter="{StaticResource FullNameStringConverter}">
<Binding Path="[0].FirstName" />
<Binding Path="[0].LastName" />
</MultiBinding>
</xctk:PileFlowCard.Tag>
<Border Background="Beige">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Image Grid.RowSpan="5" Source="{Binding Path=[0].Photo}" VerticalAlignment="Center" />
<TextBlock Grid.Column="1" Text="{Binding Path=[0].FirstName}" />
<TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding Path=[0].LastName}" />
<TextBlock Grid.Row="2" Grid.Column="1" Text="{Binding Path=[0].Title}" />
<TextBlock Grid.Row="2" Grid.Column="1" Text="{Binding Path=[0].Title}" />
<TextBlock Grid.Row="3" Grid.Column="1" Text="{Binding Path=[0].HomePhone}" />
<TextBlock Grid.Row="4" Grid.Column="1" Text="{Binding Path=[0].Address}" />
<TextBlock Grid.Row="5" Grid.ColumnSpan="2" Text="This employee has been working at IBM since March 10, 1999." TextWrapping="Wrap" />
<Button Grid.Row="6" Grid.ColumnSpan="2" Content="Save" Width="75" Click="OnEmployeeButtonPress" />
</Grid>
</Border>
</xctk:PileFlowCard>
<xctk:PileFlowCard Tag="sale's price relative to distance">
<Border Background="LightGray">
<xctk:Chart>
<xctk:Chart.Legend>
<xctk:Legend Visibility="Collapsed" />
</xctk:Chart.Legend>
<xctk:Chart.Areas>
<xctk:Area>
<xctk:Area.XAxis>
<xctk:Axis AxisLabelsLayout="ShowToFit" ShowAxisLabel="False" LabelTemplate="{StaticResource LabelTemplate}"/>
</xctk:Area.XAxis>
<xctk:Area.YAxis>
<xctk:Axis AxisLabelsLayout="ShowToFit" ShowAxisLabel="False" LabelTemplate="{StaticResource LabelTemplate}"/>
</xctk:Area.YAxis>
<xctk:Area.Series>
<xctk:Series DefaultInterior="Red" Template="{StaticResource seriesTemplate}">
<xctk:Series.DataPoints>
<xctk:DataPoint X="125" Y="6" />
<xctk:DataPoint X="150" Y="7" />
<xctk:DataPoint X="50" Y="4" />
<xctk:DataPoint X="25" Y="2" />
</xctk:Series.DataPoints>
<xctk:Series.Layout>
<xctk:ColumnLayout />
</xctk:Series.Layout>
</xctk:Series>
</xctk:Area.Series>
</xctk:Area>
</xctk:Chart.Areas>
</xctk:Chart>
</Border>
</xctk:PileFlowCard>
</xctk:PileFlowPanel>
</ScrollViewer>
</Grid>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<Image Source="..\OpenSourceImages\PileFlowPanel.png" Width="600" Height="400"/> <Image Source="..\OpenSourceImages\PileFlowPanel.png" Width="600" Height="400"/>
##END-->
</local:DemoView> </local:DemoView>

4
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridAttributesView.xaml.cs.txt

@ -53,6 +53,9 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views
[CategoryOrder("Information", 0)] [CategoryOrder("Information", 0)]
[CategoryOrder( "Conections", 1 )] [CategoryOrder( "Conections", 1 )]
[CategoryOrder( "Other", 2 )] [CategoryOrder( "Other", 2 )]
#if !OPEN_SOURCE
[ExpandedCategory( "Conections", false )]
#endif
public abstract class Person public abstract class Person
{ {
// All properties have their own "[Category(...)]" attribute to specify which category they // All properties have their own "[Category(...)]" attribute to specify which category they
@ -105,6 +108,7 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views
public string NameInParentheses { get; set; } public string NameInParentheses { get; set; }
[Category( "Other" )] [Category( "Other" )]
//# TODODOC
[Description( "This property uses the [Browsable(false)] attribute to not display the property" )] [Description( "This property uses the [Browsable(false)] attribute to not display the property" )]
[BrowsableAttribute( false )] [BrowsableAttribute( false )]
public string InvisibleProperty public string InvisibleProperty

11
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridCustomPropertyView.xaml.cs.txt

@ -35,5 +35,16 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views
} }
} }
#if !OPEN_SOURCE
public struct Coords
{
public int X { get; set; }
public int Y { get; set; }
public override string ToString()
{
return string.Format( "{0}, {1}", X, Y );
}
}
#endif
} }

55
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridCustomPropertyView.xaml.txt

@ -25,6 +25,7 @@
<local:DemoView.Description> <local:DemoView.Description>
<Paragraph FontSize="14" FontFamily="Segoe"> <Paragraph FontSize="14" FontFamily="Segoe">
Using the CustomPropertyItems class, you can flexibly modify the display of each of your properties. Using the CustomPropertyItems class, you can flexibly modify the display of each of your properties.
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
@ -32,6 +33,7 @@
<Hyperlink NavigateUri="http://www.xceed.com/Extended_WPF_Toolkit_Intro.html" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="http://www.xceed.com/Extended_WPF_Toolkit_Intro.html" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Extended WPF Toolkit Plus. Click here for more details about Xceed Extended WPF Toolkit Plus.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
@ -43,7 +45,13 @@
<StackPanel Grid.Row="0" Margin="10"> <StackPanel Grid.Row="0" Margin="10">
<TextBlock Text="This sample adds 'CustomPropertyItem' to the 'Properties' collection and directly controls the display of each item." <TextBlock Text="This sample adds 'CustomPropertyItem' to the 'Properties' collection and directly controls the display of each item."
TextWrapping="Wrap"/> TextWrapping="Wrap"/>
<!--##EXCLUDE_OPEN_SOURCE-->
<TextBlock Text="(Click the XAML and Code tabs to see details.)"
FontStyle="Italic"
Margin="0,10,0,0"/>
<!--##END-->
</StackPanel> </StackPanel>
<!--##INCLUDE_OPEN_SOURCE
<ScrollViewer Grid.Row="1" <ScrollViewer Grid.Row="1"
VerticalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"
HorizontalScrollBarVisibility="Auto"> HorizontalScrollBarVisibility="Auto">
@ -52,10 +60,57 @@
<local:XamlBox CodeSource="/Samples/PropertyGrid/OpenSourceImages/CustomProperty.xaml.txt" /> <local:XamlBox CodeSource="/Samples/PropertyGrid/OpenSourceImages/CustomProperty.xaml.txt" />
</StackPanel> </StackPanel>
</ScrollViewer> </ScrollViewer>
##END-->
<!--##EXCLUDE_OPEN_SOURCE-->
<!--
No assignement of either PropertyNameBinding or PropertyValueBinding. CustomProperties
will each have all the values directly set.
-->
<xctk:PropertyGrid x:Name="_propertyGrid" Grid.Row="1" Width="350" MaxHeight="280">
<xctk:PropertyGrid.EditorDefinitions>
<xctk:EditorTextDefinition TargetProperties="firstName,lastName"
FontWeight="Bold"
FontStyle="Italic"/>
</xctk:PropertyGrid.EditorDefinitions>
<xctk:PropertyGrid.Properties>
<!--Use CustomPropertyItem to control each of their characteristics. -->
<!--Here we specify a DefinitionKey to assign a specific CUSTOM editor. -->
<xctk:CustomPropertyItem DisplayName="First Name" Value="Nancy" Category="Name"
DefinitionKey="firstName" />
<xctk:CustomPropertyItem DisplayName="Last Name" Value="Davolio" Category="Name"
DefinitionKey="lastName"/>
<!-- Here we specify a DefinitionKey to assign a specific DEFAULT editor. -->
<!-- Since the XAML parser will parse "29" as a string, the TypeConverter defined
on Int32 struct will automatically make the conversion. -->
<xctk:CustomPropertyItem DisplayName="Age" Value="29" Category="Other"
DefinitionKey="{x:Type s:Int32}" />
<!-- For thoses values where no TypeConverter supporting strings is defined, you must
use property element syntax to define the value. -->
<xctk:CustomPropertyItem DisplayName="Coordinates" Category="Other"
Description="Location on the state map">
<xctk:CustomPropertyItem.Value>
<v:Coords X="12" Y="15"/>
</xctk:CustomPropertyItem.Value>
</xctk:CustomPropertyItem>
<!--Here we define a specific editor directly. No value -->
<xctk:CustomPropertyItem DisplayName="Picture" Category="Other">
<xctk:CustomPropertyItem.Editor>
<Image Source="/Samples/PropertyGrid/Resources/woman.png"
Stretch="None"
HorizontalAlignment="Left"/>
</xctk:CustomPropertyItem.Editor>
</xctk:CustomPropertyItem>
</xctk:PropertyGrid.Properties>
<!-- You must specify that the grouping is based on the value of "Category" property. -->
<xctk:PropertyGrid.CategoryGroupDescription>
<PropertyGroupDescription PropertyName="Category"/>
</xctk:PropertyGrid.CategoryGroupDescription>
</xctk:PropertyGrid>
<!--##END-->
</Grid> </Grid>
</local:DemoView> </local:DemoView>

20
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridDefinitionKeyView.xaml.cs.txt

@ -28,8 +28,26 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views
public PropertyGridDefinitionKeyView() public PropertyGridDefinitionKeyView()
{ {
InitializeComponent(); InitializeComponent();
#if !OPEN_SOURCE
var person = new Person();
person.FirstName = "John";
person.LastName = "Smith";
person.ReferenceNo = 252521;
this.DataContext = person;
#endif
} }
#if !OPEN_SOURCE
private class Person
{
[DefinitionKey( "nameType" )]
public string FirstName { get; set; }
[DefinitionKey( "nameType" )]
public string LastName { get; set; }
[DefinitionKey( typeof( int? ) )]
public object ReferenceNo { get; set; }
}
#endif
} }
} }

18
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridDefinitionKeyView.xaml.txt

@ -32,6 +32,7 @@
<LineBreak/> <LineBreak/>
<LineBreak/> <LineBreak/>
It can also be used to specify a specific default editor when a property type does not resolve to a valid editor (e.g., Object). It can also be used to specify a specific default editor when a property type does not resolve to a valid editor (e.g., Object).
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
@ -39,6 +40,7 @@
<Hyperlink NavigateUri="http://www.xceed.com/Extended_WPF_Toolkit_Intro.html" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="http://www.xceed.com/Extended_WPF_Toolkit_Intro.html" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Extended WPF Toolkit Plus. Click here for more details about Xceed Extended WPF Toolkit Plus.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
@ -54,7 +56,13 @@
<TextBlock Text="The ReferenceNo property, declare a DefinitionKey to 'int?' to displayed the content with a IntegerUpDown dispite it's type is 'object'" <TextBlock Text="The ReferenceNo property, declare a DefinitionKey to 'int?' to displayed the content with a IntegerUpDown dispite it's type is 'object'"
TextWrapping="Wrap" TextWrapping="Wrap"
Margin="0,0,0,10"/> Margin="0,0,0,10"/>
<!--##EXCLUDE_OPEN_SOURCE-->
<TextBlock Text="(Click XAML and Code tabs to see details)"
FontStyle="Italic"
Margin="0,10,0,0"/>
<!--##END-->
</StackPanel> </StackPanel>
<!--##INCLUDE_OPEN_SOURCE
<ScrollViewer Grid.Row="1" <ScrollViewer Grid.Row="1"
VerticalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"
HorizontalScrollBarVisibility="Auto"> HorizontalScrollBarVisibility="Auto">
@ -65,5 +73,15 @@
<local:XamlBox CodeSource="/Samples/PropertyGrid/OpenSourceImages/DefinitionKey.xaml.txt" /> <local:XamlBox CodeSource="/Samples/PropertyGrid/OpenSourceImages/DefinitionKey.xaml.txt" />
</StackPanel> </StackPanel>
</ScrollViewer> </ScrollViewer>
##END-->
<!--##EXCLUDE_OPEN_SOURCE-->
<xctk:PropertyGrid x:Name="_propertyGrid" Grid.Row="1" HorizontalAlignment="Stretch" Width="350" MaxHeight="200"
SelectedObject="{Binding}">
<xctk:PropertyGrid.EditorDefinitions>
<!-- This EditorDefinition will be used for FirstName and LastName -->
<xctk:EditorTextDefinition TargetProperties="nameType" FontStyle="Italic" FontWeight="Bold" />
</xctk:PropertyGrid.EditorDefinitions>
</xctk:PropertyGrid>
<!--##END-->
</Grid> </Grid>
</local:DemoView> </local:DemoView>

93
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridDisplayLocalizationView.xaml.cs.txt

@ -20,6 +20,9 @@ using System.ComponentModel;
using System.Windows; using System.Windows;
using System.Windows.Media; using System.Windows.Media;
using Xceed.Wpf.Toolkit.PropertyGrid.Attributes; using Xceed.Wpf.Toolkit.PropertyGrid.Attributes;
#if !OPEN_SOURCE
using Xceed.Wpf.Toolkit.Core.Attributes;
#endif
using Xceed.Wpf.Toolkit.Core; using Xceed.Wpf.Toolkit.Core;
using System.Windows.Controls; using System.Windows.Controls;
using System.Globalization; using System.Globalization;
@ -38,16 +41,90 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views
public PropertyGridDisplayLocalizationView() public PropertyGridDisplayLocalizationView()
{ {
InitializeComponent(); InitializeComponent();
#if !OPEN_SOURCE
var person = new Person();
person.FirstName = "John";
person.LastName = "Doe";
person.FavoriteActor1 = ActorNoDisplayName.billcosby;
person.FavoriteActor2 = ActorWithDisplayName.bradpitt;
person.FavoriteActor3 = ActorWithDisplayName.NotInThisList;
_propertyGrid.SelectedObject = person;
#endif
} }
#if !OPEN_SOURCE
private void ComboBox_SelectionChanged( object sender, System.Windows.Controls.SelectionChangedEventArgs e )
{
DisplayLocalizationRes.Culture = object.Equals(( ( ComboBox )sender ).SelectedItem,"French" )
? new CultureInfo( "fr" )
: CultureInfo.InvariantCulture;
// This will refresh the PropertyGrid.
if( _propertyGrid != null )
{
var selected = _propertyGrid.SelectedObject;
_propertyGrid.SelectedObject = null;
_propertyGrid.SelectedObject = selected;
}
}
public enum ActorNoDisplayName
{
alpacino,
arnoldschwarzenegger,
benaffleck,
billcosby,
bradpitt,
NotInThisList
};
[TypeConverter(typeof(EnumDisplayNameConverter))]
public enum ActorWithDisplayName
{
[ExtendedDisplayName( "Al Pacino" )]
alpacino,
[ExtendedDisplayName( "Arnold Schwarzenegger" )]
arnoldschwarzenegger,
[ExtendedDisplayName( "Ben Affleck" )]
benaffleck,
[ExtendedDisplayName( "Bill Cosby" )]
billcosby,
[ExtendedDisplayName( "Brad Pitt" )]
bradpitt,
[LocalizedDisplayName( "NotListed", typeof(DisplayLocalizationRes) )]
NotInThisList
};
[CategoryOrder( "InfoCategory", 1 )]
[CategoryOrder( "DetailsCategory", 2 )]
public class Person
{
[LocalizedDisplayName( "FirstName", typeof( DisplayLocalizationRes ) )]
[LocalizedDescription( "FirstNameDesc", typeof( DisplayLocalizationRes ) )]
[LocalizedCategory( "InfoCategory", typeof( DisplayLocalizationRes ) )]
public string FirstName { get; set; }
[LocalizedDisplayName( "LastName", typeof( DisplayLocalizationRes ) )]
[LocalizedDescription( "LastNameDesc", typeof( DisplayLocalizationRes ) )]
[LocalizedCategory( "InfoCategory", typeof( DisplayLocalizationRes ) )]
public string LastName { get; set; }
[LocalizedDisplayName( "FavoriteActor1", typeof( DisplayLocalizationRes ) )]
[LocalizedDescription( "FavoriteActor1Desc", typeof( DisplayLocalizationRes ) )]
[LocalizedCategory( "DetailsCategory", typeof( DisplayLocalizationRes ) )]
public ActorNoDisplayName FavoriteActor1 { get; set; }
[LocalizedDisplayName( "FavoriteActor2", typeof( DisplayLocalizationRes ) )]
[LocalizedDescription( "FavoriteActor2Desc", typeof( DisplayLocalizationRes ) )]
[LocalizedCategory( "DetailsCategory", typeof( DisplayLocalizationRes ) )]
public ActorWithDisplayName FavoriteActor2 { get; set; }
[LocalizedDisplayName( "FavoriteActor3", typeof( DisplayLocalizationRes ) )]
[LocalizedDescription( "FavoriteActor3Desc", typeof( DisplayLocalizationRes ) )]
[LocalizedCategory( "DetailsCategory", typeof( DisplayLocalizationRes ) )]
public ActorWithDisplayName FavoriteActor3 { get; set; }
}
#endif
} }
} }

29
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridDisplayLocalizationView.xaml.txt

@ -31,17 +31,46 @@
<Run>LocalizedDisplayName, LocalizedDescription, LocalizedCategory:</Run> <Run>LocalizedDisplayName, LocalizedDescription, LocalizedCategory:</Run>
<LineBreak/> <LineBreak/>
<Run>Theses attributes allow to easily localize the DisplayName, Description, and Category attributes values using standard Resx resource files.</Run> <Run>Theses attributes allow to easily localize the DisplayName, Description, and Category attributes values using standard Resx resource files.</Run>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
<LineBreak /> <LineBreak />
<Hyperlink NavigateUri="http://www.xceed.com/Extended_WPF_Toolkit_Intro.html" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="http://www.xceed.com/Extended_WPF_Toolkit_Intro.html" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Extended WPF Toolkit Plus. Click here for more details about Xceed Extended WPF Toolkit Plus.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
<!--##EXCLUDE_OPEN_SOURCE-->
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<TextBlock Text="In this sample, the properties names and descriptions where localized.&#x0a;Select 'Favorite Actor' properties and see description:" />
<Grid Grid.Row="1" VerticalAlignment="Top">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal" Margin="30" Width="450" Height="22">
<TextBlock Text="Language:" Margin="0,0,5,30" />
<ComboBox SelectionChanged="ComboBox_SelectionChanged" SelectedIndex="0" Width="150">
<ComboBox.Items>
<s:String>English (Default)</s:String>
<s:String>French</s:String>
</ComboBox.Items>
</ComboBox>
</StackPanel>
<xctk:PropertyGrid x:Name="_propertyGrid" Grid.Row="1" NameColumnWidth="250" Width="450" MaxHeight="280" />
</Grid>
</Grid>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<Image Source="..\OpenSourceImages\Localization.png" Width="400" Height="300"/> <Image Source="..\OpenSourceImages\Localization.png" Width="400" Height="300"/>
##END-->
</local:DemoView> </local:DemoView>

45
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridEditorDefinitionsView.xaml.cs.txt

@ -31,10 +31,55 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views
public PropertyGridEditorDefinitionsView() public PropertyGridEditorDefinitionsView()
{ {
InitializeComponent(); InitializeComponent();
#if !OPEN_SOURCE
var selectedObject = new EditorDefinitionsSampleObject();
selectedObject.Boolean = true;
selectedObject.Color = Colors.Red;
selectedObject.ColorCombo = Colors.Blue;
selectedObject.DateTime = System.DateTime.Now;
selectedObject.Int32 = 42;
selectedObject.PersonTemplate = new Person() { FirstName = "John", LastName = "Smith" };
selectedObject.String = "This is a string";
selectedObject.StringCombo = "String Value 1";
this.DataContext = selectedObject;
#endif
} }
#if !OPEN_SOURCE
public class EditorDefinitionsSampleObject
{
[PropertyOrder( 0 )]
public string String { get; set; }
[PropertyOrder( 1 )]
public bool Boolean { get; set; }
[PropertyOrder( 2 )]
public int Int32 { get; set; }
[PropertyOrder( 3 )]
public System.DateTime DateTime { get; set; }
[PropertyOrder( 4 )]
public System.Windows.Media.Color Color { get; set; }
[PropertyOrder( 5 )]
public string StringCombo { get; set; }
[PropertyOrder( 6 )]
public System.Windows.Media.Color? ColorCombo { get; set; }
[PropertyOrder( 7 )]
public Person PersonTemplate { get; set; }
}
public class Person
{
public string FirstName { get; set; }
public string LastName { get; set; }
}
#endif
}
#if !OPEN_SOURCE
public class ColorSampleItem
{
public System.Windows.Media.Color? Color { get; set; }
public string DisplayString { get; set; }
} }
#endif
} }

101
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridEditorDefinitionsView.xaml.txt

@ -23,10 +23,28 @@
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
VerticalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Disabled"
Title="Ready-to-use EditorDefinitions"> Title="Ready-to-use EditorDefinitions">
<!--##EXCLUDE_OPEN_SOURCE-->
<local:DemoView.Resources>
<x:Array x:Key="comboSource1" Type="s:String" >
<s:String>String Value 1</s:String>
<s:String>String Value 2</s:String>
<s:String>String Value 3</s:String>
</x:Array>
<x:Array x:Key="comboSource2" Type="s:Object" >
<v:ColorSampleItem Color="{x:Null}" DisplayString="(No color selected)"/>
<v:ColorSampleItem Color="{x:Static sm:Colors.Red}" DisplayString="Red Color"/>
<v:ColorSampleItem Color="{x:Static sm:Colors.Green}" DisplayString="Green Color"/>
<v:ColorSampleItem Color="{x:Static sm:Colors.Blue}" DisplayString="Blue Color"/>
</x:Array>
<Style x:Key="textBoxStyle" TargetType="TextBox">
<Setter Property="Background" Value="LightBlue"/>
</Style>
</local:DemoView.Resources>
<!--##END-->
<local:DemoView.Description> <local:DemoView.Description>
<Paragraph FontSize="14" FontFamily="Segoe"> <Paragraph FontSize="14" FontFamily="Segoe">
Using the various EditorDefinitions provided with the PropertyGrid, you can easily customize and reuse the existing default editor to suit your needs. Style the editing element or use one of the common properties directly provided on the editor definition class. The provided editor definitions are the following: Using the various EditorDefinitions provided with the PropertyGrid, you can easily customize and reuse the existing default editor to suit your needs. Style the editing element or use one of the common properties directly provided on the editor definition class. The provided editor definitions are the following:
@ -51,6 +69,7 @@
EditorIntegerUpDownDefinition EditorIntegerUpDownDefinition
<LineBreak /> <LineBreak />
EditorDoubleUpDownDefinition EditorDoubleUpDownDefinition
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
@ -58,6 +77,7 @@
<Hyperlink NavigateUri="http://www.xceed.com/Extended_WPF_Toolkit_Intro.html" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="http://www.xceed.com/Extended_WPF_Toolkit_Intro.html" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Extended WPF Toolkit Plus. Click here for more details about Extended WPF Toolkit Plus.
</Hyperlink> </Hyperlink>
##END-->
etc. etc.
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
@ -66,7 +86,13 @@
<StackPanel DockPanel.Dock="Top"> <StackPanel DockPanel.Dock="Top">
<TextBlock Text="Each of the displayed properties has their display or behavior affected by an different EditorDefinition " <TextBlock Text="Each of the displayed properties has their display or behavior affected by an different EditorDefinition "
TextWrapping="Wrap"/> TextWrapping="Wrap"/>
<!--##EXCLUDE_OPEN_SOURCE-->
<TextBlock Text="(Click XAML and Code tabs to see details)"
FontStyle="Italic"
Margin="0,10,0,0"/>
<!--##END-->
</StackPanel> </StackPanel>
<!--##INCLUDE_OPEN_SOURCE
<ScrollViewer VerticalScrollBarVisibility="Auto" <ScrollViewer VerticalScrollBarVisibility="Auto"
HorizontalScrollBarVisibility="Auto"> HorizontalScrollBarVisibility="Auto">
<StackPanel> <StackPanel>
@ -74,12 +100,67 @@
<local:XamlBox CodeSource="/Samples/PropertyGrid/OpenSourceImages/EditorDefinitions.xaml.txt" /> <local:XamlBox CodeSource="/Samples/PropertyGrid/OpenSourceImages/EditorDefinitions.xaml.txt" />
</StackPanel> </StackPanel>
</ScrollViewer> </ScrollViewer>
##END-->
<!--##EXCLUDE_OPEN_SOURCE-->
<xctk:PropertyGrid x:Name="_propertyGrid" SelectedObject="{Binding}" Width="450" MaxHeight="320" Margin="10" >
<xctk:PropertyGrid.EditorDefinitions>
<!--
Only the "integer" is demonstrated here.
But all other numeric types are also supported (eg. EditorDoubleUpDownDefinition, etc.)
-->
<xctk:EditorIntegerUpDownDefinition TargetProperties="{x:Type s:Int32}"
TextAlignment="Right" />
<!-- CheckBox -->
<xctk:EditorCheckBoxDefinition TargetProperties="{x:Type s:Boolean}"
IsThreeState="True" />
<!-- ColorPicker -->
<xctk:EditorColorPickerDefinition TargetProperties="{x:Type sm:Color}"
DisplayColorAndName="False"
ShowDropDownButton="False"/>
<!-- DateTimeUpDown -->
<xctk:EditorDateTimeUpDownDefinition TargetProperties="{x:Type s:DateTime}"
Format="Custom"
FormatString="yyyy-MM" />
<!-- TextBox -->
<!-- On any EditorDefintion, you can use the "EditingElementStyle" to have a more complete customization
of the underlying editor -->
<xctk:EditorTextDefinition TargetProperties="{x:Type s:String}"
FontStyle="Italic"
FontWeight="Bold"
EditingElementStyle="{StaticResource textBoxStyle}" />
<!-- ComboBox (simple) -->
<!-- When using SelectedObject[s], the DataContext will be the PropertyItem. Bind to the "Value" property. -->
<xctk:EditorComboBoxDefinition TargetProperties="StringCombo"
ItemsSource="{StaticResource comboSource1}"
SelectedItemBinding="{Binding Value}" />
<!-- ComboBox (complex) -->
<xctk:EditorComboBoxDefinition TargetProperties="ColorCombo"
ItemsSource="{StaticResource comboSource2}"
DisplayMemberPath="DisplayString"
SelectedValuePath="Color"
SelectedValueBinding="{Binding Value}" />
<!-- Custom DataTemplate -->
<xctk:EditorTemplateDefinition TargetProperties="PersonTemplate">
<xctk:EditorTemplateDefinition.EditingTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<!-- When using SelectedObject[s], the DataContext will be the PropertyItem. Bind to the "Value" property. -->
<TextBlock Text="{Binding Value.LastName}" FontWeight="Bold" />
<TextBlock Text=", " />
<TextBlock Text="{Binding Value.FirstName}" />
</StackPanel>
</DataTemplate>
</xctk:EditorTemplateDefinition.EditingTemplate>
</xctk:EditorTemplateDefinition>
</xctk:PropertyGrid.EditorDefinitions>
</xctk:PropertyGrid>
<!--##END-->
</DockPanel> </DockPanel>

3
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridMultiSelectedObjectsView.xaml.cs.txt

@ -39,6 +39,9 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views
public PropertyGridMultiSelectedObjectsView() public PropertyGridMultiSelectedObjectsView()
{ {
InitializeComponent(); InitializeComponent();
#if !OPEN_SOURCE
_propertyGrid.SelectedObjectsOverride = new List<object>() { _textBox, _button, _comboBox };
#endif
} }
} }
} }

33
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridMultiSelectedObjectsView.xaml.txt

@ -24,18 +24,51 @@
<local:DemoView.Description> <local:DemoView.Description>
<Paragraph FontSize="14" FontFamily="Segoe"> <Paragraph FontSize="14" FontFamily="Segoe">
<Run>When many objects are assigned to a PropertyGrid, the PpropertyGrid will show all the common properties so that they can be changed simultaneously on each object.</Run> <Run>When many objects are assigned to a PropertyGrid, the PpropertyGrid will show all the common properties so that they can be changed simultaneously on each object.</Run>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
<LineBreak /> <LineBreak />
<Hyperlink NavigateUri="http://www.xceed.com/Extended_WPF_Toolkit_Intro.html" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="http://www.xceed.com/Extended_WPF_Toolkit_Intro.html" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Extended WPF Toolkit Plus. Click here for more details about Xceed Extended WPF Toolkit Plus.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
<!--##EXCLUDE_OPEN_SOURCE-->
<local:DemoView.Resources>
<x:Array Type="sys:String" x:Key="_comboBoxSource" >
<sys:String>Green</sys:String>
<sys:String>Red</sys:String>
<sys:String>Blue</sys:String>
</x:Array>
</local:DemoView.Resources>
<Grid Margin="10">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<StackPanel >
<TextBlock Text="Selected Object 1 : a TextBox" />
<TextBox x:Name="_textBox" Text="This is my TextBox" Margin="10" Width="150" Foreground="Red"/>
<TextBlock Text="Selected Object 2 : a Button"/>
<Button x:Name="_button" Content="My Button" Margin="10" Width="150" Foreground="Red"/>
<TextBlock Text="Selected Object 3 : a ComboBox" />
<ComboBox x:Name="_comboBox" ItemsSource="{StaticResource _comboBoxSource}" SelectedIndex="0" Margin="10" Width="150" Foreground="Red"/>
</StackPanel>
<xctk:PropertyGrid Grid.Column="1" x:Name="_propertyGrid" ShowAdvancedOptions="True" AutoGenerateProperties="False" MaxHeight="350" VerticalAlignment="Top">
<xctk:PropertyGrid.PropertyDefinitions>
<xctk:PropertyDefinition
TargetProperties="FontSize,FontWeight,Foreground,Background,HorizontalContentAlignment,Width,Margin,ToolTip" />
</xctk:PropertyGrid.PropertyDefinitions>
</xctk:PropertyGrid>
</Grid>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<Image Source="..\OpenSourceImages\MultiSelectedObjects.png" Width="660" Height="430"/> <Image Source="..\OpenSourceImages\MultiSelectedObjects.png" Width="660" Height="430"/>
##END-->
</local:DemoView> </local:DemoView>

50
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridPropertiesSourceView.xaml.cs.txt

@ -32,10 +32,60 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views
public PropertyGridPropertiesSourceView() public PropertyGridPropertiesSourceView()
{ {
InitializeComponent(); InitializeComponent();
#if !OPEN_SOURCE
var list = new ObservableCollection<object>();
list.Add( new MyData( "string", "First text" ) );
list.Add( new MyData( "Second string", "Second text" ) );
list.Add( new MyData( "Color", Colors.Blue ) );
list.Add( new MyData( "DateTime", System.DateTime.Now ) );
list.Add( new MyData( "TimeSpan", System.TimeSpan.FromMinutes( 120 ) ) );
list.Add( new MyData( "HorizontalAlignment", System.Windows.HorizontalAlignment.Center ) );
list.Add( new MyData( "bool", true ) );
list.Add( new MyData( "decimal", ( decimal )1 ) );
list.Add( new MyData( "int", ( int )2 ) );
list.Add( new MyData( "Second int", ( int )2 ) );
list.Add( new MyData( "short", ( short )3 ) );
list.Add( new MyData( "long", ( long )4 ) );
list.Add( new MyData( "float", ( float )5 ) );
list.Add( new MyData( "byte", ( byte )6 ) );
list.Add( new MyData( "sbyte", ( sbyte )7 ) );
list.Add( new MyData( "uint", ( uint )8 ) );
list.Add( new MyData( "ulong", ( ulong )8 ) );
list.Add( new MyData( "ushort", ( ushort )10 ) );
list.Add( new MyData( "FontFamily", Fonts.SystemFontFamilies.First() ) );
list.Add( new MyData( "FontStyle", FontStyles.Italic ) );
list.Add( new MyData( "FontStretch", FontStretches.ExtraExpanded ) );
list.Add( new MyData( "TimeSpan", System.TimeSpan.FromHours( 2 ) ) );
// PropertyGrid PropertiesSource property is bound to the DataContext
this.DataContext = list;
#endif
} }
#if !OPEN_SOURCE
private void InsertProperty( object sender, RoutedEventArgs e )
{
( ( IList<object> )this.DataContext ).Insert( 0, new MyData( "New string", "new data" ) );
}
private void RemoveProperty( object sender, RoutedEventArgs e )
{
if( _propertyGrid.SelectedProperty != null )
{
( ( IList<object> )this.DataContext ).Remove( _propertyGrid.SelectedProperty );
}
}
private class MyData
{
public MyData( string name, object value )
{
this.MyName = name;
this.MyValue = value;
}
public string MyName { get; set; }
public object MyValue { get; set; }
}
#endif
} }
} }

49
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridPropertiesSourceView.xaml.txt

@ -24,6 +24,7 @@
<local:DemoView.Description> <local:DemoView.Description>
<Paragraph FontSize="14" FontFamily="Segoe"> <Paragraph FontSize="14" FontFamily="Segoe">
When setting the PropertiesSource or Properties property, you can provide your own data to be displayed in the PropertyGrid. This allows you to easily insert and remove properties at runtime. The usage scheme is similar to the one used for the standard ItemsControl. When setting the PropertiesSource or Properties property, you can provide your own data to be displayed in the PropertyGrid. This allows you to easily insert and remove properties at runtime. The usage scheme is similar to the one used for the standard ItemsControl.
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
@ -31,6 +32,7 @@
<Hyperlink NavigateUri="http://www.xceed.com/Extended_WPF_Toolkit_Intro.html" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="http://www.xceed.com/Extended_WPF_Toolkit_Intro.html" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Extended WPF Toolkit Plus. Click here for more details about Xceed Extended WPF Toolkit Plus.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
@ -43,7 +45,13 @@
<StackPanel Grid.Row="0" Margin="10"> <StackPanel Grid.Row="0" Margin="10">
<TextBlock Text="This sample uses the 'PropertiesSource', 'PropertyNameBinding', and 'PropertyValueBinding', as well as collection of generic objects to display its properties." <TextBlock Text="This sample uses the 'PropertiesSource', 'PropertyNameBinding', and 'PropertyValueBinding', as well as collection of generic objects to display its properties."
TextWrapping="Wrap"/> TextWrapping="Wrap"/>
<!--##EXCLUDE_OPEN_SOURCE-->
<TextBlock Text="(Click the XAML and Code tabs to see details.)"
FontStyle="Italic"
Margin="0,10,0,0"/>
<!--##END-->
</StackPanel> </StackPanel>
<!--##INCLUDE_OPEN_SOURCE
<ScrollViewer Grid.Row="2" <ScrollViewer Grid.Row="2"
VerticalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"
HorizontalScrollBarVisibility="Auto"> HorizontalScrollBarVisibility="Auto">
@ -54,11 +62,52 @@
<local:XamlBox CodeSource="/Samples/PropertyGrid/OpenSourceImages/PropertiesSource.xaml.txt" /> <local:XamlBox CodeSource="/Samples/PropertyGrid/OpenSourceImages/PropertiesSource.xaml.txt" />
</StackPanel> </StackPanel>
</ScrollViewer> </ScrollViewer>
##END-->
<!--##EXCLUDE_OPEN_SOURCE-->
<StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Center">
<Button Content="Insert new property" Click="InsertProperty" Margin="20" Padding="5"/>
<Button Content="Remove selected property" Click="RemoveProperty" Margin="20" Padding="5"/>
</StackPanel>
<!--
The PropertyNameBinding and PropertyValueBinding properties provide the bindings that will be used
on each item of the properties' source in order to provide the Name and Value of each property.
-->
<xctk:PropertyGrid x:Name="_propertyGrid" Grid.Row="2" Width="350" MaxHeight="600"
IsCategorized="False"
ShowSortOptions="False"
PropertiesSource="{Binding}"
PropertyNameBinding="{Binding MyName}"
PropertyValueBinding="{Binding MyValue}" >
<xctk:PropertyGrid.Resources>
<xctk:EditorTimeSpanConverter x:Key="timeSpanConv"/>
</xctk:PropertyGrid.Resources>
<xctk:PropertyGrid.EditorDefinitions>
<!-- The property with the name "SecondText" will have this special editor. -->
<xctk:EditorTextDefinition TargetProperties="Second string"
FontStyle="Italic"
FontWeight="Bold" >
<xctk:EditorTextDefinition.EditingElementStyle>
<Style TargetType="{x:Type TextBox}"
BasedOn="{StaticResource {x:Type TextBox}}">
<Setter Property="Background" Value="LightBlue"/>
</Style>
</xctk:EditorTextDefinition.EditingElementStyle>
</xctk:EditorTextDefinition>
<!-- All properties whose value type is TimeSpan will use this special editor. -->
<!--Here we use a DateTimeUpDown editor in conjunction with a built-in converter to
create a TimeSpanEditor-->
<xctk:EditorDateTimeUpDownDefinition TargetProperties="{x:Type s:TimeSpan}"
Format="Custom"
FormatString="HH:mm"
Binding="{Binding MyValue, Converter={StaticResource timeSpanConv}}" />
</xctk:PropertyGrid.EditorDefinitions>
</xctk:PropertyGrid>
<!--##END-->
</Grid> </Grid>
</local:DemoView> </local:DemoView>

12
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridPropertiesView.xaml.cs.txt

@ -34,5 +34,17 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views
InitializeComponent(); InitializeComponent();
} }
} }
#if !OPEN_SOURCE
public class Employee
{
public string Name { get; set; }
public bool IsConfirmed { get; set; }
public string Department { get; set; }
}
public class Representent : Employee
{
public string Details { get; set; }
}
#endif
} }

69
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridPropertiesView.xaml.txt

@ -28,6 +28,7 @@
<LineBreak/> <LineBreak/>
<LineBreak/> <LineBreak/>
The sample also demonstrate the usage of CategoryGroupDescription to control the categorization of the elements. The sample also demonstrate the usage of CategoryGroupDescription to control the categorization of the elements.
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
@ -35,6 +36,7 @@
<Hyperlink NavigateUri="http://www.xceed.com/Extended_WPF_Toolkit_Intro.html" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="http://www.xceed.com/Extended_WPF_Toolkit_Intro.html" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Extended WPF Toolkit Plus. Click here for more details about Xceed Extended WPF Toolkit Plus.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
@ -46,7 +48,13 @@
<StackPanel Grid.Row="0" Margin="10"> <StackPanel Grid.Row="0" Margin="10">
<TextBlock Text="This sample adds Employee items directly under the Properties property and defines the editor through the DefaultEditorDefinition property." <TextBlock Text="This sample adds Employee items directly under the Properties property and defines the editor through the DefaultEditorDefinition property."
TextWrapping="Wrap"/> TextWrapping="Wrap"/>
<!--##EXCLUDE_OPEN_SOURCE-->
<TextBlock Text="(Click the XAML and Code tabs to see details.)"
FontStyle="Italic"
Margin="0,10,0,0"/>
<!--##END-->
</StackPanel> </StackPanel>
<!--##INCLUDE_OPEN_SOURCE
<ScrollViewer Grid.Row="1" <ScrollViewer Grid.Row="1"
VerticalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"
HorizontalScrollBarVisibility="Auto"> HorizontalScrollBarVisibility="Auto">
@ -57,11 +65,72 @@
<local:XamlBox CodeSource="/Samples/PropertyGrid/OpenSourceImages/Properties.xaml.txt" /> <local:XamlBox CodeSource="/Samples/PropertyGrid/OpenSourceImages/Properties.xaml.txt" />
</StackPanel> </StackPanel>
</ScrollViewer> </ScrollViewer>
##END-->
<!--##EXCLUDE_OPEN_SOURCE-->
<!--
PropertyNameBinding will be used to determine the property name's display text.
Value will be specified through DefaultEditorDefinition.
-->
<DockPanel Grid.Row="1">
<StackPanel DockPanel.Dock="Top" Margin="20"
Orientation="Horizontal">
<TextBlock Margin="0,0,10,0" VerticalAlignment="Center"
Text="Category GroupDescription Property:" />
<ComboBox x:Name="categoryGroupCombo" Width="150"
IsEnabled="{Binding IsCategorized, ElementName=_propertyGrid}"
DisplayMemberPath="PropertyName"
SelectedIndex="0">
<PropertyGroupDescription PropertyName="Department"/>
<PropertyGroupDescription PropertyName="IsConfirmed"/>
</ComboBox>
</StackPanel>
<xctk:PropertyGrid x:Name="_propertyGrid" Width="350" MaxHeight="275" VerticalAlignment="Top"
PropertyNameBinding="{Binding Name}"
CategoryGroupDescription="{Binding SelectedItem, ElementName=categoryGroupCombo}"
SelectedObjectName="Meeting" >
<xctk:PropertyGrid.Properties>
<!--Here we define the items to be displayed in the property grid (a list of Employees). -->
<v:Employee Name="Tom" IsConfirmed="True" Department="Sales"/>
<v:Employee Name="John" IsConfirmed="false" Department="Management"/>
<v:Representent Name="Brad" IsConfirmed="True"
Department="Sales"
Details="On the phone"/>
<v:Employee Name="Kevin" IsConfirmed="false" Department="Management"/>
<v:Employee Name="Jane" IsConfirmed="True" Department="Management"/>
<v:Employee Name="Sean" IsConfirmed="True" Department="Sales"/>
</xctk:PropertyGrid.Properties>
<xctk:PropertyGrid.DefaultEditorDefinition>
<!-- This editor will be the default editor for items of the property grid. -->
<xctk:EditorCheckBoxDefinition Binding="{Binding IsConfirmed}"/>
</xctk:PropertyGrid.DefaultEditorDefinition>
<xctk:PropertyGrid.EditorDefinitions>
<!--
Define a specific editor for the Representent with a "details" field.
Since no PropertyValueBinding is defined, the type of the item itself
will be used as a key to detect the possible defined editor.
-->
<xctk:EditorTemplateDefinition TargetProperties="{x:Type v:Representent}">
<xctk:EditorTemplateDefinition.EditingTemplate>
<DataTemplate >
<StackPanel HorizontalAlignment="Stretch">
<CheckBox IsChecked="{Binding IsConfirmed}" Margin="5,0,0,0" />
<DockPanel HorizontalAlignment="Stretch">
<TextBlock DockPanel.Dock="Left" Text="Details: " VerticalAlignment="Center"/>
<TextBox Text="{Binding Details}" FontStyle="Italic" HorizontalAlignment="Stretch" />
</DockPanel>
</StackPanel>
</DataTemplate>
</xctk:EditorTemplateDefinition.EditingTemplate>
</xctk:EditorTemplateDefinition>
</xctk:PropertyGrid.EditorDefinitions>
</xctk:PropertyGrid>
</DockPanel>
<!--##END-->
</Grid> </Grid>
</local:DemoView> </local:DemoView>

2
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridSpecifyingPropertiesView.xaml.cs.txt

@ -87,6 +87,8 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views
set; set;
} }
//# TODODOC
//# Those attribute will be overrien in xaml
[Category( "Information" )] [Category( "Information" )]
[DisplayName( "Favorite Color" )] [DisplayName( "Favorite Color" )]
[Description( "This property uses the ColorPicker as the default editor." )] [Description( "This property uses the ColorPicker as the default editor." )]

12
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridSpecifyingPropertiesView.xaml.txt

@ -33,6 +33,18 @@
MaxHeight="245" MaxHeight="245"
Margin="10" Margin="10"
AutoGenerateProperties="False"> AutoGenerateProperties="False">
<!--##EXCLUDE_OPEN_SOURCE-->
<!-- //# TODODOC
The following categories DisplayOrder will be overriden -->
<xctk:PropertyGrid.CategoryDefinitions>
<xctk:CategoryDefinition Name="Information"
DisplayOrder="0" />
<xctk:CategoryDefinition Name="Connections"
DisplayOrder="2" />
<xctk:CategoryDefinition Name="Clothes"
DisplayOrder="1" />
</xctk:PropertyGrid.CategoryDefinitions>
<!--##END-->
<xctk:PropertyGrid.PropertyDefinitions> <xctk:PropertyGrid.PropertyDefinitions>
<!-- //# TODODOC <!-- //# TODODOC

23
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/RadialGaugeView.xaml.cs.txt

@ -32,9 +32,32 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Gauge.Views
InitializeComponent(); InitializeComponent();
} }
#if !OPEN_SOURCE
private void BackgroundPortionsButton_Click( object sender, RoutedEventArgs e )
{
CollectionControlDialog diag = new CollectionControlDialog();
diag.ItemsSource = _gauge.BGPortions;
diag.NewItemTypes = new List<System.Type>() { typeof( GaugePortion ) };
diag.ShowDialog();
}
private void BorderPortionsButton_Click( object sender, RoutedEventArgs e )
{
CollectionControlDialog diag = new CollectionControlDialog();
diag.ItemsSource = _gauge.BorderPortions;
diag.NewItemTypes = new List<System.Type>() { typeof( BorderGaugePortion ) };
diag.ShowDialog();
}
private void MarkersButton_Click( object sender, RoutedEventArgs e )
{
CollectionControlDialog diag = new CollectionControlDialog();
diag.ItemsSource = _gauge.Markers;
diag.NewItemTypes = new List<System.Type>() { typeof( Marker ) };
diag.ShowDialog();
}
#endif
} }
} }

1019
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/RadialGaugeView.xaml.txt

File diff suppressed because it is too large

33
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/RatingView.xaml.cs.txt

@ -30,7 +30,40 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Rating.Views
InitializeComponent(); InitializeComponent();
} }
#if !OPEN_SOURCE
private void ValueType_SelectionChanged( object sender, System.Windows.Controls.SelectionChangedEventArgs e )
{
if( _valueType.SelectedValue != null )
{
if( _valueType.SelectedValue.ToString() == RatingValueType.Exact.ToString() )
{
_rating.Value = 2.5;
_rating.ValueType = RatingValueType.Exact;
_value.Visibility = System.Windows.Visibility.Visible;
_percentage.Visibility = System.Windows.Visibility.Collapsed;
}
else
{
_rating.Value = 0.5;
_rating.ValueType = RatingValueType.Percentage;
_value.Visibility = System.Windows.Visibility.Collapsed;
_percentage.Visibility = System.Windows.Visibility.Visible;
}
}
}
private void RatingItemsButton_Click( object sender, System.Windows.RoutedEventArgs e )
{
CollectionControlDialog diag = new CollectionControlDialog();
diag.ItemsSource = _rating.Items;
diag.NewItemTypes = new List<System.Type>() { typeof( RatingItem ) };
diag.ShowDialog();
}
private void Rating_RatingValueChanged( object sender, System.Windows.RoutedPropertyChangedEventArgs<double> e )
{
// add custom handling here
}
#endif
} }
} }

432
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/RatingView.xaml.txt

@ -27,6 +27,7 @@
<Paragraph FontSize="14" <Paragraph FontSize="14"
FontFamily="Segoe"> FontFamily="Segoe">
<Run>The Rating control fills icons to represent a value on a scale. It can be interactive and fully customizable.</Run> <Run>The Rating control fills icons to represent a value on a scale. It can be interactive and fully customizable.</Run>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
@ -34,38 +35,409 @@
<Hyperlink NavigateUri="http://www.xceed.com/Extended_WPF_Toolkit_Intro.html" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="http://www.xceed.com/Extended_WPF_Toolkit_Intro.html" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Extended WPF Toolkit Plus. Click here for more details about Xceed Extended WPF Toolkit Plus.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
<!--##EXCLUDE_OPEN_SOURCE-->
<local:DemoView.Resources>
<conv:SolidColorBrushToColorConverter x:Key="SolidColorBrushToColorConverter" />
</local:DemoView.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<GroupBox Header="Features"
Grid.Row="0"
Margin="5">
<Grid Margin="5">
<!-- Add Rating Control properties-->
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="75" />
<ColumnDefinition Width="100" />
<ColumnDefinition Width="10" />
<ColumnDefinition Width="90" />
<ColumnDefinition Width="100" />
<ColumnDefinition Width="10" />
<ColumnDefinition Width="90" />
<ColumnDefinition Width="100" />
<ColumnDefinition Width="10" />
</Grid.ColumnDefinitions>
<!-- Column 1 -->
<TextBlock Text="Value Type:"
VerticalAlignment="Center" />
<ComboBox x:Name="_valueType"
Grid.Column="1"
SelectionChanged="ValueType_SelectionChanged"
VerticalAlignment="Center"
Margin="5"
ToolTip="Gets/Sets the ValueType used for the Rating control."
SelectedValue="{Binding ValueType, ElementName=_rating}"
SelectedValuePath="Tag">
<ComboBoxItem Content="Exact"
Tag="{x:Static xctk:RatingValueType.Exact}" />
<ComboBoxItem Content="Percentage"
Tag="{x:Static xctk:RatingValueType.Percentage}" />
</ComboBox>
<TextBlock Text="Value:"
VerticalAlignment="Center"
Grid.Row="1" />
<xctk:DecimalUpDown x:Name="_value"
Grid.Row="1"
Grid.Column="1"
Minimum="0.00"
Maximum="{Binding ItemCount, ElementName=_rating}"
Increment="0.05"
VerticalAlignment="Center"
Margin="5"
ToolTip="Indicates the current Rating value (exact)."
Value="{Binding Value, ElementName=_rating}" />
<xctk:DecimalUpDown x:Name="_percentage"
Grid.Row="1"
Grid.Column="1"
Minimum="0.00"
Maximum="1.00"
Increment="0.02"
VerticalAlignment="Center"
Margin="5"
ToolTip="Indicates the current Rating value (percentage)."
Visibility="Collapsed"
Value="{Binding Value, ElementName=_rating}" />
<TextBlock Text="Item Count:"
VerticalAlignment="Center"
Grid.Row="2" />
<xctk:IntegerUpDown x:Name="_itemCount"
Grid.Row="2"
Grid.Column="1"
Minimum="0"
Maximum="10"
VerticalAlignment="Center"
Margin="5"
ToolTip="Indicates the amount of elements in the Rating control."
Value="{Binding ItemCount, ElementName=_rating}" />
<TextBlock Text="Stroke:"
VerticalAlignment="Center"
Grid.Row="3" />
<xctk:DoubleUpDown x:Name="_strokeThickness"
Grid.Row="3"
Grid.Column="1"
Minimum="0"
Maximum="5"
VerticalAlignment="Center"
Margin="5"
ToolTip="Gets/Sets the icon's stroke thickness."
Value="{Binding IconStrokeThickness, ElementName=_rating}" />
<TextBlock Text="Precision:"
VerticalAlignment="Center"
Grid.Row="4" />
<ComboBox x:Name="_precision"
Grid.Row="4"
Grid.Column="1"
VerticalAlignment="Center"
Margin="5"
ToolTip="Gets/Sets the Precision used for the Rating control."
SelectedValue="{Binding Precision, ElementName=_rating}"
SelectedValuePath="Tag">
<ComboBoxItem Content="Full"
Tag="{x:Static xctk:RatingPrecision.Full}" />
<ComboBoxItem Content="Half"
Tag="{x:Static xctk:RatingPrecision.Half}" />
<ComboBoxItem Content="Exact"
Tag="{x:Static xctk:RatingPrecision.Exact}" />
</ComboBox>
<TextBlock Text="Orientation:"
VerticalAlignment="Center"
Grid.Row="5" />
<ComboBox x:Name="_orientation"
Grid.Row="5"
Grid.Column="1"
VerticalAlignment="Center"
Margin="5"
ToolTip="Gets/Sets the Orientation used for the Rating control."
SelectedValue="{Binding Orientation, ElementName=_rating}"
SelectedValuePath="Tag">
<ComboBoxItem Content="Horizontal"
Tag="{x:Static xctk:RatingOrientation.Horizontal}" />
<ComboBoxItem Content="Vertical"
Tag="{x:Static xctk:RatingOrientation.Vertical}" />
</ComboBox>
<TextBlock Text="FillDirection:"
VerticalAlignment="Center"
Grid.Row="6" />
<ComboBox x:Name="_fillDirection"
Grid.Row="6"
Grid.Column="1"
VerticalAlignment="Center"
Margin="5"
ToolTip="Gets/Sets the Layout Direction used for the Rating control."
SelectedValue="{Binding FillDirection, ElementName=_rating}"
SelectedValuePath="Tag">
<ComboBoxItem Content="Right"
Tag="{x:Static xctk:RatingFillDirection.Right}" />
<ComboBoxItem Content="Left"
Tag="{x:Static xctk:RatingFillDirection.Left}" />
<ComboBoxItem Content="Up"
Tag="{x:Static xctk:RatingFillDirection.Up}" />
<ComboBoxItem Content="Down"
Tag="{x:Static xctk:RatingFillDirection.Down}" />
</ComboBox>
<TextBlock Text="Rating Items"
VerticalAlignment="Center"
Grid.Row="7" />
<Button x:Name="_ratingItemsButton"
Grid.Row="7"
Grid.Column="1"
VerticalAlignment="Center"
Margin="5"
Content="Rating Items"
Click="RatingItemsButton_Click" />
<!-- Column 2 -->
<TextBlock Text="ReadOnly:"
VerticalAlignment="Center"
Grid.Column="3" />
<CheckBox x:Name="_readOnly"
Grid.Column="4"
VerticalAlignment="Center"
Margin="5"
IsChecked="{Binding ReadOnly, ElementName=_rating}" />
<TextBlock Text="Height:"
VerticalAlignment="Center"
Grid.Row="1"
Grid.Column="3" />
<xctk:IntegerUpDown x:Name="_height"
Grid.Row="1"
Grid.Column="4"
Minimum="10"
Maximum="100"
VerticalAlignment="Center"
Margin="5"
ToolTip="Indicates the height of the Rating control."
Value="{Binding IconHeight, ElementName=_rating}" />
<TextBlock Text="Icon Padding:"
VerticalAlignment="Center"
Grid.Row="2"
Grid.Column="3" />
<xctk:DecimalUpDown x:Name="_iconPadding"
Grid.Row="2"
Grid.Column="4"
Minimum="0.0"
Maximum="20.0"
Increment="1.0"
VerticalAlignment="Center"
Margin="5"
ToolTip="Indicates the padding used between each icon."
Value="{Binding IconPadding, ElementName=_rating}" />
<TextBlock Text="Icon Type:"
VerticalAlignment="Center"
Grid.Row="3"
Grid.Column="3" />
<ComboBox x:Name="_iconType"
Grid.Row="3"
Grid.Column="4"
VerticalAlignment="Center"
Margin="5"
ToolTip="Gets/Sets the IconType used for the Rating control."
SelectedValue="{Binding IconType, ElementName=_rating}"
SelectedValuePath="Tag">
<ComboBoxItem Content="Star"
Tag="{x:Static xctk:RatingIconType.Star}" />
<ComboBoxItem Content="Circle"
Tag="{x:Static xctk:RatingIconType.Circle}" />
<ComboBoxItem Content="Square"
Tag="{x:Static xctk:RatingIconType.Square}" />
<ComboBoxItem Content="Triangle"
Tag="{x:Static xctk:RatingIconType.Triangle}" />
<ComboBoxItem Content="Custom"
Tag="{x:Static xctk:RatingIconType.Custom}" />
</ComboBox>
<TextBlock Text="Custom Path:"
VerticalAlignment="Center"
Grid.Row="4"
Grid.Column="3" />
<TextBox x:Name="_customPath"
Grid.Row="4"
Grid.Column="4"
VerticalAlignment="Center"
Margin="5"
IsEnabled="False"
ToolTip="Gets/Sets the path for the custom icon used for the Rating control."
Text="{Binding CustomPath, ElementName=_rating}" />
<TextBlock Text="Value Tooltip"
VerticalAlignment="Center"
Grid.Row="5"
Grid.Column="3" />
<CheckBox x:Name="_showTooltip"
Grid.Row="5"
Grid.Column="4"
VerticalAlignment="Center"
Margin="5"
IsChecked="{Binding ShowValueTooltip, ElementName=_rating}" />
<TextBlock Text="Show Labels"
VerticalAlignment="Center"
Grid.Row="6"
Grid.Column="3" />
<CheckBox x:Name="_showLabels"
Grid.Row="6"
Grid.Column="4"
VerticalAlignment="Center"
Margin="5"
IsChecked="{Binding ShowLabels, ElementName=_rating}" />
<TextBlock Text="Label Position:"
VerticalAlignment="Center"
Grid.Row="7"
Grid.Column="3" />
<ComboBox x:Name="_labelPosition"
Grid.Row="7"
Grid.Column="4"
VerticalAlignment="Center"
Margin="5"
ToolTip="Gets/Sets the Position for the Labels."
SelectedValue="{Binding LabelPosition, ElementName=_rating}"
SelectedValuePath="Tag">
<ComboBoxItem Content="Before"
Tag="{x:Static xctk:RatingLabelPosition.Before}" />
<ComboBoxItem Content="After"
Tag="{x:Static xctk:RatingLabelPosition.After}" />
</ComboBox>
<!-- Column 3 -->
<TextBlock Text="Active Border:"
VerticalAlignment="Center"
Grid.Column="6" />
<xctk:ColorPicker x:Name="_activeBorder"
Grid.Column="7"
VerticalAlignment="Center"
Margin="5"
ToolTip="Gets/Sets the color of the icon's border [active state]."
SelectedColor="{Binding ActiveBorderColor, ElementName=_rating, Converter={StaticResource SolidColorBrushToColorConverter}}" />
<TextBlock Text="Active Fill:"
VerticalAlignment="Center"
Grid.Row="1"
Grid.Column="6" />
<xctk:ColorPicker x:Name="_activeFill"
Grid.Row="1"
Grid.Column="7"
VerticalAlignment="Center"
Margin="5"
ToolTip="Gets/Sets the color of the icon's fill [active state]."
SelectedColor="{Binding ActiveFillColor, ElementName=_rating, Converter={StaticResource SolidColorBrushToColorConverter}}" />
<TextBlock Text="Inactive Border:"
VerticalAlignment="Center"
Grid.Row="2"
Grid.Column="6" />
<xctk:ColorPicker x:Name="_inactiveBorder"
Grid.Row="2"
Grid.Column="7"
VerticalAlignment="Center"
Margin="5"
ToolTip="Gets/Sets the color of the icon's border [inactive state]."
SelectedColor="{Binding InactiveBorderColor, ElementName=_rating, Converter={StaticResource SolidColorBrushToColorConverter}}" />
<TextBlock Text="Inactive Fill:"
VerticalAlignment="Center"
Grid.Row="3"
Grid.Column="6" />
<xctk:ColorPicker x:Name="_inactiveFill"
Grid.Row="3"
Grid.Column="7"
VerticalAlignment="Center"
Margin="5"
ToolTip="Gets/Sets the color of the icon's fill [inactive state]."
SelectedColor="{Binding InactiveFillColor, ElementName=_rating, Converter={StaticResource SolidColorBrushToColorConverter}}" />
<TextBlock Text="Hover Border:"
VerticalAlignment="Center"
Grid.Row="4"
Grid.Column="6" />
<xctk:ColorPicker x:Name="_hoverBorder"
Grid.Row="4"
Grid.Column="7"
VerticalAlignment="Center"
Margin="5"
ToolTip="Gets/Sets the color of the icon's border [hover state]."
SelectedColor="{Binding HoverBorderColor, ElementName=_rating, Converter={StaticResource SolidColorBrushToColorConverter}}" />
<TextBlock Text="Hover Fill:"
VerticalAlignment="Center"
Grid.Row="5"
Grid.Column="6" />
<xctk:ColorPicker x:Name="_hoverFill"
Grid.Row="5"
Grid.Column="7"
VerticalAlignment="Center"
Margin="5"
ToolTip="Gets/Sets the color of the icon's fill [hover state]."
SelectedColor="{Binding HoverFillColor, ElementName=_rating, Converter={StaticResource SolidColorBrushToColorConverter}}" />
</Grid>
</GroupBox>
<StackPanel Grid.Row="1"
Margin="10">
<TextBlock Text="Usage:"
Style="{StaticResource Header}" />
<xctk:Rating Name="_rating"
VerticalAlignment="top"
HorizontalAlignment="Left"
ValueType="Exact"
ReadOnly="True"
IconHeight="50"
ItemCount="5"
Value="2.5"
Orientation="Horizontal"
FillDirection="Right"
Precision="Exact"
IconType="Star"
CustomPath="M 0,19 L 35,39 24,45 55,63 47,68 100,100 67,58 75,54 51,32 58,28 39,0 z"
IconPadding="2"
IconStrokeThickness="1"
ActiveBorderColor="Black"
ActiveFillColor="Orange"
InactiveBorderColor="Blue"
InactiveFillColor="AliceBlue"
HoverBorderColor="Red"
HoverFillColor="Yellow"
ShowValueTooltip="False"
RatingValueChanged="Rating_RatingValueChanged" />
</StackPanel>
</Grid>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<Image Source="..\OpenSourceImages\Rating.png" Width="600" Height="400"/> <Image Source="..\OpenSourceImages\Rating.png" Width="600" Height="400"/>
##END-->
</local:DemoView> </local:DemoView>

66
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/StylableWindowView.xaml.cs.txt

@ -47,28 +47,80 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Window.Views
private const string MessageBoxStyleKey = "messageBoxStyle"; private const string MessageBoxStyleKey = "messageBoxStyle";
private const string WindowControlStyleKey = "windowControlStyle"; private const string WindowControlStyleKey = "windowControlStyle";
private const string WindowButtonStyle = "FancyButtonStyle"; private const string WindowButtonStyle = "FancyButtonStyle";
#if OPEN_SOURCE
private const string StylableWindowMessage = "StylableWindow is a standalone window that can be styled just like ChildWindow or MessageBox. This is a feature of the \"Plus\" version."; private const string StylableWindowMessage = "StylableWindow is a standalone window that can be styled just like ChildWindow or MessageBox. This is a feature of the \"Plus\" version.";
#else
private const string StylableWindowNoStyleKey = "stylableWindowNoStyle";
private const string StylableWindowStyleKey = "stylableWindowStyle";
private StylableWindow _stylableWindow;
#endif
public StylableWindowView() public StylableWindowView()
{ {
InitializeComponent(); InitializeComponent();
#if !OPEN_SOURCE
this.Unloaded += new RoutedEventHandler( OnSampleUnloaded );
#endif
this.UpdateWindowsStyles(null,null); this.UpdateWindowsStyles(null,null);
} }
#if !OPEN_SOURCE
private void OnSampleUnloaded( object sender, RoutedEventArgs e )
{
//# Be sure to close the window
if( _stylableWindow != null )
{
_stylableWindow.Close();
}
}
#endif
private void OnStylableWindow_Click( object sender, RoutedEventArgs e ) private void OnStylableWindow_Click( object sender, RoutedEventArgs e )
{ {
#if OPEN_SOURCE
var msgBox = new Xceed.Wpf.Toolkit.MessageBox(); var msgBox = new Xceed.Wpf.Toolkit.MessageBox();
msgBox.DataContext = this.DataContext; msgBox.DataContext = this.DataContext;
msgBox.Text = StylableWindowMessage; msgBox.Text = StylableWindowMessage;
msgBox.Caption = StyledMsgBoxTitle; msgBox.Caption = StyledMsgBoxTitle;
msgBox.Style = ( _enableStyleCheckBox.IsChecked.GetValueOrDefault() ) ? ( Style )this.Resources[ MessageBoxStyleKey ] : null; msgBox.Style = ( _enableStyleCheckBox.IsChecked.GetValueOrDefault() ) ? ( Style )this.Resources[ MessageBoxStyleKey ] : null;
msgBox.ShowDialog(); msgBox.ShowDialog();
#else
if( _stylableWindow == null )
{
_stylableWindow = new StylableWindow();
_stylableWindow.Width = 500;
_stylableWindow.Height = 300;
_stylableWindow.Title = StylableWindowTitle;
_stylableWindow.DataContext = this.DataContext;
_stylableWindow.Left = Application.Current.MainWindow.Left + ( Application.Current.MainWindow.ActualWidth / 2 );
_stylableWindow.Top = Application.Current.MainWindow.Top + ( Application.Current.MainWindow.ActualHeight / 2 );
_stylableWindow.Closed += new EventHandler( OnStylableWindowClosed );
_stylableWindow.Topmost = true;
_stylableWindow.Content = new TextBlock()
{
Text = StylableWindowContent,
TextWrapping = TextWrapping.Wrap
};
_stylableWindow.Style = ( _enableStyleCheckBox.IsChecked.GetValueOrDefault() )
? ( Style )this.Resources[ StylableWindowStyleKey ]
: ( Style )this.Resources[ StylableWindowNoStyleKey ];
_stylableWindow.Show();
}
#endif
} }
#if !OPEN_SOURCE
private void OnStylableWindowClosed( object sender, EventArgs e )
{
_stylableWindow.Closed -= new EventHandler( OnStylableWindowClosed );
_stylableWindow.Style = null;
_stylableWindow.DataContext = null;
_stylableWindow = null;
}
#endif
private void StandardMessageBoxButton_Click( object sender, RoutedEventArgs e ) private void StandardMessageBoxButton_Click( object sender, RoutedEventArgs e )
{ {
System.Windows.MessageBox.Show( StandardMsgBoxMessage, StandardMsgBoxTitle ); System.Windows.MessageBox.Show( StandardMsgBoxMessage, StandardMsgBoxTitle );
@ -99,6 +151,14 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Window.Views
_childWindow.ClearValue( ChildWindow.StyleProperty ); _childWindow.ClearValue( ChildWindow.StyleProperty );
} }
#if !OPEN_SOURCE
if( _stylableWindow != null )
{
_stylableWindow.Style = ( styled )
? ( Style )this.Resources[ StylableWindowStyleKey ]
: ( Style )this.Resources[ StylableWindowNoStyleKey ];
}
#endif
} }
} }

38
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/StylableWindowView.xaml.txt

@ -28,10 +28,12 @@
<LineBreak /> <LineBreak />
<LineBreak /> <LineBreak />
<Run>The "Plus" version provides a new control called StylableWindow, which consists of a window that has all the functions of a normal window, but which can be styled in the same way as ChildWindow or MessageBox.</Run> <Run>The "Plus" version provides a new control called StylableWindow, which consists of a window that has all the functions of a normal window, but which can be styled in the same way as ChildWindow or MessageBox.</Run>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<Hyperlink NavigateUri="http://www.xceed.com/Extended_WPF_Toolkit_Intro.html" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="http://www.xceed.com/Extended_WPF_Toolkit_Intro.html" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Extended WPF Toolkit Plus. Click here for more details about Xceed Extended WPF Toolkit Plus.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
@ -54,6 +56,11 @@
<Setter Property="CaptionForeground" Value="{Binding TitleForeground}" /> <Setter Property="CaptionForeground" Value="{Binding TitleForeground}" />
<Setter Property="CaptionShadowBrush" Value="{Binding TitleShadowBrush}" /> <Setter Property="CaptionShadowBrush" Value="{Binding TitleShadowBrush}" />
<Setter Property="CloseButtonStyle" Value="{Binding CloseButtonStyle}" /> <Setter Property="CloseButtonStyle" Value="{Binding CloseButtonStyle}" />
<!--##EXCLUDE_OPEN_SOURCE-->
<Setter Property="MinimizeButtonStyle" Value="{Binding MinimizeButtonStyle}" />
<Setter Property="MaximizeButtonStyle" Value="{Binding MaximizeButtonStyle}" />
<Setter Property="RestoreButtonStyle" Value="{Binding RestoreButtonStyle}" />
<!--##END-->
</Style> </Style>
<!--Style for the MessageBox--> <!--Style for the MessageBox-->
@ -65,6 +72,30 @@
<Setter Property="NoButtonStyle" Value="{StaticResource FancyButtonStyle}" /> <Setter Property="NoButtonStyle" Value="{StaticResource FancyButtonStyle}" />
</Style> </Style>
<!--##EXCLUDE_OPEN_SOURCE-->
<!--Style for the StylableWindow-->
<Style x:Key="stylableWindowNoStyle" TargetType="xctk:StylableWindow" >
<Setter Property="Icon" Value="..\Resources\xceed_icon.png" />
<Setter Property="CloseButtonVisibility" Value="{Binding CloseButtonVisibility}" />
<Setter Property="WindowStyleOverride" Value="{Binding WindowStyle}" />
<Setter Property="ResizeMode" Value="{Binding ResizeMode}" />
<Setter Property="Width" Value="375" />
<Setter Property="Height" Value="150" />
</Style>
<Style x:Key="stylableWindowStyle" TargetType="xctk:StylableWindow" BasedOn="{StaticResource stylableWindowNoStyle}">
<Setter Property="WindowBackground" Value="{Binding WindowBackground}" />
<Setter Property="WindowBorderBrush" Value="{Binding WindowBorderBrush}" />
<Setter Property="WindowInactiveBackground" Value="{Binding WindowInactiveBackground}" />
<Setter Property="WindowBorderThickness" Value="{Binding WindowBorderThickness}" />
<Setter Property="WindowOpacity" Value="{Binding WindowOpacity}" />
<Setter Property="TitleForeground" Value="{Binding TitleForeground}" />
<Setter Property="TitleShadowBrush" Value="{Binding TitleShadowBrush}" />
<Setter Property="CloseButtonStyle" Value="{Binding CloseButtonStyle}" />
<Setter Property="MinimizeButtonStyle" Value="{Binding MinimizeButtonStyle}" />
<Setter Property="MaximizeButtonStyle" Value="{Binding MaximizeButtonStyle}" />
<Setter Property="RestoreButtonStyle" Value="{Binding RestoreButtonStyle}" />
</Style>
<!--##END-->
</ResourceDictionary> </ResourceDictionary>
</local:DemoView.Resources> </local:DemoView.Resources>
@ -132,6 +163,7 @@
<GroupBox Header="Stylable Window" DockPanel.Dock="Top" Margin="5" HorizontalAlignment="Stretch" > <GroupBox Header="Stylable Window" DockPanel.Dock="Top" Margin="5" HorizontalAlignment="Stretch" >
<Button Width="160" Height="30" Margin="10" HorizontalAlignment="Center" <Button Width="160" Height="30" Margin="10" HorizontalAlignment="Center"
Content="Show" Click="OnStylableWindow_Click" > Content="Show" Click="OnStylableWindow_Click" >
<!--##INCLUDE_OPEN_SOURCE
<Button.ContentTemplate> <Button.ContentTemplate>
<DataTemplate> <DataTemplate>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
@ -143,6 +175,7 @@
</StackPanel> </StackPanel>
</DataTemplate> </DataTemplate>
</Button.ContentTemplate> </Button.ContentTemplate>
##END-->
</Button> </Button>
</GroupBox> </GroupBox>
<GroupBox Header="ChildWindow" Margin="5"> <GroupBox Header="ChildWindow" Margin="5">
@ -156,6 +189,11 @@
WindowState="Open" WindowState="Open"
CloseButtonVisibility="{Binding CloseButtonVisibility}" CloseButtonVisibility="{Binding CloseButtonVisibility}"
WindowStyle="{Binding WindowStyle}" > WindowStyle="{Binding WindowStyle}" >
<!--##EXCLUDE_OPEN_SOURCE-->
<xctk:ChildWindow.ResizeMode>
<Binding Path="ResizeMode"/>
</xctk:ChildWindow.ResizeMode>
<!--##END-->
<TextBlock> <TextBlock>
This is the content of the child window. This is the content of the child window.
</TextBlock> </TextBlock>

466
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/SwitchPanelView.xaml.cs.txt

@ -24,7 +24,9 @@ using Xceed.Wpf.Toolkit;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.IO; using System.IO;
using System.Diagnostics; using System.Diagnostics;
#if OPEN_SOURCE
using System.Windows.Media.Imaging; using System.Windows.Media.Imaging;
#endif
namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Panels.Views namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Panels.Views
{ {
@ -35,6 +37,9 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Panels.Views
{ {
#region Members #region Members
#if !OPEN_SOURCE
private DependencyObject _textBlockIdentifier;
#endif
#endregion #endregion
@ -47,6 +52,7 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Panels.Views
private void OnLayoutComboSelectionChanged( object sender, RoutedEventArgs e ) private void OnLayoutComboSelectionChanged( object sender, RoutedEventArgs e )
{ {
#if OPEN_SOURCE
ComboBox comboBox = sender as ComboBox; ComboBox comboBox = sender as ComboBox;
bool isPlusPanel = (comboBox.SelectedIndex >= 2); bool isPlusPanel = (comboBox.SelectedIndex >= 2);
@ -124,63 +130,523 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Panels.Views
if( _openSourceScreenShotDesc != null ) if( _openSourceScreenShotDesc != null )
_openSourceScreenShotDesc.Text = desc; _openSourceScreenShotDesc.Text = desc;
} }
#endif
} }
private void OnSwitchPanelLayoutChanged( object sender, RoutedEventArgs e ) private void OnSwitchPanelLayoutChanged( object sender, RoutedEventArgs e )
{ {
#if !OPEN_SOURCE
SwitchPanel switchPanel = sender as SwitchPanel;
if( switchPanel.ActiveLayout is Xceed.Wpf.Toolkit.Panels.Canvas )
{
InitCanvasPanel( switchPanel );
}
else if( switchPanel.ActiveLayout is Xceed.Wpf.Toolkit.Panels.DockPanel )
{
InitDockPanel( switchPanel );
}
else if( switchPanel.ActiveLayout is Xceed.Wpf.Toolkit.Panels.Grid )
{
InitGridPanel( switchPanel );
}
else if( switchPanel.ActiveLayout is Xceed.Wpf.Toolkit.Panels.StackedStackPanel )
{
InitStackedStackPanel( switchPanel );
}
else if( switchPanel.ActiveLayout is Xceed.Wpf.Toolkit.Panels.RelativeCanvas )
{
InitRelativeCanvasPanel( switchPanel );
}
else if( switchPanel.ActiveLayout is Xceed.Wpf.Toolkit.Panels.RadialCanvas )
{
InitRadialCanvasPanel( switchPanel );
}
else if( switchPanel.ActiveLayout is Xceed.Wpf.Toolkit.Panels.CameraPanel )
{
InitCameraPanel( switchPanel );
}
else if( switchPanel.ActiveLayout is Xceed.Wpf.Toolkit.Panels.AnimatedTimelinePanel )
{
InitAnimatedTimelinePanel( switchPanel );
}
#endif
} }
#if !OPEN_SOURCE
private void OnCanvasMoveItemComboBoxChanged( object sender, SelectionChangedEventArgs e )
{
ComboBox combo = sender as ComboBox;
if( ( combo == null ) || !( combo.SelectedItem is Coordinates ) )
{
throw new InvalidDataException( "ComboBox should contain a coordinate." );
}
Coordinates coordinate = combo.SelectedItem as Coordinates;
SetItemPositionOnCanvas( _textBlockIdentifier, coordinate.X, coordinate.Y );
}
private void OnDockComboBoxChanged( object sender, SelectionChangedEventArgs e )
{
ComboBox combo = sender as ComboBox;
if( ( combo != null) && (combo.SelectedItem is Dock) )
SetItemPositionOnDockPanel( _textBlockIdentifier, (Dock)combo.SelectedItem );
}
private void OnGridComboBoxChanged( object sender, SelectionChangedEventArgs e )
{
ComboBox combo = sender as ComboBox;
if( ( combo == null ) || !( combo.SelectedItem is Coordinates ) )
{
throw new InvalidDataException( "ComboBox should contain a coordinate." );
}
Coordinates coordinate = combo.SelectedItem as Coordinates;
SetItemPositionOnGrid( _textBlockIdentifier, (int)coordinate.X, (int)coordinate.Y );
}
private void OnStackedStackComboBoxChanged( object sender, SelectionChangedEventArgs e )
{
ComboBox combo = sender as ComboBox;
if( ( combo != null ) && ( combo.SelectedItem is int ) )
SetItemPositionOnStackedStackPanel( _textBlockIdentifier, (int)combo.SelectedItem );
}
private void OnStackedStackPanelStackLengthChanged( object sender, EventArgs e )
{
DoubleUpDown doubleUpDown = sender as DoubleUpDown;
if( doubleUpDown.Value.HasValue )
{
_stackedStackPanel.DefaultStackLength = double.IsNaN( doubleUpDown.Value.Value )
? StackLength.Auto
: new StackLength( doubleUpDown.Value.Value );
}
}
private void OnRelativeLeftTopComboBoxChanged( object sender, SelectionChangedEventArgs e )
{
ComboBox combo = sender as ComboBox;
if( ( combo == null ) || !( combo.SelectedItem is Coordinates ) )
{
throw new InvalidDataException( "ComboBox should contain a coordinate." );
}
Coordinates coordinate = combo.SelectedItem as Coordinates;
SetItemPositionOnRelativeCanvas( _textBlockIdentifier, coordinate.X, coordinate.Y, null, null, null );
}
private void OnRelativeWidthHeightComboBoxChanged( object sender, SelectionChangedEventArgs e )
{
ComboBox combo = sender as ComboBox;
if( ( combo == null ) || !( combo.SelectedItem is Coordinates ) )
{
throw new InvalidDataException( "ComboBox should contain a coordinate." );
}
Coordinates coordinate = combo.SelectedItem as Coordinates;
SetItemPositionOnRelativeCanvas( _textBlockIdentifier, null, null, coordinate.X, coordinate.Y, null );
}
private void OnRelativePinPointComboBoxChanged( object sender, SelectionChangedEventArgs e )
{
ComboBox combo = sender as ComboBox;
if( ( combo == null ) || !( combo.SelectedItem is Coordinates ) )
{
throw new InvalidDataException( "ComboBox should contain a coordinate." );
}
Coordinates coordinate = combo.SelectedItem as Coordinates;
Point pinPoint = new Point( coordinate.X, coordinate.Y );
SetItemPositionOnRelativeCanvas( _textBlockIdentifier, null, null, null, null, pinPoint );
}
private void OnRadialCanvasCenterComboBoxChanged( object sender, SelectionChangedEventArgs e )
{
ComboBox combo = sender as ComboBox;
if( ( combo == null ) || !( combo.SelectedItem is Coordinates ) )
{
throw new InvalidDataException( "ComboBox should contain a coordinate." );
}
Coordinates coordinate = combo.SelectedItem as Coordinates;
_radialCanvas.Center = new Point( coordinate.X, coordinate.Y );
}
private void OnRadialCanvasAngleComboBoxChanged( object sender, SelectionChangedEventArgs e )
{
ComboBox combo = sender as ComboBox;
if( ( combo != null ) && ( combo.SelectedItem is int ) )
{
if( _textBlockIdentifier != null )
Xceed.Wpf.Toolkit.Panels.RadialCanvas.SetAngle( _textBlockIdentifier, ( int )combo.SelectedItem );
}
}
private void OnRadialCanvasRadiusComboBoxChanged( object sender, SelectionChangedEventArgs e )
{
ComboBox combo = sender as ComboBox;
if( ( combo != null ) && ( combo.SelectedItem is int ) )
{
if( _textBlockIdentifier != null )
Xceed.Wpf.Toolkit.Panels.RadialCanvas.SetRadius( _textBlockIdentifier, ( int )combo.SelectedItem );
}
}
private void OnRadialCanvasPinPointComboBoxChanged( object sender, SelectionChangedEventArgs e )
{
ComboBox combo = sender as ComboBox;
if( ( combo == null ) || !( combo.SelectedItem is Coordinates ) )
{
throw new InvalidDataException( "ComboBox should contain a coordinate." );
}
Coordinates coordinate = combo.SelectedItem as Coordinates;
Point pinPoint = new Point( coordinate.X, coordinate.Y );
SetItemPositionOnRadialCanvas( _textBlockIdentifier, null, null, pinPoint );
}
private void OnAnimatedTimelineUnitTimeSpanChanged( object sender, EventArgs e )
{
IntegerUpDown integerUpDown = sender as IntegerUpDown;
if( integerUpDown.Value.HasValue )
{
_animatedTimeLinePanel.UnitTimeSpan = (integerUpDown.Value.Value == 0)
? System.TimeSpan.Zero
: new System.TimeSpan( integerUpDown.Value.Value, 0, 0, 0 );
}
}
private void OnAnimatedTimelineDatesChanged( object sender, SelectionChangedEventArgs e )
{
ComboBox combo = sender as ComboBox;
if( ( combo != null ) && ( combo.SelectedItem is string ) )
{
string selectionContent = ( string )combo.SelectedItem;
string[] dateContent = selectionContent.Split( new string[]{ "to" }, StringSplitOptions.RemoveEmptyEntries );
if( dateContent.Length != 2 )
throw new InvalidDataException( "ComboBox should contain 2 date strings." );
if( ( _textBlockIdentifier != null ) && ( _textBlockIdentifier is TextBlock ) )
{
TextBlock textBlock = _textBlockIdentifier as TextBlock;
ResetItemContent( textBlock );
AddToItemContent( textBlock, dateContent[ 0 ], dateContent[ 1 ] );
}
SetItemPositionOnAnimatedTimelinePanel( _textBlockIdentifier, System.DateTime.Parse( dateContent[ 0 ] ), System.DateTime.Parse( dateContent[ 1 ] ) );
}
}
private void OnAnimatedTimelinePanelDeactivated( object sender, RoutedEventArgs e )
{
AnimationPanel animationPanel = sender as AnimationPanel;
if( animationPanel != null )
{
ResetItemContent( "_item1" );
ResetItemContent( "_item2" );
ResetItemContent( "_item3" );
ResetItemContent( "_item4" );
ResetItemContent( "_item5" );
ResetItemContent( "_item6" );
ResetItemContent( "_item7" );
ResetItemContent( "_item8" );
}
}
#endif //!OPEN_SOURCE
#endregion #endregion
#region Methods (Private) #region Methods (Private)
#if !OPEN_SOURCE
private void InitCanvasPanel( SwitchPanel switchPanel )
{
if( ( switchPanel != null ) && ( switchPanel.ActiveLayout != null ) )
{
_textBlockIdentifier = switchPanel.ActiveLayout.FindName( "_item8" ) as DependencyObject;
SetItemPositionOnCanvas( switchPanel, "_item1", 0, 200 );
SetItemPositionOnCanvas( switchPanel, "_item2", 150, 0 );
SetItemPositionOnCanvas( switchPanel, "_item3", 180, 180 );
SetItemPositionOnCanvas( switchPanel, "_item4", 12, 50 );
SetItemPositionOnCanvas( switchPanel, "_item5", 400, 30 );
SetItemPositionOnCanvas( switchPanel, "_item6", 500, 200 );
SetItemPositionOnCanvas( switchPanel, "_item7", 260, 50 );
SetItemPositionOnCanvas( switchPanel, "_item8", 600, 0 );
}
}
private void InitDockPanel( SwitchPanel switchPanel )
{
if( ( switchPanel != null ) && ( switchPanel.ActiveLayout != null ) )
_textBlockIdentifier = switchPanel.ActiveLayout.FindName( "_item2" ) as DependencyObject;
}
private void InitGridPanel( SwitchPanel switchPanel )
{
if( ( switchPanel != null ) && ( switchPanel.ActiveLayout != null ) )
{
_textBlockIdentifier = switchPanel.ActiveLayout.FindName( "_item4" ) as DependencyObject;
SetItemPositionOnGrid( switchPanel, "_item1", 1, 2 );
SetItemPositionOnGrid( switchPanel, "_item2", 3, 0 );
SetItemPositionOnGrid( switchPanel, "_item3", 2, 1 );
SetItemPositionOnGrid( switchPanel, "_item4", 3, 2 );
SetItemPositionOnGrid( switchPanel, "_item5", 3, 1 );
SetItemPositionOnGrid( switchPanel, "_item6", 2, 0 );
SetItemPositionOnGrid( switchPanel, "_item7", 0, 0 );
SetItemPositionOnGrid( switchPanel, "_item8", 1, 1 );
}
}
private void InitStackedStackPanel( SwitchPanel switchPanel )
{
if( ( switchPanel != null ) && ( switchPanel.ActiveLayout != null ) )
{
_textBlockIdentifier = switchPanel.ActiveLayout.FindName( "_item5" ) as DependencyObject;
SetItemPositionOnStackedStackPanel( switchPanel, "_item1", 1 );
SetItemPositionOnStackedStackPanel( switchPanel, "_item2", 3 );
SetItemPositionOnStackedStackPanel( switchPanel, "_item3", 2 );
SetItemPositionOnStackedStackPanel( switchPanel, "_item4", 3 );
SetItemPositionOnStackedStackPanel( switchPanel, "_item5", 2 );
SetItemPositionOnStackedStackPanel( switchPanel, "_item6", 2 );
SetItemPositionOnStackedStackPanel( switchPanel, "_item7", 0 );
SetItemPositionOnStackedStackPanel( switchPanel, "_item8", 1 );
}
}
private void InitRelativeCanvasPanel( SwitchPanel switchPanel )
{
if( ( switchPanel != null ) && ( switchPanel.ActiveLayout != null ) )
{
_textBlockIdentifier = switchPanel.ActiveLayout.FindName( "_item6" ) as DependencyObject;
SetItemPositionOnRelativeCanvas( switchPanel, "_item1", 0.3, 0.1 );
SetItemPositionOnRelativeCanvas( switchPanel, "_item2", 0.55, 0 );
SetItemPositionOnRelativeCanvas( switchPanel, "_item3", 0.6, 0.75 );
SetItemPositionOnRelativeCanvas( switchPanel, "_item4", 0.05, 0.2 );
SetItemPositionOnRelativeCanvas( switchPanel, "_item5", 0.45, 0.9 );
SetItemPositionOnRelativeCanvas( switchPanel, "_item6", 0.2, 0.7 );
SetItemPositionOnRelativeCanvas( switchPanel, "_item7", 0.5, 0.4 );
SetItemPositionOnRelativeCanvas( switchPanel, "_item8", 0.85, 0.8 );
}
}
private void InitRadialCanvasPanel( SwitchPanel switchPanel )
{
if( ( switchPanel != null ) && ( switchPanel.ActiveLayout != null ) )
{
_textBlockIdentifier = switchPanel.ActiveLayout.FindName( "_item7" ) as DependencyObject;
SetItemPositionOnRadialCanvas( switchPanel, "_item1", 278, 0 );
SetItemPositionOnRadialCanvas( switchPanel, "_item2", 100, 145 );
SetItemPositionOnRadialCanvas( switchPanel, "_item3", 125, 270 );
SetItemPositionOnRadialCanvas( switchPanel, "_item4", 200, 335 );
SetItemPositionOnRadialCanvas( switchPanel, "_item5", 200, 30 );
SetItemPositionOnRadialCanvas( switchPanel, "_item6", 25, 0 );
SetItemPositionOnRadialCanvas( switchPanel, "_item7", 175, 200 );
SetItemPositionOnRadialCanvas( switchPanel, "_item8", 300, 175 );
}
}
private void InitCameraPanel( SwitchPanel switchPanel )
{
if( ( switchPanel != null ) && ( switchPanel.ActiveLayout != null ) )
{
_textBlockIdentifier = switchPanel.ActiveLayout.FindName( "_item3" ) as DependencyObject;
SetItemPositionOnCameraPanel( switchPanel, "_item1", 50, 100, 100 );
SetItemPositionOnCameraPanel( switchPanel, "_item2", 400, 175, 25 );
SetItemPositionOnCameraPanel( switchPanel, "_item3", 250, 300, 200 );
SetItemPositionOnCameraPanel( switchPanel, "_item4", 75, 0, 50 );
SetItemPositionOnCameraPanel( switchPanel, "_item5", 500, 150, 2 );
SetItemPositionOnCameraPanel( switchPanel, "_item6", 25, 300, 90 );
SetItemPositionOnCameraPanel( switchPanel, "_item7", 0, 200, 300 );
SetItemPositionOnCameraPanel( switchPanel, "_item8", 450, 250, 100 );
}
}
private void InitAnimatedTimelinePanel( SwitchPanel switchPanel )
{
if( ( switchPanel != null ) && ( switchPanel.ActiveLayout != null ) )
{
_textBlockIdentifier = switchPanel.ActiveLayout.FindName( "_item2" ) as DependencyObject;
SetItemPositionOnAnimatedTimelinePanel( switchPanel, "_item1", new System.DateTime( 2012, 1, 1 ), new System.DateTime( 2012, 1, 1 ) );
SetItemPositionOnAnimatedTimelinePanel( switchPanel, "_item2", new System.DateTime( 2012, 1, 3 ), new System.DateTime( 2012, 1, 3 ) );
SetItemPositionOnAnimatedTimelinePanel( switchPanel, "_item3", new System.DateTime( 2012, 1, 1 ), new System.DateTime( 2012, 1, 4 ) );
SetItemPositionOnAnimatedTimelinePanel( switchPanel, "_item4", new System.DateTime( 2012, 1, 4 ), new System.DateTime( 2012, 1, 4 ) );
SetItemPositionOnAnimatedTimelinePanel( switchPanel, "_item5", new System.DateTime( 2012, 1, 1 ), new System.DateTime( 2012, 1, 1 ) );
SetItemPositionOnAnimatedTimelinePanel( switchPanel, "_item6", new System.DateTime( 2012, 1, 7 ), new System.DateTime( 2012, 1, 7 ) );
SetItemPositionOnAnimatedTimelinePanel( switchPanel, "_item7", new System.DateTime( 2012, 1, 5 ), new System.DateTime( 2012, 1, 7 ) );
SetItemPositionOnAnimatedTimelinePanel( switchPanel, "_item8", new System.DateTime( 2012, 1, 6 ), new System.DateTime( 2012, 1, 6 ) );
}
}
private void SetItemPositionOnCanvas( SwitchPanel switchPanel, string itemName, double left, double top )
{
if( switchPanel != null )
{
object item = switchPanel.ActiveLayout.FindName( itemName ) as object;
SetItemPositionOnCanvas( ( DependencyObject )item, left, top );
}
}
private void SetItemPositionOnCanvas( DependencyObject item, double left, double top )
{
if( item != null )
{
Xceed.Wpf.Toolkit.Panels.Canvas.SetLeft( item, left );
Xceed.Wpf.Toolkit.Panels.Canvas.SetTop( item, top );
}
}
private void SetItemPositionOnDockPanel( DependencyObject item, Dock dock )
{
if( item != null )
Xceed.Wpf.Toolkit.Panels.DockPanel.SetDock( item, dock );
}
private void SetItemPositionOnGrid( SwitchPanel switchPanel, string itemName, int row, int column )
{
if( switchPanel != null )
{
object item = switchPanel.ActiveLayout.FindName( itemName ) as object;
SetItemPositionOnGrid( ( DependencyObject )item, row, column );
}
}
private void SetItemPositionOnGrid( DependencyObject item, int row, int column )
{
if( item != null )
{
Xceed.Wpf.Toolkit.Panels.Grid.SetRow( item, row );
Xceed.Wpf.Toolkit.Panels.Grid.SetColumn( item, column );
}
}
private void SetItemPositionOnStackedStackPanel( SwitchPanel switchPanel, string itemName, int stacked )
{
if( switchPanel != null )
{
object item = switchPanel.ActiveLayout.FindName( itemName ) as object;
SetItemPositionOnStackedStackPanel( ( DependencyObject )item, stacked );
}
}
private void SetItemPositionOnStackedStackPanel( DependencyObject item, int stacked )
{
if( item != null )
Xceed.Wpf.Toolkit.Panels.StackedStackPanel.SetStack( item, stacked );
}
private void SetItemPositionOnRelativeCanvas( SwitchPanel switchPanel, string itemName, double left, double top )
{
if( switchPanel != null )
{
object item = switchPanel.ActiveLayout.FindName( itemName ) as object;
SetItemPositionOnRelativeCanvas( ( DependencyObject )item, left, top, null, null, null );
}
}
private void SetItemPositionOnRelativeCanvas( DependencyObject item, double? left, double? top, double? width, double? height, Point? pinPoint )
{
if( item != null )
{
if( left.HasValue )
Xceed.Wpf.Toolkit.Panels.RelativeCanvas.SetLeft( item, left.Value );
if( top.HasValue )
Xceed.Wpf.Toolkit.Panels.RelativeCanvas.SetTop( item, top.Value );
if( width.HasValue )
Xceed.Wpf.Toolkit.Panels.RelativeCanvas.SetRelativeWidth( item, width.Value );
if( height.HasValue )
Xceed.Wpf.Toolkit.Panels.RelativeCanvas.SetRelativeHeight( item, height.Value );
if( pinPoint.HasValue )
Xceed.Wpf.Toolkit.Panels.RelativeCanvas.SetPinPoint( item, pinPoint.Value );
}
}
private void SetItemPositionOnRadialCanvas( SwitchPanel switchPanel, string itemName, int radius, int angle )
{
if( switchPanel != null )
{
object item = switchPanel.ActiveLayout.FindName( itemName ) as object;
SetItemPositionOnRadialCanvas( ( DependencyObject )item, radius, angle, null );
}
}
private void SetItemPositionOnRadialCanvas( DependencyObject item, int? radius, int? angle, Point? pinPoint )
{
if( item != null )
{
if( radius.HasValue )
Xceed.Wpf.Toolkit.Panels.RadialCanvas.SetRadius( item, radius.Value );
if( angle.HasValue )
Xceed.Wpf.Toolkit.Panels.RadialCanvas.SetAngle( item, angle.Value );
if( pinPoint.HasValue )
Xceed.Wpf.Toolkit.Panels.RadialCanvas.SetPinPoint( item, pinPoint.Value );
}
}
private void SetItemPositionOnCameraPanel( SwitchPanel switchPanel, string itemName, double left, double top, int depth )
{
if( switchPanel != null )
{
object item = switchPanel.ActiveLayout.FindName( itemName ) as object;
SetItemPositionOnCameraPanel( ( DependencyObject )item, left, top, depth );
}
}
private void SetItemPositionOnCameraPanel( DependencyObject item, double left, double top, int depth )
{
if( item != null )
{
Xceed.Wpf.Toolkit.Panels.CameraPanel.SetLeft( item, left );
Xceed.Wpf.Toolkit.Panels.CameraPanel.SetTop( item, top );
Xceed.Wpf.Toolkit.Panels.CameraPanel.SetDepth( item, depth );
}
}
private void SetItemPositionOnAnimatedTimelinePanel( SwitchPanel switchPanel, string itemName, System.DateTime date, System.DateTime dateEnd )
{
if( switchPanel != null )
{
object item = switchPanel.ActiveLayout.FindName( itemName ) as object;
AddToItemContent( item, date.ToShortDateString(), dateEnd.ToShortDateString() );
SetItemPositionOnAnimatedTimelinePanel( ( DependencyObject )item, date, dateEnd );
}
}
private void SetItemPositionOnAnimatedTimelinePanel( DependencyObject item, System.DateTime date, System.DateTime dateEnd )
{
if( item != null )
{
Xceed.Wpf.Toolkit.Panels.AnimatedTimelinePanel.SetDate( item, date );
Xceed.Wpf.Toolkit.Panels.AnimatedTimelinePanel.SetDateEnd( item, dateEnd );
}
}
private void AddToItemContent( object o, string date1, string date2 )
{
if( o is TextBlock )
{
string addedString = "\n" + date1 + "\nto " + date2;
( ( TextBlock )o ).Text += addedString;
}
}
private void ResetItemContent( object o )
{
if( o is TextBlock )
{
TextBlock textBlock = ( TextBlock )o;
//# Only keep the first line
int endIndex = textBlock.Text.IndexOf( '\n' );
if( endIndex > 0 )
textBlock.Text = textBlock.Text.Substring( 0, endIndex );
}
}
private void ResetItemContent( string itemName )
{
if( ( _switchPanel != null ) && ( _switchPanel.ActiveLayout != null ) )
{
object textBlock = _switchPanel.ActiveLayout.FindName( itemName );
ResetItemContent( textBlock );
}
}
#endif //!OPEN_SOURCE
#endregion #endregion

830
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/SwitchPanelView.xaml.txt

@ -55,6 +55,7 @@
</Style.Triggers> </Style.Triggers>
</Style> </Style>
<!--##INCLUDE_OPEN_SOURCE
<Style x:Key="plusSuffix" TargetType="TextBlock"> <Style x:Key="plusSuffix" TargetType="TextBlock">
<Setter Property="Margin" Value="5,0,0,0"/> <Setter Property="Margin" Value="5,0,0,0"/>
<Setter Property="Text" Value="Plus Only"/> <Setter Property="Text" Value="Plus Only"/>
@ -68,6 +69,7 @@
</DataTrigger> </DataTrigger>
</Style.Triggers> </Style.Triggers>
</Style> </Style>
##END-->
<Style x:Key="plusItem" TargetType="ComboBoxItem" > <Style x:Key="plusItem" TargetType="ComboBoxItem" >
<Setter Property="HorizontalContentAlignment" Value="Stretch"/> <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
@ -76,7 +78,9 @@
<DataTemplate> <DataTemplate>
<DockPanel> <DockPanel>
<TextBlock DockPanel.Dock="Left" Text="{Binding}" /> <TextBlock DockPanel.Dock="Left" Text="{Binding}" />
<!--##INCLUDE_OPEN_SOURCE
<TextBlock TextAlignment="Right" Style="{StaticResource plusSuffix}" /> <TextBlock TextAlignment="Right" Style="{StaticResource plusSuffix}" />
##END-->
</DockPanel> </DockPanel>
</DataTemplate> </DataTemplate>
</Setter.Value> </Setter.Value>
@ -99,18 +103,80 @@
<s:String x:Key="animatedTimelinePanelDescription">Defines an area where items are positioned on a timeline.</s:String> <s:String x:Key="animatedTimelinePanelDescription">Defines an area where items are positioned on a timeline.</s:String>
<conv:ComboBoxToVisibilityConverter x:Key="comboBoxToVisibilityConverter" /> <conv:ComboBoxToVisibilityConverter x:Key="comboBoxToVisibilityConverter" />
<!--##EXCLUDE_OPEN_SOURCE-->
<ObjectDataProvider x:Key="dockCombo" MethodName="GetValues" ObjectType="{x:Type s:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="Dock" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<x:Array x:Key="canvasMovePositionCombo" x:Type="view:Coordinates">
<view:Coordinates X="600" Y="0" />
<view:Coordinates X="300" Y="200" />
</x:Array>
<x:Array x:Key="gridCombo" x:Type="view:Coordinates">
<view:Coordinates X="3" Y="2" />
<view:Coordinates X="1" Y="0" />
<view:Coordinates X="0" Y="1" />
</x:Array>
<x:Array x:Key="stakedStackPanelCombo" x:Type="s:Int32">
<s:Int32>2</s:Int32>
<s:Int32>0</s:Int32>
</x:Array>
<x:Array x:Key="relativeLeftTopCombo" x:Type="view:Coordinates">
<view:Coordinates X="0.2" Y="0.7" />
<view:Coordinates X="0.85" Y="0.25" />
</x:Array>
<x:Array x:Key="relativeWidthHeightCombo" x:Type="view:Coordinates">
<view:Coordinates X="{x:Static s:Double.NaN}" Y="{x:Static s:Double.NaN}" />
<view:Coordinates X="0.1" Y="0.5" />
<view:Coordinates X="0.5" Y="0.1" />
</x:Array>
<x:Array x:Key="relativePinPointCombo" x:Type="view:Coordinates">
<view:Coordinates X="0.5" Y="0.5" />
<view:Coordinates X="0" Y="1" />
<view:Coordinates X="1" Y="0" />
</x:Array>
<x:Array x:Key="radialCanvasCenterCombo" x:Type="view:Coordinates">
<view:Coordinates X="0.5" Y="0.5" />
<view:Coordinates X="0.75" Y="0.25" />
<view:Coordinates X="0.2" Y="0.8" />
</x:Array>
<x:Array x:Key="radialCanvasAngleCombo" x:Type="s:Int32">
<s:Int32>45</s:Int32>
<s:Int32>145</s:Int32>
<s:Int32>200</s:Int32>
<s:Int32>300</s:Int32>
</x:Array>
<x:Array x:Key="radialCanvasRadiusCombo" x:Type="s:Int32">
<s:Int32>0</s:Int32>
<s:Int32>50</s:Int32>
<s:Int32>175</s:Int32>
<s:Int32>250</s:Int32>
</x:Array>
<x:Array x:Key="animatedTimelinePanelDatesCombo" x:Type="s:String">
<s:String>1/3/2012 to 1/3/2012</s:String>
<s:String>1/3/2012 to 1/5/2012</s:String>
<s:String>1/5/2012 to 1/5/2012</s:String>
</x:Array>
<ObjectDataProvider x:Key="overlapBehaviorCombo" MethodName="GetValues" ObjectType="{x:Type s:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="panels:OverlapBehaviorKind" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<xctk:InverseBoolConverter x:Key="inverseBoolConverter" />
<!--##END-->
</local:DemoView.Resources> </local:DemoView.Resources>
<Grid> <Grid>
@ -161,6 +227,32 @@
<xctk:SwitchPanel.Layouts> <xctk:SwitchPanel.Layouts>
<xctk:WrapPanel x:Name="_wrapPanel" ItemWidth="100" ItemHeight="100"/> <xctk:WrapPanel x:Name="_wrapPanel" ItemWidth="100" ItemHeight="100"/>
<xctk:RandomPanel x:Name="_randomPanel" /> <xctk:RandomPanel x:Name="_randomPanel" />
<!--##EXCLUDE_OPEN_SOURCE-->
<xctk:Canvas />
<xctk:Carousel x:Name="_carouselPanel" Tilt="70" MaximumRadius="290" MaximumAngularSeparation="45" />
<xctk:DockPanel />
<xctk:Grid x:Name="_grid" ShowGridLines="True">
<xctk:Grid.ColumnDefinitions>
<xctk:ColumnDefinition />
<xctk:ColumnDefinition />
<xctk:ColumnDefinition />
</xctk:Grid.ColumnDefinitions>
<xctk:Grid.RowDefinitions>
<xctk:RowDefinition />
<xctk:RowDefinition />
<xctk:RowDefinition />
<xctk:RowDefinition />
</xctk:Grid.RowDefinitions>
</xctk:Grid>
<xctk:StackPanel x:Name="_stackPanel" Orientation="Horizontal"/>
<xctk:StackedStackPanel x:Name="_stackedStackPanel"/>
<xctk:AutoStretchStackPanel x:Name="_autoStretchStackPanel" />
<xctk:RelativeCanvas />
<xctk:RadialCanvas x:Name="_radialCanvas"/>
<xctk:CameraPanel x:Name="_cameraPanel" CameraX="130" CameraY="140" CameraZ="310"/>
<xctk:PerspectivePanel x:Name="_perspectivePanel" AnchorX="250" AnchorY="50" ShiftX="150" ShiftY="70" AngleOfTwist="-10" DecayConstant="0.2"/>
<xctk:AnimatedTimelinePanel x:Name="_animatedTimeLinePanel" OverlapBehavior="Stretch" BeginDate="1/01/12" EndDate="1/08/12" SwitchLayoutDeactivated="OnAnimatedTimelinePanelDeactivated"/>
<!--##END-->
</xctk:SwitchPanel.Layouts> </xctk:SwitchPanel.Layouts>
<TextBlock x:Name="_item1" Text="Item #1" Style="{StaticResource panelElement}"/> <TextBlock x:Name="_item1" Text="Item #1" Style="{StaticResource panelElement}"/>
<TextBlock x:Name="_item2" Text="Item #2" Style="{StaticResource panelElement}"/> <TextBlock x:Name="_item2" Text="Item #2" Style="{StaticResource panelElement}"/>
@ -172,6 +264,7 @@
<TextBlock x:Name="_item8" Text="Item #8" Style="{StaticResource panelElement}"/> <TextBlock x:Name="_item8" Text="Item #8" Style="{StaticResource panelElement}"/>
</xctk:SwitchPanel> </xctk:SwitchPanel>
<!--##INCLUDE_OPEN_SOURCE
<Image x:Name="_openSourceScreenShot" Grid.Row="2" Height="250" Visibility="Collapsed" /> <Image x:Name="_openSourceScreenShot" Grid.Row="2" Height="250" Visibility="Collapsed" />
<TextBlock x:Name="_openSourceScreenShotDesc" Grid.Row="3" TextWrapping="Wrap" Visibility="Collapsed" /> <TextBlock x:Name="_openSourceScreenShotDesc" Grid.Row="3" TextWrapping="Wrap" Visibility="Collapsed" />
<StackPanel x:Name="_openSourceTextHyperlink" Grid.Row="4" Orientation="Horizontal" Visibility="Collapsed"> <StackPanel x:Name="_openSourceTextHyperlink" Grid.Row="4" Orientation="Horizontal" Visibility="Collapsed">
@ -182,6 +275,7 @@
</Hyperlink> </Hyperlink>
</TextBlock> </TextBlock>
</StackPanel> </StackPanel>
##END-->
<GroupBox Header="WrapPanel Toolbox" <GroupBox Header="WrapPanel Toolbox"
Background="White" Background="White"
@ -327,41 +421,755 @@
</StackPanel> </StackPanel>
</GroupBox> </GroupBox>
<!--##EXCLUDE_OPEN_SOURCE-->
<GroupBox Header="CanvasPanel Toolbox"
Background="White"
Grid.Row="3"
Visibility="{Binding SelectedIndex, ElementName=layoutCombo, Converter={StaticResource comboBoxToVisibilityConverter}, ConverterParameter=2}"
Margin="10" >
<StackPanel>
<TextBlock TextWrapping="Wrap"
Text="{StaticResource canvasPanelDescription}"
Margin="10,0" />
<TextBlock TextWrapping="Wrap"
Text="Use ComboBox to change the coordinates of item #8."
Margin="10,0" />
<Grid Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock Text="Move Item #8 to (X,Y):" VerticalAlignment="Center"/>
<ComboBox Grid.Column="1"
ItemsSource="{Binding Source={StaticResource canvasMovePositionCombo}}"
SelectedIndex="0"
SelectionChanged="OnCanvasMoveItemComboBoxChanged"
Width="100"
Height="22"
VerticalAlignment="Center"
Margin="5" />
</Grid>
</StackPanel>
</GroupBox>
<GroupBox Header="Carousel Toolbox"
Grid.Row="3"
Background="White"
Visibility="{Binding SelectedIndex, ElementName=layoutCombo, Converter={StaticResource comboBoxToVisibilityConverter}, ConverterParameter=3}"
Margin="10" >
<StackPanel>
<TextBlock TextWrapping="Wrap"
Text="{StaticResource carouselDescription}"
Margin="10,0" />
<Grid Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="100" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="100" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<!--First Column-->
<TextBlock Text="Orientation:" VerticalAlignment="Center"/>
<ComboBox Grid.Column="1"
ItemsSource="{Binding Source={StaticResource orientationCombo}}"
SelectedItem="{Binding Orientation, ElementName=_carouselPanel}"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Grid.Row="1" Text="Are Children Scaled:" VerticalAlignment="Center"/>
<CheckBox Grid.Row="1"
Grid.Column="1"
IsChecked="{Binding AreChildrenScaled, ElementName=_carouselPanel}"
ClickMode="Press"
VerticalAlignment="Center"
Margin="5"/>
<TextBlock Grid.Row="2" Text="Distant Child Scale:" VerticalAlignment="Center"/>
<Slider Grid.Column="1"
Grid.Row="2"
Value="{Binding DistantChildScale, ElementName=_carouselPanel}"
Minimum="-2"
Maximum="2"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Grid.Row="3" Text="Tilt:" VerticalAlignment="Center"/>
<Slider Grid.Column="1"
Grid.Row="3"
Minimum="-180"
Maximum="180"
Value="{Binding Tilt, ElementName=_carouselPanel}"
VerticalAlignment="Center"
Margin="5" />
<!--Second Column-->
<TextBlock Grid.Column="2" Text="Maximum Angular Separation:" VerticalAlignment="Center" Margin="25,0,0,0"/>
<Slider Grid.Column="3"
Value="{Binding MaximumAngularSeparation, ElementName=_carouselPanel}"
Minimum="0"
Maximum="45"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Grid.Row="1" Grid.Column="2" Text="Maximum Radius:" VerticalAlignment="Center" Margin="25,0,0,0"/>
<Slider Grid.Column="3"
Grid.Row="1"
Value="{Binding MaximumRadius, ElementName=_carouselPanel}"
Minimum="-290"
Maximum="290"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Grid.Row="2" Grid.Column="2" Text="Angular Extent:" VerticalAlignment="Center" Margin="25,0,0,0"/>
<Slider Grid.Column="3"
Grid.Row="2"
Value="{Binding AngularExtent, ElementName=_carouselPanel}"
Minimum="0"
Maximum="360"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Grid.Row="3" Grid.Column="2" Text="Angular Offset:" VerticalAlignment="Center" Margin="25,0,0,0"/>
<Slider Grid.Column="3"
Grid.Row="3"
Minimum="0"
Maximum="360"
Value="{Binding AngularOffset, ElementName=_carouselPanel}"
VerticalAlignment="Center"
Margin="5" />
</Grid>
</StackPanel>
</GroupBox>
<GroupBox Header="DockPanel Toolbox"
Grid.Row="3"
Background="White"
Visibility="{Binding SelectedIndex, ElementName=layoutCombo, Converter={StaticResource comboBoxToVisibilityConverter}, ConverterParameter=4}"
Margin="10" >
<StackPanel>
<TextBlock TextWrapping="Wrap"
Text="{StaticResource dockPanelDescription}"
Margin="10,0" />
<TextBlock TextWrapping="Wrap"
Text="Use ComboBox to dock item #2."
Margin="10,0" />
<Grid Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock Text="Dock Item #2 to:" VerticalAlignment="Center" Margin="5"/>
<ComboBox Grid.Column="1"
ItemsSource="{Binding Source={StaticResource dockCombo}}"
SelectedIndex="0"
SelectionChanged="OnDockComboBoxChanged"
Width="100"
Height="22"
VerticalAlignment="Center"
Margin="5" />
</Grid>
</StackPanel>
</GroupBox>
<GroupBox Header="Grid Toolbox"
Grid.Row="3"
Background="White"
Visibility="{Binding SelectedIndex, ElementName=layoutCombo, Converter={StaticResource comboBoxToVisibilityConverter}, ConverterParameter=5}"
Margin="10" >
<StackPanel>
<TextBlock TextWrapping="Wrap"
Text="{StaticResource gridDescription}"
Margin="10,0" />
<TextBlock TextWrapping="Wrap"
Text="Use the ComboBox to change the row and column of item #4."
Margin="10,0" />
<Grid Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<TextBlock Text="Show Grid Lines:" VerticalAlignment="Center"/>
<CheckBox Grid.Column="1"
IsChecked="{Binding ShowGridLines, ElementName=_grid}"
Margin="5" />
<TextBlock Grid.Row="1" Text="Move Item #4 to:" VerticalAlignment="Center"/>
<ComboBox Grid.Row="1"
Grid.Column="1"
ItemsSource="{Binding Source={StaticResource gridCombo}}"
SelectedIndex="0"
SelectionChanged="OnGridComboBoxChanged"
Width="100"
Height="22"
VerticalAlignment="Center"
Margin="5" />
</Grid>
</StackPanel>
</GroupBox>
<GroupBox Header="StackPanel Toolbox"
Grid.Row="3"
Background="White"
Visibility="{Binding SelectedIndex, ElementName=layoutCombo, Converter={StaticResource comboBoxToVisibilityConverter}, ConverterParameter=6}"
Margin="10" >
<StackPanel>
<TextBlock TextWrapping="Wrap"
Text="{StaticResource stackPanelDescription}"
Margin="10,0" />
<Grid Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock Text="Orientation:" VerticalAlignment="Center"/>
<ComboBox Grid.Column="1"
ItemsSource="{Binding Source={StaticResource orientationCombo}}"
SelectedItem="{Binding Orientation, ElementName=_stackPanel}"
Width="100"
Height="22"
VerticalAlignment="Center"
Margin="5" />
</Grid>
</StackPanel>
</GroupBox>
<GroupBox Header="StackedStackPanel Toolbox"
Grid.Row="3"
Background="White"
Visibility="{Binding SelectedIndex, ElementName=layoutCombo, Converter={StaticResource comboBoxToVisibilityConverter}, ConverterParameter=7}"
Margin="10" >
<StackPanel>
<TextBlock TextWrapping="Wrap"
Text="{StaticResource stackedStackPanelDescription}"
Margin="10,0" />
<TextBlock TextWrapping="Wrap"
Text="Use the ComboBox to move Item #5 from stack to stack."
Margin="10,0" />
<Grid Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock Text="Orientation:" VerticalAlignment="Center"/>
<ComboBox Grid.Column="1"
ItemsSource="{Binding Source={StaticResource orientationCombo}}"
SelectedItem="{Binding Orientation, ElementName=_stackedStackPanel}"
Width="100"
Height="22"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Grid.Row="1" Text="Move Item #5 to Stack: " VerticalAlignment="Center"/>
<ComboBox Grid.Column="1"
Grid.Row="1"
ItemsSource="{Binding Source={StaticResource stakedStackPanelCombo}}"
SelectedIndex="0"
SelectionChanged="OnStackedStackComboBoxChanged"
Width="100"
Height="22"
VerticalAlignment="Center"
Margin="2" />
<TextBlock Grid.Column="2" Text="Default Stack Length:" VerticalAlignment="Center" Margin="20,0,0,0"/>
<xctk:DoubleUpDown Grid.Column="3"
Value="NaN"
ValueChanged="OnStackedStackPanelStackLengthChanged"
AllowInputSpecialValues="NaN"
Minimum="0"
Maximum="250"
Width="100"
VerticalAlignment="Center"
Margin="5" />
</Grid>
</StackPanel>
</GroupBox>
<GroupBox Header="AutoStretchStackPanel Toolbox"
Grid.Row="3"
Background="White"
Visibility="{Binding SelectedIndex, ElementName=layoutCombo, Converter={StaticResource comboBoxToVisibilityConverter}, ConverterParameter=8}"
Margin="10" >
<StackPanel>
<TextBlock TextWrapping="Wrap"
Text="{StaticResource autoStretchStackPanelDescription}"
Margin="10,0" />
<Grid Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBlock Text="Orientation:" VerticalAlignment="Center"/>
<ComboBox Grid.Column="1"
ItemsSource="{Binding Source={StaticResource orientationCombo}}"
SelectedItem="{Binding Orientation, ElementName=_autoStretchStackPanel}"
Width="100"
Height="22"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Text="Gap Ratio:" Grid.Row="1" VerticalAlignment="Center"/>
<xctk:DoubleUpDown Grid.Row="1"
Grid.Column="1"
Value="{Binding GapRatio, ElementName=_autoStretchStackPanel}"
AllowInputSpecialValues="None"
Increment="0.5"
Minimum="0"
Maximum="5"
Style="{StaticResource controlInError}"
Width="100"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Text="Is Children Reversed:" Grid.Column="2" VerticalAlignment="Center" Margin="25,0,0,0"/>
<CheckBox Grid.Column="3"
IsChecked="{Binding IsChildOrderReversed, ElementName=_autoStretchStackPanel}"
VerticalAlignment="Center"
Margin="5" />
</Grid>
</StackPanel>
</GroupBox>
<GroupBox Header="RelativeCanvas Toolbox"
Grid.Row="3"
Background="White"
Visibility="{Binding SelectedIndex, ElementName=layoutCombo, Converter={StaticResource comboBoxToVisibilityConverter}, ConverterParameter=9}"
Margin="10" >
<StackPanel>
<TextBlock TextWrapping="Wrap"
Text="{StaticResource relativeCanvasDescription}"
Margin="10,0" />
<TextBlock TextWrapping="Wrap"
Text="Click on ComboBoxes to modify left, top, width, height, and pinPoint of item #6 relative to the panel."
Margin="10,0" />
<Grid Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Text="Move Item #6 with Relative (Left,Top):" VerticalAlignment="Center"/>
<ComboBox Grid.Column="1"
ItemsSource="{Binding Source={StaticResource relativeLeftTopCombo}}"
SelectedIndex="0"
SelectionChanged="OnRelativeLeftTopComboBoxChanged"
Width="100"
Height="22"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Text="Use Item #6 with Relative (Width,Height):" Grid.Row="1" VerticalAlignment="Center"/>
<ComboBox Grid.Column="1"
Grid.Row="1"
ItemsSource="{Binding Source={StaticResource relativeWidthHeightCombo}}"
SelectedIndex="0"
SelectionChanged="OnRelativeWidthHeightComboBoxChanged"
Width="100"
Height="22"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Text="Change Item #6 pinPoint (X,Y):" Grid.Column="2" VerticalAlignment="Center" Margin="20,0,0,0"/>
<ComboBox Grid.Column="3"
ItemsSource="{Binding Source={StaticResource relativePinPointCombo}}"
SelectedIndex="0"
SelectionChanged="OnRelativePinPointComboBoxChanged"
Width="100"
Height="22"
VerticalAlignment="Center"
Margin="5" />
</Grid>
</StackPanel>
</GroupBox>
<GroupBox Header="RadialCanvas Toolbox"
Grid.Row="3"
Background="White"
Visibility="{Binding SelectedIndex, ElementName=layoutCombo, Converter={StaticResource comboBoxToVisibilityConverter}, ConverterParameter=10}"
Margin="10" >
<StackPanel>
<TextBlock TextWrapping="Wrap"
Text="{StaticResource radialCanvasDescription}"
Margin="10,0" />
<TextBlock TextWrapping="Wrap"
Text="Use the ComboBoxes to modify the angle, radius, and pinPoint of Item #7."
Margin="10,0" />
<Grid Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Text="Is Auto Arrange:" VerticalAlignment="Center"/>
<CheckBox x:Name="_autoArrangeCheckBox"
Grid.Column="1"
IsChecked="{Binding IsAutoArrange, ElementName=_radialCanvas}"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Grid.Row="1" Text="Center (X,Y):" VerticalAlignment="Center"/>
<ComboBox Grid.Column="1"
Grid.Row="1"
ItemsSource="{Binding Source={StaticResource radialCanvasCenterCombo}}"
SelectedIndex="0"
SelectionChanged="OnRadialCanvasCenterComboBoxChanged"
Width="100"
Height="22"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Grid.Column="2" Text="Angle for item #7:" VerticalAlignment="Center" Margin="20,0,0,0" IsEnabled="{Binding IsEnabled, ElementName=_radialAngleComboBox}" Style="{StaticResource DisableGrayText}"/>
<ComboBox x:Name="_radialAngleComboBox"
Grid.Column="3"
ItemsSource="{Binding Source={StaticResource radialCanvasAngleCombo}}"
SelectedIndex="2"
SelectionChanged="OnRadialCanvasAngleComboBoxChanged"
IsEnabled="{Binding IsChecked, ElementName=_autoArrangeCheckBox, Converter={StaticResource inverseBoolConverter}}"
Width="100"
Height="22"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Grid.Column="2" Grid.Row="1" Text="Radius for item #7:" VerticalAlignment="Center" Margin="20,0,0,0" IsEnabled="{Binding IsEnabled, ElementName=_radialRadiusComboBox}" Style="{StaticResource DisableGrayText}"/>
<ComboBox x:Name="_radialRadiusComboBox"
Grid.Column="3"
Grid.Row="1"
ItemsSource="{Binding Source={StaticResource radialCanvasRadiusCombo}}"
SelectedIndex="2"
SelectionChanged="OnRadialCanvasRadiusComboBoxChanged"
IsEnabled="{Binding IsChecked, ElementName=_autoArrangeCheckBox, Converter={StaticResource inverseBoolConverter}}"
Width="100"
Height="22"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Grid.Column="2" Grid.Row="2" Text="PinPoint for item #7:" VerticalAlignment="Center" Margin="20,0,0,0"/>
<ComboBox Grid.Column="3"
Grid.Row="2"
ItemsSource="{Binding Source={StaticResource relativePinPointCombo}}"
SelectedIndex="0"
SelectionChanged="OnRadialCanvasPinPointComboBoxChanged"
Width="100"
Height="22"
VerticalAlignment="Center"
Margin="5" />
</Grid>
</StackPanel>
</GroupBox>
<GroupBox Header="CameraPanel Toolbox"
Grid.Row="3"
Background="White"
Visibility="{Binding SelectedIndex, ElementName=layoutCombo, Converter={StaticResource comboBoxToVisibilityConverter}, ConverterParameter=11}"
Margin="10" >
<StackPanel>
<TextBlock TextWrapping="Wrap"
Text="{StaticResource cameraPanelDescription}"
Margin="10,0" />
<Grid Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="150"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="150"/>
</Grid.ColumnDefinitions>
<TextBlock Text="Camera X:" VerticalAlignment="Center"/>
<Slider Grid.Column="1"
Value="{Binding CameraX, ElementName=_cameraPanel}"
Minimum="0"
Maximum="400"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Text="Camera Y:" Grid.Row="1" VerticalAlignment="Center"/>
<Slider Grid.Column="1"
Grid.Row="1"
Value="{Binding CameraY, ElementName=_cameraPanel}"
Minimum="0"
Maximum="300"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Text="Camera Z:" Grid.Row="2" VerticalAlignment="Center"/>
<Slider Grid.Column="1"
Grid.Row="2"
Value="{Binding CameraZ, ElementName=_cameraPanel}"
Minimum="0"
Maximum="500"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Text="Z Scale Factor:" Grid.Row="3" VerticalAlignment="Center"/>
<Slider Grid.Column="1"
Grid.Row="3"
Value="{Binding ZScaleFactor, ElementName=_cameraPanel}"
Minimum="1"
Maximum="400"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Grid.Column="2" Text="Position X for item #3:" VerticalAlignment="Center" Margin="20,0,0,0"/>
<Slider Grid.Column="3"
Value="{Binding (xctk:CameraPanel.Left), ElementName=_item3}"
Minimum="0"
Maximum="400"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Grid.Column="2" Grid.Row="1" Text="Position Y for item #3:" VerticalAlignment="Center" Margin="20,0,0,0"/>
<Slider Grid.Column="3"
Grid.Row="1"
Value="{Binding (xctk:CameraPanel.Top), ElementName=_item3}"
Minimum="0"
Maximum="300"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Grid.Column="2" Grid.Row="2" Text="Position Z for item #3:" VerticalAlignment="Center" Margin="20,0,0,0"/>
<Slider Grid.Column="3"
Grid.Row="2"
Value="{Binding (xctk:CameraPanel.Depth), ElementName=_item3}"
Minimum="0"
Maximum="300"
VerticalAlignment="Center"
Margin="5" />
</Grid>
</StackPanel>
</GroupBox>
<GroupBox Header="PerspectivePanel Toolbox"
Grid.Row="3"
Background="White"
Visibility="{Binding SelectedIndex, ElementName=layoutCombo, Converter={StaticResource comboBoxToVisibilityConverter}, ConverterParameter=12}"
Margin="10" >
<StackPanel>
<TextBlock TextWrapping="Wrap"
Text="{StaticResource perspectivePanelDescription}"
Margin="10,0" />
<Grid Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="100"/>
</Grid.ColumnDefinitions>
<!--First Colummn -->
<TextBlock Text="Active Child Index:" VerticalAlignment="Center"/>
<xctk:IntegerUpDown Grid.Column="1"
Value="{Binding ActiveChildIndex, ElementName=_perspectivePanel}"
Minimum="0"
Maximum="7"
Style="{StaticResource controlInError}"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Text="Anchor X:" Grid.Row="1" VerticalAlignment="Center"/>
<Slider Grid.Column="1"
Grid.Row="1"
Value="{Binding AnchorX, ElementName=_perspectivePanel}"
Minimum="0"
Maximum="500"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Text="Anchor Y:" Grid.Row="2" VerticalAlignment="Center"/>
<Slider Grid.Column="1"
Grid.Row="2"
Value="{Binding AnchorY, ElementName=_perspectivePanel}"
Minimum="0"
Maximum="200"
VerticalAlignment="Center"
Margin="5" />
<!--Second Column -->
<TextBlock Text="Angle of Twist:" Grid.Column="2" VerticalAlignment="Center" Margin="15,0,0,0"/>
<Slider Grid.Column="3"
Value="{Binding AngleOfTwist, ElementName=_perspectivePanel}"
Minimum="-50"
Maximum="50"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Text="Shift X:" Grid.Column="2" Grid.Row="1" VerticalAlignment="Center" Margin="15,0,0,0"/>
<Slider Grid.Column="3"
Grid.Row="1"
Value="{Binding ShiftX, ElementName=_perspectivePanel}"
Minimum="0"
Maximum="350"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Text="Shift Y:" Grid.Column="2" Grid.Row="2" VerticalAlignment="Center" Margin="15,0,0,0"/>
<Slider Grid.Column="3"
Grid.Row="2"
Value="{Binding ShiftY, ElementName=_perspectivePanel}"
Minimum="0"
Maximum="200"
VerticalAlignment="Center"
Margin="5" />
<!--Third Column-->
<TextBlock Text="Decay Constant:" Grid.Column="4" VerticalAlignment="Center" Margin="15,0,0,0"/>
<Slider Grid.Column="5"
Value="{Binding DecayConstant, ElementName=_perspectivePanel}"
Minimum="0"
Maximum="1.5"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Text="Scale Factor X:" Grid.Row="1" Grid.Column="4" VerticalAlignment="Center" Margin="15,0,0,0"/>
<Slider Grid.Column="5"
Grid.Row="1"
Value="{Binding ScaleFactorX, ElementName=_perspectivePanel}"
Minimum="0"
Maximum="1.25"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Text="Scale Factor Y:" Grid.Row="2" Grid.Column="4" VerticalAlignment="Center" Margin="15,0,0,0"/>
<Slider Grid.Column="5"
Grid.Row="2"
Value="{Binding ScaleFactorY, ElementName=_perspectivePanel}"
Minimum="0"
Maximum="1.25"
VerticalAlignment="Center"
Margin="5" />
</Grid>
</StackPanel>
</GroupBox>
<GroupBox Header="AnimatedTimeLinePanel Toolbox"
Grid.Row="3"
Background="White"
Visibility="{Binding SelectedIndex, ElementName=layoutCombo, Converter={StaticResource comboBoxToVisibilityConverter}, ConverterParameter=13}"
Margin="10" >
<StackPanel>
<TextBlock TextWrapping="Wrap"
Text="{StaticResource animatedTimelinePanelDescription}"
Margin="10,0" />
<TextBlock TextWrapping="Wrap"
Text="Change the position of Item #2 with the ComboBox."
Margin="10,0" />
<Grid Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<!--First Colummn -->
<TextBlock Text="Orientation:" VerticalAlignment="Center"/>
<ComboBox Grid.Column="1"
ItemsSource="{Binding Source={StaticResource orientationCombo}}"
SelectedItem="{Binding Orientation, ElementName=_animatedTimeLinePanel}"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Text="Begin Date:" Grid.Row="1" VerticalAlignment="Center"/>
<DatePicker Grid.Column="1"
Grid.Row="1"
SelectedDate="{Binding BeginDate, ElementName=_animatedTimeLinePanel}"
DisplayDateStart="1/01/12"
DisplayDateEnd="1/07/12"
SelectedDateFormat="Short"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Text="End Date:" Grid.Row="2" VerticalAlignment="Center"/>
<DatePicker Grid.Column="1"
Grid.Row="2"
SelectedDate="{Binding EndDate, ElementName=_animatedTimeLinePanel}"
DisplayDateStart="1/01/12"
DisplayDateEnd="1/07/12"
SelectedDateFormat="Short"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Text="Overlap Behavior:" Grid.Row="3" VerticalAlignment="Center"/>
<ComboBox Grid.Column="1"
Grid.Row="3"
ItemsSource="{Binding Source={StaticResource overlapBehaviorCombo}}"
SelectedItem="{Binding OverlapBehavior, ElementName=_animatedTimeLinePanel}"
VerticalAlignment="Center"
Margin="5" />
<!--Second Colummn -->
<TextBlock Text="Keep Original Order For Overlap:" Grid.Column="2" VerticalAlignment="Center" Margin="25,0,0,0"/>
<CheckBox Grid.Column="3"
IsChecked="{Binding KeepOriginalOrderForOverlap, ElementName=_animatedTimeLinePanel}"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Text="Unit Size:" Grid.Column="2" Grid.Row="1" VerticalAlignment="Center" Margin="25,0,0,0" IsEnabled="{Binding Value, ElementName=_unitTimeSpan}" Style="{StaticResource DisableGrayText}"/>
<xctk:DoubleUpDown Grid.Column="3"
Grid.Row="1"
Value="{Binding UnitSize, ElementName=_animatedTimeLinePanel}"
AllowInputSpecialValues="NaN"
Minimum="0"
Maximum="200"
IsEnabled="{Binding Value, ElementName=_unitTimeSpan}"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Text="Unit Time Span (Days):" Grid.Column="2" Grid.Row="2" VerticalAlignment="Center" Margin="25,0,0,0"/>
<xctk:IntegerUpDown x:Name="_unitTimeSpan"
Grid.Column="3"
Grid.Row="2"
Value="0"
ValueChanged="OnAnimatedTimelineUnitTimeSpanChanged"
Minimum="0"
Maximum="7"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Text="Change Item #2 Dates:" Grid.Column="2" Grid.Row="3" VerticalAlignment="Center" Margin="25,0,0,0"/>
<ComboBox Grid.Column="3"
Grid.Row="3"
ItemsSource="{StaticResource animatedTimelinePanelDatesCombo}"
SelectedIndex="0"
SelectionChanged="OnAnimatedTimelineDatesChanged"
VerticalAlignment="Center"
Margin="5" />
</Grid>
</StackPanel>
</GroupBox>
<!--##END-->
</Grid> </Grid>
</Grid> </Grid>
</local:DemoView> </local:DemoView>

129
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingAvalonDockView.xaml.cs.txt

@ -27,6 +27,11 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation; using System.Windows.Navigation;
using System.Windows.Shapes; using System.Windows.Shapes;
using System.IO; using System.IO;
#if !OPEN_SOURCE
using Xceed.Wpf.Themes.Metro;
using System.Diagnostics;
using Xceed.Wpf.Themes.Office2007;
#endif
namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Theming.Views namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Theming.Views
{ {
@ -35,8 +40,13 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Theming.Views
/// </summary> /// </summary>
public partial class ThemingAvalonDockView : DemoView public partial class ThemingAvalonDockView : DemoView
{ {
#if !OPEN_SOURCE
#region Members
private Brush _accentBrush = new SolidColorBrush( System.Windows.Media.Color.FromRgb( 255, 152, 29 ) );
#endregion
#endif
#region constructors #region constructors
@ -54,10 +64,18 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Theming.Views
{ {
AvalonDockComboBoxItem comboBoxItem = sender as AvalonDockComboBoxItem; AvalonDockComboBoxItem comboBoxItem = sender as AvalonDockComboBoxItem;
#if OPEN_SOURCE
if( comboBoxItem != null ) if( comboBoxItem != null )
{ {
this.SetOpenSourceImage( comboBoxItem ); this.SetOpenSourceImage( comboBoxItem );
} }
#else
this.SetInternalControlsTheme( comboBoxItem );
if( _accentColorPanel != null )
{
_accentColorPanel.Visibility = Visibility.Hidden;
}
#endif
} }
private void AvalonDockControlsThemes_Initialized( object sender, EventArgs e ) private void AvalonDockControlsThemes_Initialized( object sender, EventArgs e )
@ -68,24 +86,68 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Theming.Views
private void MetroComboBoxItem_Selected( object sender, RoutedEventArgs e ) private void MetroComboBoxItem_Selected( object sender, RoutedEventArgs e )
{ {
AvalonDockComboBoxItem comboBoxItem = sender as AvalonDockComboBoxItem; AvalonDockComboBoxItem comboBoxItem = sender as AvalonDockComboBoxItem;
#if OPEN_SOURCE
if( comboBoxItem != null ) if( comboBoxItem != null )
{ {
this.SetOpenSourceImage( comboBoxItem ); this.SetOpenSourceImage( comboBoxItem );
} }
#else
this.SetInternalControlsTheme( comboBoxItem );
if( comboBoxItem != null )
{
comboBoxItem.Tag = this.GetAvalonDockMetroTheme( ( comboBoxItem.ThemeEnum == AvalonDockThemesEnum.MetroDark )
? new Xceed.Wpf.AvalonDock.Themes.MetroAccent.AvalonDockMetroDarkThemeResourceDictionary() as MetroThemeResourceDictionaryBase
: new Xceed.Wpf.AvalonDock.Themes.MetroAccent.AvalonDockMetroLightThemeResourceDictionary() as MetroThemeResourceDictionaryBase );
}
#endif
} }
#if !OPEN_SOURCE
private void RadioButton_Checked( object sender, RoutedEventArgs e )
{
RadioButton button = sender as RadioButton;
if( button == null )
return;
_accentBrush = button.Background;
if( _accentBrush == null )
return;
AvalonDockComboBoxItem comboBoxItem = _themeCombo.SelectedItem as AvalonDockComboBoxItem;
if( comboBoxItem != null )
{
this.SetInternalControlsTheme( comboBoxItem );
if( comboBoxItem.ThemeEnum == AvalonDockThemesEnum.MetroDark )
{
metroDarkComboBoxItem.Tag = this.GetAvalonDockMetroTheme( new Xceed.Wpf.AvalonDock.Themes.MetroAccent.AvalonDockMetroDarkThemeResourceDictionary() );
}
else if( comboBoxItem.ThemeEnum == AvalonDockThemesEnum.MetroLight )
{
metroLightComboBoxItem.Tag = this.GetAvalonDockMetroTheme( new Xceed.Wpf.AvalonDock.Themes.MetroAccent.AvalonDockMetroLightThemeResourceDictionary() );
}
}
}
private Xceed.Wpf.AvalonDock.Themes.MetroAccentTheme GetAvalonDockMetroTheme( MetroThemeResourceDictionaryBase metroThemeResourceDictionary )
{
if( _accentColorPanel != null )
{
_accentColorPanel.Visibility = Visibility.Visible;
}
metroThemeResourceDictionary.AccentBrush = _accentBrush;
return new Xceed.Wpf.AvalonDock.Themes.MetroAccentTheme( metroThemeResourceDictionary );
}
#endif
#endregion #endregion
#region private Methods #region private Methods
#if OPEN_SOURCE
private void SetOpenSourceImage( AvalonDockComboBoxItem comboBoxItem ) private void SetOpenSourceImage( AvalonDockComboBoxItem comboBoxItem )
{ {
@ -137,10 +199,77 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Theming.Views
} }
} }
#else
private void SetInternalControlsTheme( AvalonDockComboBoxItem comboBoxItem )
{
if( ( comboBoxItem == null ) || ( SampleBorder == null ) )
return;
SampleBorder.Resources.MergedDictionaries.Clear();
if( comboBoxItem != null )
{
switch( comboBoxItem.ThemeEnum )
{
case AvalonDockThemesEnum.Generic:
case AvalonDockThemesEnum.Aero:
case AvalonDockThemesEnum.VS2010:
case AvalonDockThemesEnum.Metro:
break;
case AvalonDockThemesEnum.Office2007Black:
Office2007BlackResourceDictionary office2007Black = new Xceed.Wpf.Themes.Office2007.Office2007BlackResourceDictionary();
if( !string.IsNullOrEmpty( Xceed.Wpf.Toolkit.Licenser.LicenseKey ) )
{
office2007Black.LicenseKey = Xceed.Wpf.Toolkit.Licenser.LicenseKey;
}
SampleBorder.Resources.MergedDictionaries.Add( office2007Black );
SampleBorder.Resources.MergedDictionaries.Add( new Xceed.Wpf.Toolkit.Themes.Office2007.Office2007BlackResourceDictionary() );
break;
case AvalonDockThemesEnum.Office2007Blue:
Office2007BlueResourceDictionary office2007Blue = new Xceed.Wpf.Themes.Office2007.Office2007BlueResourceDictionary();
if( !string.IsNullOrEmpty( Xceed.Wpf.Toolkit.Licenser.LicenseKey ) )
{
office2007Blue.LicenseKey = Xceed.Wpf.Toolkit.Licenser.LicenseKey;
}
SampleBorder.Resources.MergedDictionaries.Add( office2007Blue );
SampleBorder.Resources.MergedDictionaries.Add( new Xceed.Wpf.Toolkit.Themes.Office2007.Office2007BlueResourceDictionary() );
break;
case AvalonDockThemesEnum.Office2007Silver:
Office2007SilverResourceDictionary office2007Silver = new Xceed.Wpf.Themes.Office2007.Office2007SilverResourceDictionary();
if( !string.IsNullOrEmpty( Xceed.Wpf.Toolkit.Licenser.LicenseKey ) )
{
office2007Silver.LicenseKey = Xceed.Wpf.Toolkit.Licenser.LicenseKey;
}
SampleBorder.Resources.MergedDictionaries.Add( office2007Silver );
SampleBorder.Resources.MergedDictionaries.Add( new Xceed.Wpf.Toolkit.Themes.Office2007.Office2007SilverResourceDictionary() );
break;
case AvalonDockThemesEnum.MetroDark:
MetroDarkThemeResourceDictionary darkTheme = new Xceed.Wpf.Themes.Metro.MetroDarkThemeResourceDictionary( _accentBrush );
if( !string.IsNullOrEmpty( Xceed.Wpf.Toolkit.Licenser.LicenseKey ) )
{
darkTheme.LicenseKey = Xceed.Wpf.Toolkit.Licenser.LicenseKey;
}
SampleBorder.Resources.MergedDictionaries.Add( darkTheme );
SampleBorder.Resources.MergedDictionaries.Add( new Xceed.Wpf.Toolkit.Themes.Metro.ToolkitMetroDarkThemeResourceDictionary( _accentBrush ) );
break;
case AvalonDockThemesEnum.MetroLight:
MetroLightThemeResourceDictionary lightTheme = new Xceed.Wpf.Themes.Metro.MetroLightThemeResourceDictionary( _accentBrush );
if( !string.IsNullOrEmpty( Xceed.Wpf.Toolkit.Licenser.LicenseKey ) )
{
lightTheme.LicenseKey = Xceed.Wpf.Toolkit.Licenser.LicenseKey;
}
SampleBorder.Resources.MergedDictionaries.Add( lightTheme );
SampleBorder.Resources.MergedDictionaries.Add( new Xceed.Wpf.Toolkit.Themes.Metro.ToolkitMetroLightThemeResourceDictionary( _accentBrush ) );
break;
default:
Debug.Assert( false, "Unknown theme" );
break;
}
}
}
#endif
#endregion #endregion
} }

352
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingAvalonDockView.xaml.txt

@ -28,18 +28,143 @@
FontFamily="Segoe"> FontFamily="Segoe">
<!--//# TODODOC --> <!--//# TODODOC -->
<Run>Changes the themes of the AvalonDock controls. Available themes are System, Aero, VS2010, Metro, Office2007 and Metro with accent color. The Xceed.Wpf.AvalonDock.Themes.xxx.dll assemblies are necessary to use the themes.</Run> <Run>Changes the themes of the AvalonDock controls. Available themes are System, Aero, VS2010, Metro, Office2007 and Metro with accent color. The Xceed.Wpf.AvalonDock.Themes.xxx.dll assemblies are necessary to use the themes.</Run>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<Run>Some features of this sample are only available in the "Plus" version.</Run> <Run>Some features of this sample are only available in the "Plus" version.</Run>
<LineBreak /> <LineBreak />
<Hyperlink NavigateUri="http://www.xceed.com/Extended_WPF_Toolkit_Intro.html" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="http://www.xceed.com/Extended_WPF_Toolkit_Intro.html" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Extended WPF Toolkit Plus. Click here for more details about Xceed Extended WPF Toolkit Plus.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
<local:DemoView.Resources> <local:DemoView.Resources>
<!--##EXCLUDE_OPEN_SOURCE-->
<LinearGradientBrush x:Key="customAccentBrush1"
EndPoint="0.5,1"
StartPoint="0.5,0">
<GradientStop Color="#FF0086c6"
Offset="0" />
<GradientStop Color="#FF66ccff"
Offset="0.94" />
<GradientStop Color="#FFddf4ff"
Offset="0.94" />
<GradientStop Color="#FFddf4ff"
Offset="0.97" />
<GradientStop Color="#FFddf4ff"
Offset="1" />
</LinearGradientBrush>
<LinearGradientBrush x:Key="customAccentBrush2"
EndPoint="0.5,1"
StartPoint="0.5,0">
<GradientStop Color="#FFff0099"
Offset="0" />
<GradientStop Color="#FF993366"
Offset="1" />
</LinearGradientBrush>
<LinearGradientBrush x:Key="customAccentBrush3"
EndPoint="0.5,1"
StartPoint="0.5,0">
<GradientStop Color="#FF9DE214"
Offset="0" />
<GradientStop Color="#FF9DE214"
Offset="0.2" />
<GradientStop Color="#FF95CA2A"
Offset="0.2" />
<GradientStop Color="#FF339933"
Offset="1" />
</LinearGradientBrush>
<Style x:Key="MetroSampleRadioButtonTemplate"
TargetType="RadioButton">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RadioButton">
<Grid>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualStateGroup.Transitions>
<VisualTransition GeneratedDuration="0:0:0.2" />
<VisualTransition From="Normal"
GeneratedDuration="0"
To="Pressed">
<Storyboard>
<DoubleAnimation Duration="0"
To="0.45"
Storyboard.TargetProperty="(UIElement.Opacity)"
Storyboard.TargetName="rectangle" />
</Storyboard>
</VisualTransition>
</VisualStateGroup.Transitions>
<VisualState x:Name="Normal" />
<VisualState x:Name="MouseOver">
<Storyboard>
<DoubleAnimation Duration="0"
To="0.35"
Storyboard.TargetProperty="(UIElement.Opacity)"
Storyboard.TargetName="rectangle" />
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<DoubleAnimation Duration="0"
To="0.35"
Storyboard.TargetProperty="(UIElement.Opacity)"
Storyboard.TargetName="rectangle" />
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled">
<Storyboard>
<DoubleAnimation Duration="0"
To=".2"
Storyboard.TargetProperty="(UIElement.Opacity)"
Storyboard.TargetName="content" />
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="CheckStates">
<VisualStateGroup.Transitions>
<VisualTransition GeneratedDuration="0:0:0.2" />
</VisualStateGroup.Transitions>
<VisualState x:Name="Checked">
<Storyboard>
<DoubleAnimation Duration="0"
To="1"
Storyboard.TargetProperty="(UIElement.Opacity)"
Storyboard.TargetName="CheckIcon" />
</Storyboard>
</VisualState>
<VisualState x:Name="Unchecked" />
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Rectangle x:Name="content"
Width="20"
Height="20"
Fill="{TemplateBinding Background}" />
<Path x:Name="CheckIcon"
Data="M 619,736 C619,736 617,738 617,738 617,738 621,742 621,742 621,742 629,732 629,732 629,732 627,730 627,730 627,730 621,738 621,738 621,738 619,736 619,736 z"
Fill="White"
FlowDirection="LeftToRight"
Opacity="0"
Stretch="Fill"
UseLayoutRounding="False"
VerticalAlignment="Bottom"
HorizontalAlignment="Right"
Width="12"
Height="12"
Margin="0,0,1,1" />
<Rectangle x:Name="rectangle"
Fill="White"
Opacity="0" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<Style x:Key="plusSuffix" TargetType="TextBlock"> <Style x:Key="plusSuffix" TargetType="TextBlock">
<Setter Property="Margin" Value="5,0,0,0"/> <Setter Property="Margin" Value="5,0,0,0"/>
<Setter Property="Text" Value="Plus Only"/> <Setter Property="Text" Value="Plus Only"/>
@ -53,6 +178,7 @@
</DataTrigger> </DataTrigger>
</Style.Triggers> </Style.Triggers>
</Style> </Style>
##END-->
<Style x:Key="plusItem" <Style x:Key="plusItem"
TargetType="ComboBoxItem"> TargetType="ComboBoxItem">
@ -64,7 +190,9 @@
<DockPanel> <DockPanel>
<TextBlock DockPanel.Dock="Left" <TextBlock DockPanel.Dock="Left"
Text="{Binding}" /> Text="{Binding}" />
<!--##INCLUDE_OPEN_SOURCE
<TextBlock TextAlignment="Right" Style="{StaticResource plusSuffix}" /> <TextBlock TextAlignment="Right" Style="{StaticResource plusSuffix}" />
##END-->
</DockPanel> </DockPanel>
</DataTemplate> </DataTemplate>
</Setter.Value> </Setter.Value>
@ -77,7 +205,9 @@
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
<RowDefinition Height="*" /> <RowDefinition Height="*" />
<!--##INCLUDE_OPEN_SOURCE
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
##END-->
</Grid.RowDefinitions> </Grid.RowDefinitions>
<GroupBox Header="Features" <GroupBox Header="Features"
@ -126,16 +256,31 @@
Content="Office2007 Black" Content="Office2007 Black"
Selected="DefaultComboBoxItem_Selected" Selected="DefaultComboBoxItem_Selected"
ThemeEnum="{x:Static view:AvalonDockThemesEnum.Office2007Black}"> ThemeEnum="{x:Static view:AvalonDockThemesEnum.Office2007Black}">
<!--##EXCLUDE_OPEN_SOURCE-->
<view:AvalonDockComboBoxItem.Tag>
<xcad:Office2007BlackTheme />
</view:AvalonDockComboBoxItem.Tag>
<!--##END-->
</view:AvalonDockComboBoxItem> </view:AvalonDockComboBoxItem>
<view:AvalonDockComboBoxItem Style="{StaticResource plusItem}" <view:AvalonDockComboBoxItem Style="{StaticResource plusItem}"
Content="Office2007 Blue" Content="Office2007 Blue"
Selected="DefaultComboBoxItem_Selected" Selected="DefaultComboBoxItem_Selected"
ThemeEnum="{x:Static view:AvalonDockThemesEnum.Office2007Blue}"> ThemeEnum="{x:Static view:AvalonDockThemesEnum.Office2007Blue}">
<!--##EXCLUDE_OPEN_SOURCE-->
<view:AvalonDockComboBoxItem.Tag>
<xcad:Office2007BlueTheme />
</view:AvalonDockComboBoxItem.Tag>
<!--##END-->
</view:AvalonDockComboBoxItem> </view:AvalonDockComboBoxItem>
<view:AvalonDockComboBoxItem Style="{StaticResource plusItem}" <view:AvalonDockComboBoxItem Style="{StaticResource plusItem}"
Content="Office2007 Silver" Content="Office2007 Silver"
Selected="DefaultComboBoxItem_Selected" Selected="DefaultComboBoxItem_Selected"
ThemeEnum="{x:Static view:AvalonDockThemesEnum.Office2007Silver}"> ThemeEnum="{x:Static view:AvalonDockThemesEnum.Office2007Silver}">
<!--##EXCLUDE_OPEN_SOURCE-->
<view:AvalonDockComboBoxItem.Tag>
<xcad:Office2007SilverTheme />
</view:AvalonDockComboBoxItem.Tag>
<!--##END-->
</view:AvalonDockComboBoxItem> </view:AvalonDockComboBoxItem>
<view:AvalonDockComboBoxItem x:Name="metroDarkComboBoxItem" <view:AvalonDockComboBoxItem x:Name="metroDarkComboBoxItem"
Style="{StaticResource plusItem}" Style="{StaticResource plusItem}"
@ -153,8 +298,213 @@
</view:AvalonDockComboBoxItem> </view:AvalonDockComboBoxItem>
</ComboBox> </ComboBox>
</StackPanel> </StackPanel>
<!--##EXCLUDE_OPEN_SOURCE-->
<StackPanel x:Name="_accentColorPanel"
Grid.Column="1"
Margin="10,0,0,0"
Orientation="Horizontal"
VerticalAlignment="Top"
HorizontalAlignment="Left"
Visibility="Hidden">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<StackPanel>
<TextBlock Text="Accent Color"
FontFamily="Segoe UI"
FontSize="13"
Foreground="#414141" />
<StackPanel Orientation="Horizontal">
<RadioButton Background="#FFF4B300"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Gold"
Style="{StaticResource MetroSampleRadioButtonTemplate}" />
<RadioButton Background="#FF78BA00"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="LightGreen"
Style="{StaticResource MetroSampleRadioButtonTemplate}" />
<RadioButton Background="#FF2673EC"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Blue"
Style="{StaticResource MetroSampleRadioButtonTemplate}" />
<RadioButton Background="#FFAE113D"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="MediumVioletRed"
Style="{StaticResource MetroSampleRadioButtonTemplate}" />
<RadioButton Background="#FF632F00"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Brown"
Style="{StaticResource MetroSampleRadioButtonTemplate}" />
<RadioButton Background="#FFB01E00"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="DarkRed"
Style="{StaticResource MetroSampleRadioButtonTemplate}" />
<RadioButton Background="#FFC1004F"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="PaleVioletRed"
Style="{StaticResource MetroSampleRadioButtonTemplate}" />
<RadioButton Background="#FF7200AC"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="DarkViolet"
Style="{StaticResource MetroSampleRadioButtonTemplate}" />
<RadioButton Background="#FF4617B4"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="DarkSlateBlue"
Style="{StaticResource MetroSampleRadioButtonTemplate}" />
<RadioButton Background="#FF006AC1"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="RoyalBlue"
Style="{StaticResource MetroSampleRadioButtonTemplate}" />
<RadioButton Background="#FF008287"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Teal"
Style="{StaticResource MetroSampleRadioButtonTemplate}" />
<RadioButton Background="#FF199900"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Green"
Style="{StaticResource MetroSampleRadioButtonTemplate}" />
<RadioButton Background="#FF00C13F"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Lime"
Style="{StaticResource MetroSampleRadioButtonTemplate}" />
</StackPanel>
</StackPanel>
<StackPanel Grid.Row="1"
Orientation="Horizontal"
Margin="0,2,0,0">
<RadioButton Background="#FFFF981D"
Margin="0,0,2,0"
IsChecked="True"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="LightSalmon"
Style="{StaticResource MetroSampleRadioButtonTemplate}" />
<RadioButton Background="#FFFF2E12"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Red"
Style="{StaticResource MetroSampleRadioButtonTemplate}" />
<RadioButton Background="#FFFF1D77"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="DeepPink"
Style="{StaticResource MetroSampleRadioButtonTemplate}" />
<RadioButton Background="#FFAA40FF"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Purple"
Style="{StaticResource MetroSampleRadioButtonTemplate}" />
<RadioButton Background="#FF1FAEFF"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="DeepSkyBlue"
Style="{StaticResource MetroSampleRadioButtonTemplate}" />
<RadioButton Background="#FF56C5FF"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="DarkTurquoise"
Style="{StaticResource MetroSampleRadioButtonTemplate}" />
<RadioButton Background="#FF00D8CC"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Turquoise"
Style="{StaticResource MetroSampleRadioButtonTemplate}" />
<RadioButton Background="#FF91D100"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="YellowGreen"
Style="{StaticResource MetroSampleRadioButtonTemplate}" />
<RadioButton Background="#FFE1B700"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="DarkYellow"
Style="{StaticResource MetroSampleRadioButtonTemplate}" />
<RadioButton Background="#FFFF76BC"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Pink"
Style="{StaticResource MetroSampleRadioButtonTemplate}" />
<RadioButton Background="#FF00A4A4"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="LightSeaGreen"
Style="{StaticResource MetroSampleRadioButtonTemplate}" />
<RadioButton Background="#FFFF7D23"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Orange"
Style="{StaticResource MetroSampleRadioButtonTemplate}" />
</StackPanel>
</Grid>
<StackPanel Margin="10,0,0,0">
<TextBlock Text="Custom Color"
FontFamily="Segoe UI"
FontSize="13"
Foreground="#414141" />
<StackPanel Orientation="Horizontal">
<RadioButton Margin="0,0,2,0"
Checked="RadioButton_Checked"
Background="{StaticResource customAccentBrush1}"
GroupName="themeRadioGroup"
Tag="Custom1"
Style="{StaticResource MetroSampleRadioButtonTemplate}" />
<RadioButton Margin="0,0,2,0"
Checked="RadioButton_Checked"
Background="{StaticResource customAccentBrush2}"
GroupName="themeRadioGroup"
Tag="Custom2"
Style="{StaticResource MetroSampleRadioButtonTemplate}" />
<RadioButton Margin="0,0,2,0"
Checked="RadioButton_Checked"
Background="{StaticResource customAccentBrush3}"
GroupName="themeRadioGroup"
Tag="Custom3"
Style="{StaticResource MetroSampleRadioButtonTemplate}" />
</StackPanel>
</StackPanel>
</StackPanel>
<!--##END-->
</Grid> </Grid>
</GroupBox> </GroupBox>
@ -277,6 +627,7 @@
</xcad:DockingManager> </xcad:DockingManager>
</Border> </Border>
<!--##INCLUDE_OPEN_SOURCE
<Image x:Name="_openSourceScreenShot" Grid.Row="2" Height="395" Visibility="Collapsed" /> <Image x:Name="_openSourceScreenShot" Grid.Row="2" Height="395" Visibility="Collapsed" />
<StackPanel x:Name="_openSourceTextHyperlink" Grid.Row="3" Orientation="Horizontal" Visibility="Collapsed"> <StackPanel x:Name="_openSourceTextHyperlink" Grid.Row="3" Orientation="Horizontal" Visibility="Collapsed">
<TextBlock Text="This theme is only available in the &quot;Plus&quot; version. "/> <TextBlock Text="This theme is only available in the &quot;Plus&quot; version. "/>
@ -286,5 +637,6 @@
</Hyperlink> </Hyperlink>
</TextBlock> </TextBlock>
</StackPanel> </StackPanel>
##END-->
</Grid> </Grid>
</local:DemoView> </local:DemoView>

158
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingCoreWPFView.xaml.cs.txt

@ -20,6 +20,11 @@ using System.ComponentModel;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using Xceed.Wpf.Toolkit; using Xceed.Wpf.Toolkit;
#if !OPEN_SOURCE
using Xceed.Wpf.Toolkit.Themes;
using Xceed.Wpf.Themes.Metro;
using Xceed.Wpf.Themes;
#endif
using System.Windows.Controls.Primitives; using System.Windows.Controls.Primitives;
using System; using System;
using System.Data; using System.Data;
@ -35,48 +40,187 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Theming.Views
/// </summary> /// </summary>
public partial class ThemingCoreWPFView : DemoView public partial class ThemingCoreWPFView : DemoView
{ {
#if !OPEN_SOURCE
#region Members
public static string DefaultSearchString = "type in your search";
private Storyboard _progressStoryboard = null;
private Brush _accentBrush = new SolidColorBrush( System.Windows.Media.Color.FromRgb( 255, 152, 29 ) );
private Brush whiteBrush = new SolidColorBrush(Colors.White);
private Brush blackBrush = new SolidColorBrush(Colors.Black);
#endregion
#region Properties
public ObservableCollection<Xceed.Wpf.Samples.SampleData.Product> Products
{
get
{
return Xceed.Wpf.Samples.SampleData.SampleDataProvider.GetProducts();
}
}
#endregion
#endif
#region Constructors #region Constructors
public ThemingCoreWPFView() public ThemingCoreWPFView()
{ {
#if !OPEN_SOURCE
this.Initialized += new EventHandler( WPFControlsThemes_Initialized );
DataContext = this;
#endif
InitializeComponent(); InitializeComponent();
} }
#endregion #endregion
#if !OPEN_SOURCE
#region EventHandlers
private void RadioButton_Checked( object sender, RoutedEventArgs e )
{
RadioButton button = sender as RadioButton;
if( button == null )
return;
_accentBrush = button.Background;
if( _accentBrush == null )
return;
if( themeComboBox.SelectedItem == null )
return;
if( themeComboBox.SelectedItem.Equals( metroDarkComboBoxItem ) )
{
this.ChangeMetroTheme( new Xceed.Wpf.Themes.Metro.MetroDarkThemeResourceDictionary() );
}
else if( themeComboBox.SelectedItem.Equals( metroLightComboBoxItem ) )
{
this.ChangeMetroTheme( new Xceed.Wpf.Themes.Metro.MetroLightThemeResourceDictionary() );
}
}
#endregion
#region Methods (Private)
private void WPFControlsThemes_Initialized( object sender, EventArgs e )
{
themeComboBox.SelectedIndex = 0;
}
private void SystemComboBoxItem_Selected( object sender, RoutedEventArgs e )
{
_accentColorPanel.Visibility = Visibility.Hidden;
ChangeTheme( null, null, null, null, null, SystemColors.WindowBrush );
}
private void Office2007BlueComboBoxItem_Selected( object sender, RoutedEventArgs e )
{
_accentColorPanel.Visibility = Visibility.Hidden;
ChangeTheme( new Xceed.Wpf.Themes.Office2007.Office2007BlueResourceDictionary(), null, null, null, null,
Xceed.Wpf.Themes.Office2007.Office2007BlueResources.ApplicationBackgroundBrush );
}
private void Office2007SilverComboBoxItem_Selected( object sender, RoutedEventArgs e )
{
_accentColorPanel.Visibility = Visibility.Hidden;
ChangeTheme( new Xceed.Wpf.Themes.Office2007.Office2007SilverResourceDictionary(), null, null, null, null,
Xceed.Wpf.Themes.Office2007.Office2007SilverResources.ApplicationBackgroundBrush );
}
private void Office2007BlackComboBoxItem_Selected( object sender, RoutedEventArgs e )
{
_accentColorPanel.Visibility = Visibility.Hidden;
ChangeTheme( new Xceed.Wpf.Themes.Office2007.Office2007BlackResourceDictionary(),
Xceed.Wpf.Themes.Office2007.Office2007BlackResources.ApplicationLightBackgroundBrush,
Xceed.Wpf.Themes.Office2007.Office2007BlackResources.BorderBrush,
Xceed.Wpf.Themes.Office2007.Office2007BlackResources.ApplicationLightBackgroundBrush,
Xceed.Wpf.Themes.Office2007.Office2007BlackResources.ApplicationLightBackgroundBrush,
Xceed.Wpf.Themes.Office2007.Office2007BlackResources.ApplicationBackgroundBrush );
}
private void MetroDarkComboBoxItem_Selected( object sender, RoutedEventArgs e )
{
this.ChangeMetroTheme( new Xceed.Wpf.Themes.Metro.MetroDarkThemeResourceDictionary() );
}
private void MetroLightComboBoxItem_Selected( object sender, RoutedEventArgs e )
{
this.ChangeMetroTheme( new Xceed.Wpf.Themes.Metro.MetroLightThemeResourceDictionary() );
}
private void ChangeTheme( Xceed.Wpf.Themes.ThemeResourceDictionary theme, Brush groupBoxBackgroundBrush, Brush groupBoxBorderBrush,
Brush treeViewBackgroundBrush, Brush treeViewBorderBrush, Brush sampleBackgroundBrush )
{
SampleBorder.Resources.MergedDictionaries.Clear();
if( theme != null )
{
//# The licenser will throw on the second call to this if we set a empty key
//# line if we set an empty key.
//# See Licenser.LicenseKey {set;}, "Detect that license was set too soon".
if( !string.IsNullOrEmpty( Xceed.Wpf.Toolkit.Licenser.LicenseKey ) )
{
theme.LicenseKey = Xceed.Wpf.Toolkit.Licenser.LicenseKey;
}
SampleBorder.Resources.MergedDictionaries.Add( theme );
}
groupBoxBorder.Background = groupBoxBackgroundBrush == null ? Brushes.Transparent : groupBoxBackgroundBrush;
groupBoxBorder.BorderBrush = groupBoxBorderBrush == null ? Brushes.Transparent : groupBoxBorderBrush;
listItemTreeViewBorder.Background = treeViewBackgroundBrush == null ? Brushes.Transparent : treeViewBackgroundBrush;
listItemTreeViewBorder.BorderBrush = treeViewBorderBrush == null ? Brushes.Transparent : treeViewBorderBrush;
SampleBorder.Background = sampleBackgroundBrush;
}
private void ChangeMetroTheme( MetroThemeResourceDictionaryBase metroThemeResourceDictionary )
{
_accentColorPanel.Visibility = Visibility.Visible;
if( metroThemeResourceDictionary != null )
{
metroThemeResourceDictionary.AccentBrush = _accentBrush;
this.ChangeTheme( metroThemeResourceDictionary, null, null, null, null
, ( metroThemeResourceDictionary.GetType() == typeof( MetroDarkThemeResourceDictionary ) ) ? blackBrush : whiteBrush );
}
}
private void animatedProgressToggleButton_Checked( object sender, RoutedEventArgs e )
{
_progressStoryboard = rootLayout.Resources[ "animatedProgressBarStoryboard" ] as Storyboard;
_progressStoryboard.Begin();
}
private void animatedProgressToggleButton_Unchecked( object sender, RoutedEventArgs e )
{
if( _progressStoryboard != null )
_progressStoryboard.Stop();
}
private void TextBox_PreviewGotKeyboardFocus( object sender, System.Windows.Input.KeyboardFocusChangedEventArgs e )
{
System.Windows.Controls.TextBox textBox = sender as System.Windows.Controls.TextBox;
if( textBox != null && textBox.Text == ThemingCoreWPFView.DefaultSearchString )
textBox.Text = string.Empty;
}
private void TextBox_PreviewLostKeyboardFocus( object sender, System.Windows.Input.KeyboardFocusChangedEventArgs e )
{
System.Windows.Controls.TextBox textBox = sender as System.Windows.Controls.TextBox;
if( textBox != null && string.IsNullOrEmpty( textBox.Text ) )
textBox.Text = ThemingCoreWPFView.DefaultSearchString;
}
#endregion
#endif
} }
} }

1003
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingCoreWPFView.xaml.txt

File diff suppressed because it is too large

94
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingDataGridView.xaml.cs.txt

@ -20,6 +20,11 @@ using System.ComponentModel;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using Xceed.Wpf.Toolkit; using Xceed.Wpf.Toolkit;
#if !OPEN_SOURCE
using Xceed.Wpf.Themes;
using Xceed.Wpf.DataGrid.Themes.Metro;
using Xceed.Wpf.DataGrid.Themes;
#endif
using System.Windows.Controls.Primitives; using System.Windows.Controls.Primitives;
using System; using System;
using Xceed.Wpf.Samples.SampleData; using Xceed.Wpf.Samples.SampleData;
@ -36,21 +41,100 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Theming.Views
/// </summary> /// </summary>
public partial class ThemingDataGridView : DemoView public partial class ThemingDataGridView : DemoView
{ {
#if !OPEN_SOURCE
#region Members
private Brush _accentBrush = new SolidColorBrush( System.Windows.Media.Color.FromRgb( 255, 152, 29 ) );
#endregion
#endif
public ThemingDataGridView() public ThemingDataGridView()
{ {
#if !OPEN_SOURCE
this.DataContext = SampleDataProvider.GetOrders();
#endif
InitializeComponent(); InitializeComponent();
} }
#if !OPEN_SOURCE
private void RadioButton_Checked( object sender, RoutedEventArgs e )
{
RadioButton button = sender as RadioButton;
if( button == null )
return;
_accentBrush = button.Background;
if( _accentBrush == null )
return;
if( themeComboBox.SelectedItem.Equals( metroDarkComboBoxItem ) )
{
this.ChangeMetroTheme( new Xceed.Wpf.DataGrid.Themes.Metro.MetroDarkThemeResourceDictionary() );
}
else if( themeComboBox.SelectedItem.Equals( metroLightComboBoxItem ) )
{
this.ChangeMetroTheme( new Xceed.Wpf.DataGrid.Themes.Metro.MetroLightThemeResourceDictionary() );
}
}
private void ThemeComboBoxSelectionChanged( object sender, SelectionChangedEventArgs e )
{
ComboBox comboBox = sender as ComboBox;
if( (comboBox != null) && (_dataGrid != null) )
{
switch( comboBox.SelectedIndex )
{
case 1:
this.ChangeTheme( new Xceed.Wpf.DataGrid.Themes.Office2007BlueTheme() );
break;
case 2:
this.ChangeTheme( new Xceed.Wpf.DataGrid.Themes.Office2007BlackTheme() );
break;
case 3:
this.ChangeTheme( new Xceed.Wpf.DataGrid.Themes.Office2007SilverTheme() );
break;
case 4:
//# TODODOC
// Using a new instance of Brush to prevent the bug of AccentBrush in MetroTheme :
// if using the same instance of AccentBrush, ThemeKey won't make the difference
// between MetroLight and MetroDark and new Theme won't be applied (see case 156588).
_accentBrush = _accentBrush.Clone();
this.ChangeMetroTheme( new Xceed.Wpf.DataGrid.Themes.Metro.MetroDarkThemeResourceDictionary() );
break;
case 5:
_accentBrush = _accentBrush.Clone();
this.ChangeMetroTheme( new Xceed.Wpf.DataGrid.Themes.Metro.MetroLightThemeResourceDictionary() );
break;
default:
this.ChangeTheme( null );
break;
}
}
}
private void ChangeTheme( Theme dataGridTheme )
{
_accentColorPanel.Visibility = Visibility.Hidden;
_dataGrid.View.Theme = dataGridTheme;
}
private void ChangeMetroTheme( MetroThemeResourceDictionaryBase metroDataGridThemeResourceDictionary )
{
_accentColorPanel.Visibility = Visibility.Visible;
if( metroDataGridThemeResourceDictionary != null )
{
if( !string.IsNullOrEmpty( Xceed.Wpf.Toolkit.Licenser.LicenseKey ) )
{
metroDataGridThemeResourceDictionary.LicenseKey = Xceed.Wpf.Toolkit.Licenser.LicenseKey;
}
metroDataGridThemeResourceDictionary.AccentBrush = _accentBrush;
_dataGrid.View.Theme = new Xceed.Wpf.DataGrid.Themes.Metro.MetroTheme( metroDataGridThemeResourceDictionary );
}
}
#endif
} }
} }

537
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingDataGridView.xaml.txt

@ -28,51 +28,514 @@
<Paragraph FontSize="14" FontFamily="Segoe"> <Paragraph FontSize="14" FontFamily="Segoe">
<!--//# TODODOC --> <!--//# TODODOC -->
<Run>Changes the themes of the datagrid control. Available themes are System, Office2007 and Metro with accent color. The Xceed.Wpf.DataGrid.Themes.Office2007.dll or Xceed.Wpf.DataGrid.Themes.Metro.dll assemblies are necessary to use the themes on the datagrid.</Run> <Run>Changes the themes of the datagrid control. Available themes are System, Office2007 and Metro with accent color. The Xceed.Wpf.DataGrid.Themes.Office2007.dll or Xceed.Wpf.DataGrid.Themes.Metro.dll assemblies are necessary to use the themes on the datagrid.</Run>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
<LineBreak /> <LineBreak />
<Hyperlink NavigateUri="http://www.xceed.com/Extended_WPF_Toolkit_Intro.html" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="http://www.xceed.com/Extended_WPF_Toolkit_Intro.html" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Extended WPF Toolkit Plus. Click here for more details about Xceed Extended WPF Toolkit Plus.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
<!--##EXCLUDE_OPEN_SOURCE-->
<local:DemoView.Resources>
<xcdg:ImageConverter x:Key="imageConverter" />
<!-- Converter used to return a BitmapImage from a Country name -->
<conv:FlagPathConverter x:Key="flagPathConverter" />
<!-- DataTemplate to display an Employee object -->
<DataTemplate x:Key="employeeDataTemplate">
<Grid MaxHeight="30"
VerticalAlignment="Center">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Image Margin="0, 0, 5, 0"
Source="{Binding Photo, Converter={StaticResource imageConverter}, NotifyOnValidationError=False, ValidatesOnDataErrors=False}" />
<StackPanel Grid.Column="1"
Orientation="Horizontal"
VerticalAlignment="Center">
<TextBlock Text="{Binding FirstName, NotifyOnValidationError=False, ValidatesOnDataErrors=False}" />
<TextBlock Text=" " />
<TextBlock Text="{Binding LastName, NotifyOnValidationError=False, ValidatesOnDataErrors=False}" />
</StackPanel>
</Grid>
</DataTemplate>
<!-- DataTemplate to display the $ in Freight column -->
<DataTemplate x:Key="freightDataTemplate">
<TextBlock Text="{Binding StringFormat=\{0:C\}}"
VerticalAlignment="Center" />
</DataTemplate>
<!-- DataTemplate to display a Country -->
<DataTemplate x:Key="countryDataTemplate">
<StackPanel Orientation="Horizontal"
VerticalAlignment="Center"
Margin="5,0,0,0">
<!--The flagPathConverter resource changes the value of a
group (e.g., "Canada") to an image. -->
<Image MaxHeight="15"
Margin="0, 0, 5, 0"
Source="{Binding Converter={StaticResource flagPathConverter}}" />
<TextBlock Text="{Binding}"
TextTrimming="WordEllipsis"
VerticalAlignment="Center" />
</StackPanel>
</DataTemplate>
<xcdg:DataGridCollectionViewSource x:Key="cvsOrders"
Source="{Binding}">
<xcdg:DataGridCollectionViewSource.GroupDescriptions>
<PropertyGroupDescription PropertyName="ShipCountry" />
<PropertyGroupDescription PropertyName="ShipCity" />
</xcdg:DataGridCollectionViewSource.GroupDescriptions>
</xcdg:DataGridCollectionViewSource>
<LinearGradientBrush x:Key="customAccentBrush1"
EndPoint="0.5,1"
StartPoint="0.5,0">
<GradientStop Color="#FF0086c6"
Offset="0" />
<GradientStop Color="#FF66ccff"
Offset="0.94" />
<GradientStop Color="#FFddf4ff"
Offset="0.94" />
<GradientStop Color="#FFddf4ff"
Offset="0.97" />
<GradientStop Color="#FFddf4ff"
Offset="1" />
</LinearGradientBrush>
<LinearGradientBrush x:Key="customAccentBrush2"
EndPoint="0.5,1"
StartPoint="0.5,0">
<GradientStop Color="#FFff0099"
Offset="0" />
<GradientStop Color="#FF993366"
Offset="1" />
</LinearGradientBrush>
<LinearGradientBrush x:Key="customAccentBrush3"
EndPoint="0.5,1"
StartPoint="0.5,0">
<GradientStop Color="#FF9DE214"
Offset="0" />
<GradientStop Color="#FF9DE214"
Offset="0.2" />
<GradientStop Color="#FF95CA2A"
Offset="0.2" />
<GradientStop Color="#FF339933"
Offset="1" />
</LinearGradientBrush>
<Style x:Key="MetroSampleRadioButtonTemplate" TargetType="RadioButton">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RadioButton">
<Grid>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualStateGroup.Transitions>
<VisualTransition GeneratedDuration="0:0:0.2" />
<VisualTransition From="Normal"
GeneratedDuration="0"
To="Pressed">
<Storyboard>
<DoubleAnimation Duration="0"
To="0.45"
Storyboard.TargetProperty="(UIElement.Opacity)"
Storyboard.TargetName="rectangle" />
</Storyboard>
</VisualTransition>
</VisualStateGroup.Transitions>
<VisualState x:Name="Normal" />
<VisualState x:Name="MouseOver">
<Storyboard>
<DoubleAnimation Duration="0"
To="0.35"
Storyboard.TargetProperty="(UIElement.Opacity)"
Storyboard.TargetName="rectangle" />
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<DoubleAnimation Duration="0"
To="0.35"
Storyboard.TargetProperty="(UIElement.Opacity)"
Storyboard.TargetName="rectangle" />
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled">
<Storyboard>
<DoubleAnimation Duration="0"
To=".2"
Storyboard.TargetProperty="(UIElement.Opacity)"
Storyboard.TargetName="content" />
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="CheckStates">
<VisualStateGroup.Transitions>
<VisualTransition GeneratedDuration="0:0:0.2" />
</VisualStateGroup.Transitions>
<VisualState x:Name="Checked">
<Storyboard>
<DoubleAnimation Duration="0"
To="1"
Storyboard.TargetProperty="(UIElement.Opacity)"
Storyboard.TargetName="CheckIcon" />
</Storyboard>
</VisualState>
<VisualState x:Name="Unchecked" />
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Rectangle x:Name="content"
Width="20"
Height="20"
Fill="{TemplateBinding Background}" />
<Path x:Name="CheckIcon"
Data="M 619,736 C619,736 617,738 617,738 617,738 621,742 621,742 621,742 629,732 629,732 629,732 627,730 627,730 627,730 621,738 621,738 621,738 619,736 619,736 z"
Fill="White"
FlowDirection="LeftToRight"
Opacity="0"
Stretch="Fill"
UseLayoutRounding="False"
VerticalAlignment="Bottom"
HorizontalAlignment="Right"
Width="12"
Height="12"
Margin="0,0,1,1" />
<Rectangle x:Name="rectangle"
Fill="White"
Opacity="0" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</local:DemoView.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<GroupBox Header="Features" Grid.Row="0" Margin="5">
<Grid Margin="5" HorizontalAlignment="Left">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<StackPanel Margin="0,5,5,5" Orientation="Horizontal">
<TextBlock Text="Themes:" Margin="0,5,5,5" VerticalAlignment="Center"/>
<ComboBox x:Name="themeComboBox" Width="150" Height="25" SelectedIndex="0" SelectionChanged="ThemeComboBoxSelectionChanged">
<ComboBoxItem Content="System" />
<ComboBoxItem Content="Office 2007 Blue" />
<ComboBoxItem Content="Office 2007 Black" />
<ComboBoxItem Content="Office 2007 Silver" />
<ComboBoxItem x:Name="metroDarkComboBoxItem" Content="Metro Dark" />
<ComboBoxItem x:Name="metroLightComboBoxItem" Content="Metro Light" />
</ComboBox>
</StackPanel>
<StackPanel x:Name="_accentColorPanel"
Grid.Column="1" Margin="10,0,0,0"
Orientation="Horizontal"
VerticalAlignment="Top"
HorizontalAlignment="Left"
Visibility="Hidden">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<StackPanel>
<TextBlock Text="Accent Color"/>
<StackPanel Orientation="Horizontal">
<RadioButton Background="#FFF4B300"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Gold"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF78BA00"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="LightGreen"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF2673EC"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Blue"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FFAE113D"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="MediumVioletRed"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF632F00"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Brown"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FFB01E00"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="DarkRed"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FFC1004F"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="PaleVioletRed"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF7200AC"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="DarkViolet"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF4617B4"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="DarkSlateBlue"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF006AC1"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="RoyalBlue"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF008287"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Teal"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF199900"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Green"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF00C13F"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Lime"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
</StackPanel>
</StackPanel>
<StackPanel Grid.Row="1" Orientation="Horizontal" Margin="0,2,0,0">
<RadioButton Background="#FFFF981D"
Margin="0,0,2,0"
IsChecked="True"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="LightSalmon"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FFFF2E12"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Red"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FFFF1D77"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="DeepPink"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FFAA40FF"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Purple"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF1FAEFF"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="DeepSkyBlue"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF56C5FF"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="DarkTurquoise"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF00D8CC"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Turquoise"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF91D100"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="YellowGreen"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FFE1B700"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="DarkYellow"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FFFF76BC"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Pink"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF00A4A4"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="LightSeaGreen"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FFFF7D23"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Orange"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
</StackPanel>
</Grid>
<StackPanel Margin="10,0,0,0">
<TextBlock Text="Custom Color" />
<StackPanel Orientation="Horizontal">
<RadioButton Margin="0,0,2,0"
Checked="RadioButton_Checked"
Background="{StaticResource customAccentBrush1}"
GroupName="themeRadioGroup"
Tag="Custom1"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Margin="0,0,2,0"
Checked="RadioButton_Checked"
Background="{StaticResource customAccentBrush2}"
GroupName="themeRadioGroup"
Tag="Custom2"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Margin="0,0,2,0"
Checked="RadioButton_Checked"
Background="{StaticResource customAccentBrush3}"
GroupName="themeRadioGroup"
Tag="Custom3"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
</StackPanel>
</StackPanel>
</StackPanel>
</Grid>
</GroupBox>
<TextBlock Grid.Row="1" Margin="10" HorizontalAlignment="Left" Text="Usage:" Style="{StaticResource Header}"/>
<Border Grid.Row="2" x:Name="myBorder">
<xcdg:DataGridControl x:Name="_dataGrid"
ReadOnly="False"
ItemsSource="{Binding Source={StaticResource cvsOrders}}">
<xcdg:DataGridControl.View>
<xcdg:TableflowView />
</xcdg:DataGridControl.View>
<xcdg:DataGridControl.Columns>
<xcdg:Column FieldName="OrderID"
Title="Order"
Width="100"
IsMainColumn="True">
</xcdg:Column>
<xcdg:Column FieldName="Employee"
Title="Employee"
Width="160"
CellContentTemplate="{StaticResource employeeDataTemplate}"
GroupValueTemplate="{StaticResource employeeDataTemplate}"/>
<xcdg:Column FieldName="Customer.CompanyName"
Title="Customer"
Width="185"/>
<xcdg:Column FieldName="OrderDate"
Title="Order Date"
Width="120" />
<xcdg:Column FieldName="Shipper.CompanyName"
Title="Ship Via" />
<xcdg:Column FieldName="Freight"
Width="100"
CellContentTemplate="{StaticResource freightDataTemplate}"
GroupValueTemplate="{StaticResource freightDataTemplate}"/>
<xcdg:Column FieldName="ShipCity"
Title="City"
Width="80" />
<xcdg:Column FieldName="ShipCountry"
Title="Country"
CellContentTemplate="{StaticResource countryDataTemplate}"
GroupValueTemplate="{StaticResource countryDataTemplate}"/>
<xcdg:Column FieldName="ShipAddress"
Title="Address"
Width="200" />
<xcdg:Column FieldName="ShipPostalCode"
Title="Postal Code"
Width="120" />
<xcdg:Column FieldName="RequiredDate"
Title="Required Date"
Width="140" />
<xcdg:Column FieldName="ShippedDate"
Title="Shipped Date"
Width="140" />
<xcdg:Column FieldName="ShipName"
Visible="False" />
<xcdg:Column FieldName="ShipRegion"
Visible="False" />
<xcdg:Column FieldName="EmployeeID"
Visible="False" />
<xcdg:Column FieldName="CustomerID"
Visible="False" />
<xcdg:Column FieldName="Customer"
Visible="False" />
<xcdg:Column FieldName="ShipVia"
Visible="False" />
<xcdg:Column FieldName="Shipper"
Visible="False" />
</xcdg:DataGridControl.Columns>
</xcdg:DataGridControl>
</Border>
</Grid>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<Image Source="..\OpenSourceImages\DataGridControls.png" Width="700" Height="500"/> <Image Source="..\OpenSourceImages\DataGridControls.png" Width="700" Height="500"/>
##END-->
</local:DemoView> </local:DemoView>

99
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingExtendedToolkitView.xaml.cs.txt

@ -16,6 +16,12 @@
using System.Diagnostics; using System.Diagnostics;
using System.Windows; using System.Windows;
#if !OPEN_SOURCE
using Xceed.Wpf.Themes;
using Xceed.Wpf.Toolkit.Themes.Office2007;
using Xceed.Wpf.Toolkit.Themes.Metro;
using Xceed.Wpf.Themes.Metro;
#endif
using System; using System;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Media; using System.Windows.Media;
@ -29,30 +35,117 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Theming.Views
/// </summary> /// </summary>
public partial class ThemingExtendedToolkitView : DemoView public partial class ThemingExtendedToolkitView : DemoView
{ {
#if !OPEN_SOURCE
#region Members
private Brush _accentBrush = new SolidColorBrush( System.Windows.Media.Color.FromRgb( 255, 152, 29 ) );
private Brush whiteBrush = new SolidColorBrush( Colors.White );
private Brush blackBrush = new SolidColorBrush( Colors.Black );
#endregion
#endif
public ThemingExtendedToolkitView() public ThemingExtendedToolkitView()
{ {
#if !OPEN_SOURCE
this.Initialized += new EventHandler( ToolkitControlsThemes_Initialized );
#endif
InitializeComponent(); InitializeComponent();
} }
#if !OPEN_SOURCE
private void RadioButton_Checked( object sender, RoutedEventArgs e )
{
RadioButton button = sender as RadioButton;
if( button == null )
return;
_accentBrush = button.Background;
if( _accentBrush == null )
return;
if( themeComboBox.SelectedItem == null )
return;
if( themeComboBox.SelectedItem.Equals( metroDarkComboBoxItem ) )
{
this.ChangeMetroTheme( new Xceed.Wpf.Toolkit.Themes.Metro.ToolkitMetroDarkThemeResourceDictionary()
, blackBrush );
}
else if( themeComboBox.SelectedItem.Equals( metroLightComboBoxItem ) )
{
this.ChangeMetroTheme( new Xceed.Wpf.Toolkit.Themes.Metro.ToolkitMetroLightThemeResourceDictionary()
, whiteBrush );
}
}
private void ToolkitControlsThemes_Initialized( object sender,EventArgs e )
{
themeComboBox.SelectedIndex = 0;
}
private void SystemComboBoxItem_Selected( object sender, RoutedEventArgs e )
{
this.ChangeTheme( null );
}
private void Office2007BlueComboBoxItem_Selected( object sender, RoutedEventArgs e )
{
this.ChangeTheme( new Xceed.Wpf.Toolkit.Themes.Office2007.Office2007BlueResourceDictionary() );
}
private void Office2007SilverComboBoxItem_Selected( object sender, RoutedEventArgs e )
{
this.ChangeTheme( new Xceed.Wpf.Toolkit.Themes.Office2007.Office2007SilverResourceDictionary() );
}
private void Office2007BlackComboBoxItem_Selected( object sender, RoutedEventArgs e )
{
this.ChangeTheme( new Xceed.Wpf.Toolkit.Themes.Office2007.Office2007BlackResourceDictionary() );
}
private void MetroDarkComboBoxItem_Selected( object sender, RoutedEventArgs e )
{
this.ChangeMetroTheme( new Xceed.Wpf.Toolkit.Themes.Metro.ToolkitMetroDarkThemeResourceDictionary()
, blackBrush );
}
private void MetroLightComboBoxItem_Selected( object sender, RoutedEventArgs e )
{
this.ChangeMetroTheme( new Xceed.Wpf.Toolkit.Themes.Metro.ToolkitMetroLightThemeResourceDictionary()
, whiteBrush );
}
private void ChangeTheme( ThemeResourceDictionary toolkitTheme)
{
_accentColorPanel.Visibility = Visibility.Hidden;
SampleBorder.Resources.MergedDictionaries.Clear();
if( toolkitTheme != null )
{
SampleBorder.Resources.MergedDictionaries.Add( toolkitTheme );
}
SampleBorder.Background = SystemColors.WindowBrush;
TextElement.SetForeground( SampleBorder, blackBrush );
}
private void ChangeMetroTheme( MetroThemeResourceDictionaryBase metroToolkitThemeResourceDictionary
, Brush sampleBrush)
{
_accentColorPanel.Visibility = Visibility.Visible;
if( metroToolkitThemeResourceDictionary != null )
{
metroToolkitThemeResourceDictionary.AccentBrush = _accentBrush;
SampleBorder.Resources.MergedDictionaries.Clear();
SampleBorder.Resources.MergedDictionaries.Add( metroToolkitThemeResourceDictionary );
}
SampleBorder.Background = sampleBrush;
TextElement.SetForeground( SampleBorder, ( sampleBrush == blackBrush ) ? whiteBrush : blackBrush );
}
#endif
} }
} }

502
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingExtendedToolkitView.xaml.txt

@ -26,41 +26,491 @@
<Paragraph FontSize="14" FontFamily="Segoe"> <Paragraph FontSize="14" FontFamily="Segoe">
<!--//# TODODOC --> <!--//# TODODOC -->
<Run>Changes the themes of the Extended WPF Toolkit controls. Available themes are System, Office2007 and Metro with accent color. The Xceed.Wpf.Toolkit.Themes.Office2007.dll or Xceed.Wpf.Toolkit.Themes.Metro.dll assembly is necessary to use the themes.</Run> <Run>Changes the themes of the Extended WPF Toolkit controls. Available themes are System, Office2007 and Metro with accent color. The Xceed.Wpf.Toolkit.Themes.Office2007.dll or Xceed.Wpf.Toolkit.Themes.Metro.dll assembly is necessary to use the themes.</Run>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
<LineBreak /> <LineBreak />
<Hyperlink NavigateUri="http://www.xceed.com/Extended_WPF_Toolkit_Intro.html" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="http://www.xceed.com/Extended_WPF_Toolkit_Intro.html" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Extended WPF Toolkit Plus. Click here for more details about Xceed Extended WPF Toolkit Plus.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
<!--##EXCLUDE_OPEN_SOURCE-->
<local:DemoView.Resources>
<LinearGradientBrush x:Key="customAccentBrush1"
EndPoint="0.5,1"
StartPoint="0.5,0">
<GradientStop Color="#FF0086c6"
Offset="0" />
<GradientStop Color="#FF66ccff"
Offset="0.94" />
<GradientStop Color="#FFddf4ff"
Offset="0.94" />
<GradientStop Color="#FFddf4ff"
Offset="0.97" />
<GradientStop Color="#FFddf4ff"
Offset="1" />
</LinearGradientBrush>
<LinearGradientBrush x:Key="customAccentBrush2"
EndPoint="0.5,1"
StartPoint="0.5,0">
<GradientStop Color="#FFff0099"
Offset="0" />
<GradientStop Color="#FF993366"
Offset="1" />
</LinearGradientBrush>
<LinearGradientBrush x:Key="customAccentBrush3"
EndPoint="0.5,1"
StartPoint="0.5,0">
<GradientStop Color="#FF9DE214"
Offset="0" />
<GradientStop Color="#FF9DE214"
Offset="0.2" />
<GradientStop Color="#FF95CA2A"
Offset="0.2" />
<GradientStop Color="#FF339933"
Offset="1" />
</LinearGradientBrush>
<Style x:Key="MetroSampleRadioButtonTemplate" TargetType="RadioButton">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RadioButton">
<Grid>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualStateGroup.Transitions>
<VisualTransition GeneratedDuration="0:0:0.2" />
<VisualTransition From="Normal"
GeneratedDuration="0"
To="Pressed">
<Storyboard>
<DoubleAnimation Duration="0"
To="0.45"
Storyboard.TargetProperty="(UIElement.Opacity)"
Storyboard.TargetName="rectangle" />
</Storyboard>
</VisualTransition>
</VisualStateGroup.Transitions>
<VisualState x:Name="Normal" />
<VisualState x:Name="MouseOver">
<Storyboard>
<DoubleAnimation Duration="0"
To="0.35"
Storyboard.TargetProperty="(UIElement.Opacity)"
Storyboard.TargetName="rectangle" />
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<DoubleAnimation Duration="0"
To="0.35"
Storyboard.TargetProperty="(UIElement.Opacity)"
Storyboard.TargetName="rectangle" />
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled">
<Storyboard>
<DoubleAnimation Duration="0"
To=".2"
Storyboard.TargetProperty="(UIElement.Opacity)"
Storyboard.TargetName="content" />
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="CheckStates">
<VisualStateGroup.Transitions>
<VisualTransition GeneratedDuration="0:0:0.2" />
</VisualStateGroup.Transitions>
<VisualState x:Name="Checked">
<Storyboard>
<DoubleAnimation Duration="0"
To="1"
Storyboard.TargetProperty="(UIElement.Opacity)"
Storyboard.TargetName="CheckIcon" />
</Storyboard>
</VisualState>
<VisualState x:Name="Unchecked" />
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Rectangle x:Name="content"
Width="20"
Height="20"
Fill="{TemplateBinding Background}" />
<Path x:Name="CheckIcon"
Data="M 619,736 C619,736 617,738 617,738 617,738 621,742 621,742 621,742 629,732 629,732 629,732 627,730 627,730 627,730 621,738 621,738 621,738 619,736 619,736 z"
Fill="White"
FlowDirection="LeftToRight"
Opacity="0"
Stretch="Fill"
UseLayoutRounding="False"
VerticalAlignment="Bottom"
HorizontalAlignment="Right"
Width="12"
Height="12"
Margin="0,0,1,1" />
<Rectangle x:Name="rectangle"
Fill="White"
Opacity="0" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<x:Array Type="sys:String" x:Key="checkList" >
<sys:String>Blue</sys:String>
<sys:String>Red</sys:String>
<sys:String>Yellow</sys:String>
<sys:String>Green</sys:String>
<sys:String>White</sys:String>
</x:Array>
<Style x:Key="TextBlockStyle"
TargetType="TextBlock">
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Margin" Value="2" />
<!--Foreground Property is set in code-behind-->
</Style>
</local:DemoView.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="400" />
</Grid.RowDefinitions>
<GroupBox Header="Features" Grid.Row="0" Margin="5">
<Grid Margin="5" HorizontalAlignment="Left">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<StackPanel Margin="0,5,5,5" Orientation="Horizontal">
<TextBlock Text="Themes:" Margin="0,5,5,5" VerticalAlignment="Center"/>
<ComboBox x:Name="themeComboBox" Width="150" Height="25">
<ComboBoxItem Selected="SystemComboBoxItem_Selected"
Content="System" />
<ComboBoxItem Selected="Office2007BlueComboBoxItem_Selected"
Content="Office 2007 Blue" />
<ComboBoxItem Selected="Office2007BlackComboBoxItem_Selected"
Content="Office 2007 Black" />
<ComboBoxItem Selected="Office2007SilverComboBoxItem_Selected"
Content="Office 2007 Silver" />
<ComboBoxItem x:Name="metroDarkComboBoxItem"
Selected="MetroDarkComboBoxItem_Selected"
Content="Metro Dark" />
<ComboBoxItem x:Name="metroLightComboBoxItem"
Selected="MetroLightComboBoxItem_Selected"
Content="Metro Light" />
</ComboBox>
</StackPanel>
<StackPanel x:Name="_accentColorPanel"
Grid.Column="1" Margin="10,0,0,0"
Orientation="Horizontal"
VerticalAlignment="Top"
HorizontalAlignment="Left"
Visibility="Hidden">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<StackPanel>
<TextBlock Text="Accent Color" />
<StackPanel Orientation="Horizontal">
<RadioButton Background="#FFF4B300"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Gold"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF78BA00"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="LightGreen"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF2673EC"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Blue"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FFAE113D"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="MediumVioletRed"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF632F00"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Brown"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FFB01E00"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="DarkRed"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FFC1004F"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="PaleVioletRed"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF7200AC"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="DarkViolet"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF4617B4"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="DarkSlateBlue"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF006AC1"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="RoyalBlue"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF008287"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Teal"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF199900"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Green"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF00C13F"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Lime"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
</StackPanel>
</StackPanel>
<StackPanel Grid.Row="1" Orientation="Horizontal" Margin="0,2,0,0">
<RadioButton Background="#FFFF981D"
Margin="0,0,2,0"
IsChecked="True"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="LightSalmon"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FFFF2E12"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Red"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FFFF1D77"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="DeepPink"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FFAA40FF"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Purple"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF1FAEFF"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="DeepSkyBlue"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF56C5FF"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="DarkTurquoise"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF00D8CC"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Turquoise"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF91D100"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="YellowGreen"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FFE1B700"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="DarkYellow"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FFFF76BC"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Pink"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF00A4A4"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="LightSeaGreen"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FFFF7D23"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Orange"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
</StackPanel>
</Grid>
<StackPanel Margin="10,0,0,0">
<TextBlock Text="Custom Color"/>
<StackPanel Orientation="Horizontal">
<RadioButton Margin="0,0,2,0"
Checked="RadioButton_Checked"
Background="{StaticResource customAccentBrush1}"
GroupName="themeRadioGroup"
Tag="Custom1"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Margin="0,0,2,0"
Checked="RadioButton_Checked"
Background="{StaticResource customAccentBrush2}"
GroupName="themeRadioGroup"
Tag="Custom2"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Margin="0,0,2,0"
Checked="RadioButton_Checked"
Background="{StaticResource customAccentBrush3}"
GroupName="themeRadioGroup"
Tag="Custom3"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
</StackPanel>
</StackPanel>
</StackPanel>
</Grid>
</GroupBox>
<TextBlock Grid.Row="1" Text="Usage:" Style="{StaticResource Header}" Margin="10" HorizontalAlignment="Left"/>
<Border x:Name="SampleBorder"
Grid.Row="2"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
BorderThickness="2"
BorderBrush="Black">
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="300" />
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid Grid.Column="0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="IntegerUpDown:" Style="{StaticResource TextBlockStyle}"/>
<xctk:IntegerUpDown x:Name="_integerUpDown" Value="22" Grid.Column="1" Margin="5"/>
<TextBlock Text="CalculatorUpDown:" Grid.Row="1" Style="{StaticResource TextBlockStyle}"/>
<xctk:CalculatorUpDown Grid.Row="1" Grid.Column="1" Value="8" Margin="5"/>
<TextBlock Text="DateTimePicker:" Grid.Row="2" Style="{StaticResource TextBlockStyle}"/>
<xctk:DateTimePicker Grid.Row="2" Grid.Column="1" Format="ShortDate" Value="2012/11/16" Margin="5"/>
<TextBlock Text="CheckListBox:" Grid.Row="3" Style="{StaticResource TextBlockStyle}"/>
<xctk:CheckListBox Grid.Row="3" Grid.Column="1" ItemsSource="{StaticResource checkList}" SelectedItem="Red" Margin="5"/>
<TextBlock Text="DropDownButton:" Grid.Row="4" Style="{StaticResource TextBlockStyle}"/>
<xctk:DropDownButton Grid.Row="4" Grid.Column="1" Content="Show WatermarkTextBox" Margin="5">
<xctk:DropDownButton.DropDownContent>
<StackPanel>
<xctk:WatermarkTextBox Watermark="Enter text here" Width="150"/>
<xctk:WatermarkTextBox Watermark="Enter text here" Width="150"/>
<xctk:WatermarkTextBox Watermark="Enter text here" Width="150"/>
</StackPanel>
</xctk:DropDownButton.DropDownContent>
</xctk:DropDownButton>
<TextBlock Text="ColorPicker:" Grid.Row="5" Style="{StaticResource TextBlockStyle}"/>
<xctk:ColorPicker Grid.Row="5" Grid.Column="1" SelectedColor="Blue" DisplayColorAndName="True" Margin="5"/>
<TextBlock Text="MultiLineTextEditor:" Grid.Row="6" Style="{StaticResource TextBlockStyle}"/>
<xctk:MultiLineTextEditor Grid.Row="6" Grid.Column="1" Content="MultiLine" Text="This is a multi-line text editor." Margin="5" />
<TextBlock Text="MaskedTextBox:" Grid.Row="7" Style="{StaticResource TextBlockStyle}"/>
<xctk:MaskedTextBox Grid.Row="7" Grid.Column="1" Mask="(000) 000-0000" Text="5256963" Margin="5" />
</Grid>
<Grid Grid.Column="1">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<TextBlock Text="PropertyGrid:" Style="{StaticResource TextBlockStyle}"/>
<xctk:PropertyGrid Grid.Row="1" Margin="5" SelectedObject="{Binding ElementName=_integerUpDown}" ShowAdvancedOptions="True" AutoGenerateProperties="False" >
<xctk:PropertyGrid.PropertyDefinitions>
<xctk:PropertyDefinition TargetProperties="Background" />
<xctk:PropertyDefinition TargetProperties="BorderBrush" />
<xctk:PropertyDefinition TargetProperties="BorderThickness" />
<xctk:PropertyDefinition TargetProperties="FontFamily" />
<xctk:PropertyDefinition TargetProperties="FontSize" />
<xctk:PropertyDefinition TargetProperties="FontStretch" />
<xctk:PropertyDefinition TargetProperties="FontStyle" />
<xctk:PropertyDefinition TargetProperties="FontWeight" />
<xctk:PropertyDefinition TargetProperties="Foreground" />
<xctk:PropertyDefinition TargetProperties="IsTabStop" />
<xctk:PropertyDefinition TargetProperties="Content" />
<xctk:PropertyDefinition TargetProperties="HorizontalContentAlignment" />
<xctk:PropertyDefinition TargetProperties="VerticalContentAlignment" />
<xctk:PropertyDefinition TargetProperties="Visibility" />
<xctk:PropertyDefinition TargetProperties="Width" />
<xctk:PropertyDefinition TargetProperties="Height" />
</xctk:PropertyGrid.PropertyDefinitions>
</xctk:PropertyGrid>
</Grid>
</Grid>
</Border>
</Grid>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<Image Source="..\OpenSourceImages\ExtendedWPFToolkitControls.png" Width="700" Height="500"/> <Image Source="..\OpenSourceImages\ExtendedWPFToolkitControls.png" Width="700" Height="500"/>
##END-->
</local:DemoView> </local:DemoView>

154
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingListBoxView.xaml.cs.txt

@ -20,6 +20,13 @@ using System.ComponentModel;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using Xceed.Wpf.Toolkit; using Xceed.Wpf.Toolkit;
#if !OPEN_SOURCE
using Xceed.Wpf.ListBox.Themes.Office2007;
using Xceed.Wpf.ListBox.Themes.LiveExplorer;
using Xceed.Wpf.ListBox.Themes.Metro;
using Xceed.Wpf.ListBox.Themes.WMP11;
using Xceed.Wpf.ListBox;
#endif
using System.Windows.Controls.Primitives; using System.Windows.Controls.Primitives;
using System; using System;
using Xceed.Wpf.Samples.SampleData; using Xceed.Wpf.Samples.SampleData;
@ -30,41 +37,172 @@ using System.Windows.Threading;
namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Theming.Views namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Theming.Views
{ {
#if !OPEN_SOURCE
public enum ThemesEnum
{
System,
Office2007Blue,
Office2007Black,
Office2007Silver,
LiveExplorer,
MetroDark,
MetroLight,
MediaPlayer
}
#endif
/// <summary> /// <summary>
/// Interaction logic for ThemingListBoxView.xaml /// Interaction logic for ThemingListBoxView.xaml
/// </summary> /// </summary>
public partial class ThemingListBoxView : DemoView public partial class ThemingListBoxView : DemoView
{ {
#if !OPEN_SOURCE
#region Members
private Brush _accentBrush = new SolidColorBrush( System.Windows.Media.Color.FromRgb( 255, 152, 29 ) );
private ThemesEnum _selectedTheme = ThemesEnum.System;
private DispatcherTimer _dispatcherTimer;
#endregion
#endif
#region Initialization #region Initialization
public ThemingListBoxView() public ThemingListBoxView()
{ {
#if !OPEN_SOURCE
this.DataContext = SampleDataProvider.GetOrders();
#endif
InitializeComponent(); InitializeComponent();
#if !OPEN_SOURCE
//Add the default GroupDescriptions to the ListBox's GroupDescriptions collection.
_listBox.GroupDescriptions.Add( this.Resources[ "shipCountryGroupDescription" ] as GroupDescription );
_listBox.GroupDescriptions.Add( this.Resources[ "shipCityGroupDescription" ] as GroupDescription );
#endif
} }
#endregion #endregion
#if !OPEN_SOURCE
#region EventHandlers
private void ThemeComboBoxSelectionChanged( object sender, SelectionChangedEventArgs e )
{
ComboBox comboBox = sender as ComboBox;
if( ( comboBox != null ) && ( _listBox != null ) )
{
_selectedTheme = ( ThemesEnum )comboBox.SelectedItem;
// Use a DispatcherTimer to update the Theme on the ListBox
// to avoid changing Theme very often.
if( _dispatcherTimer == null )
{
_dispatcherTimer = new DispatcherTimer();
_dispatcherTimer.Tick += new EventHandler( this.DispatcherTimer_Tick );
_dispatcherTimer.Interval = System.TimeSpan.FromMilliseconds( 250d );
}
_dispatcherTimer.Start();
}
}
private void RadioButton_Checked( object sender, RoutedEventArgs e )
{
RadioButton button = sender as RadioButton;
if( button == null )
return;
_accentBrush = button.Background;
if( _accentBrush == null )
return;
// Use a DispatcherTimer to update the Theme on the ListBox
// to avoid changing Theme very often.
if( _dispatcherTimer == null )
{
_dispatcherTimer = new DispatcherTimer();
_dispatcherTimer.Tick += new EventHandler( this.DispatcherTimer_Tick );
_dispatcherTimer.Interval = System.TimeSpan.FromMilliseconds( 250d );
}
_dispatcherTimer.Start();
}
private void DispatcherTimer_Tick( object sender, EventArgs e )
{
DispatcherTimer timer = sender as DispatcherTimer;
// Make sure the timer is still active.
if( timer == null || !timer.IsEnabled )
return;
timer.Stop();
this.ChangeTheme();
}
#endregion
#endif
#if !OPEN_SOURCE
private void ChangeTheme()
{
_listBox.Resources.MergedDictionaries.Clear();
ThemeResourceDictionary themeResourceDictionary;
switch( _selectedTheme )
{
case ThemesEnum.Office2007Blue:
themeResourceDictionary = new Office2007BlueThemeResourceDictionary();
this.InitTheme();
break;
case ThemesEnum.Office2007Black:
themeResourceDictionary = new Office2007BlackThemeResourceDictionary();
this.InitTheme();
break;
case ThemesEnum.Office2007Silver:
themeResourceDictionary = new Office2007SilverThemeResourceDictionary();
this.InitTheme();
break;
case ThemesEnum.LiveExplorer:
themeResourceDictionary = new LiveExplorerThemeResourceDictionary();
this.InitTheme();
break;
case ThemesEnum.MetroDark:
_accentColorPanel.Visibility = Visibility.Visible;
MetroThemeResourceDictionaryBase metroDarkThemeResourceDictionary = new MetroDarkThemeResourceDictionary();
metroDarkThemeResourceDictionary.AccentBrush = _accentBrush;
themeResourceDictionary = metroDarkThemeResourceDictionary;
break;
case ThemesEnum.MetroLight:
_accentColorPanel.Visibility = Visibility.Visible;
MetroThemeResourceDictionaryBase metroLightThemeResourceDictionary = new MetroLightThemeResourceDictionary();
metroLightThemeResourceDictionary.AccentBrush = _accentBrush;
themeResourceDictionary = metroLightThemeResourceDictionary;
break;
case ThemesEnum.MediaPlayer:
themeResourceDictionary = new WMP11ThemeResourceDictionary();
this.InitTheme();
break;
default:
_accentColorPanel.Visibility = Visibility.Hidden;
themeResourceDictionary = null;
break;
}
if( themeResourceDictionary != null )
{
_listBox.Resources.MergedDictionaries.Add( themeResourceDictionary );
}
}
private void InitTheme()
{
_accentColorPanel.Visibility = Visibility.Hidden;
_listBox.ItemTemplate = Resources[ "orderListBoxItemTemplate" ] as DataTemplate;
}
#endif
} }
} }

347
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingListBoxView.xaml.txt

@ -31,30 +31,377 @@
<LineBreak /> <LineBreak />
<!--//# TODODOC --> <!--//# TODODOC -->
<Run>Supports implicit styles, so the entire listbox can be styled in minutes with a couple of lines of code. Also supports explicit styles and Expression Blend. Available themes are System, Office2007, LiveExplorer, MediaPlayer and Metro with accent color. The Xceed.Wpf.ListBox.Themes.xxx.dll assembly is necessary to use the themes.</Run> <Run>Supports implicit styles, so the entire listbox can be styled in minutes with a couple of lines of code. Also supports explicit styles and Expression Blend. Available themes are System, Office2007, LiveExplorer, MediaPlayer and Metro with accent color. The Xceed.Wpf.ListBox.Themes.xxx.dll assembly is necessary to use the themes.</Run>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
<LineBreak /> <LineBreak />
<Hyperlink NavigateUri="http://www.xceed.com/Extended_WPF_Toolkit_Intro.html" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="http://www.xceed.com/Extended_WPF_Toolkit_Intro.html" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Extended WPF Toolkit Plus. Click here for more details about Xceed Extended WPF Toolkit Plus.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
<!--##EXCLUDE_OPEN_SOURCE-->
<local:DemoView.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../ItemTemplates/ItemTemplates.xaml" />
</ResourceDictionary.MergedDictionaries>
<PropertyGroupDescription x:Key="shipCountryGroupDescription"
PropertyName="ShipCountry" />
<PropertyGroupDescription x:Key="shipCityGroupDescription"
PropertyName="ShipCity" />
<ObjectDataProvider x:Key="ComboBoxThemes" MethodName="GetValues"
ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="view:ThemesEnum" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<Style x:Key="MetroSampleRadioButtonTemplate" TargetType="RadioButton">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RadioButton">
<Grid>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualStateGroup.Transitions>
<VisualTransition GeneratedDuration="0:0:0.2" />
<VisualTransition From="Normal"
GeneratedDuration="0"
To="Pressed">
<Storyboard>
<DoubleAnimation Duration="0"
To="0.45"
Storyboard.TargetProperty="(UIElement.Opacity)"
Storyboard.TargetName="rectangle" />
</Storyboard>
</VisualTransition>
</VisualStateGroup.Transitions>
<VisualState x:Name="Normal" />
<VisualState x:Name="MouseOver">
<Storyboard>
<DoubleAnimation Duration="0"
To="0.35"
Storyboard.TargetProperty="(UIElement.Opacity)"
Storyboard.TargetName="rectangle" />
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<DoubleAnimation Duration="0"
To="0.35"
Storyboard.TargetProperty="(UIElement.Opacity)"
Storyboard.TargetName="rectangle" />
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled">
<Storyboard>
<DoubleAnimation Duration="0"
To=".2"
Storyboard.TargetProperty="(UIElement.Opacity)"
Storyboard.TargetName="content" />
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="CheckStates">
<VisualStateGroup.Transitions>
<VisualTransition GeneratedDuration="0:0:0.2" />
</VisualStateGroup.Transitions>
<VisualState x:Name="Checked">
<Storyboard>
<DoubleAnimation Duration="0"
To="1"
Storyboard.TargetProperty="(UIElement.Opacity)"
Storyboard.TargetName="CheckIcon" />
</Storyboard>
</VisualState>
<VisualState x:Name="Unchecked" />
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Rectangle x:Name="content"
Width="20"
Height="20"
Fill="{TemplateBinding Background}" />
<Path x:Name="CheckIcon"
Data="M 619,736 C619,736 617,738 617,738 617,738 621,742 621,742 621,742 629,732 629,732 629,732 627,730 627,730 627,730 621,738 621,738 621,738 619,736 619,736 z"
Fill="White"
FlowDirection="LeftToRight"
Opacity="0"
Stretch="Fill"
UseLayoutRounding="False"
VerticalAlignment="Bottom"
HorizontalAlignment="Right"
Width="12"
Height="12"
Margin="0,0,1,1" />
<Rectangle x:Name="rectangle"
Fill="White"
Opacity="0" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
</local:DemoView.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<GroupBox Header="Features" Grid.Row="0" Margin="5">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<StackPanel Margin="0,5,5,5" Orientation="Horizontal">
<TextBlock Text="Themes:" Margin="0,5,5,5" VerticalAlignment="Center"/>
<ComboBox x:Name="themeComboBox" Width="150" Height="25"
SelectedIndex="0"
VerticalAlignment="Center"
SelectionChanged="ThemeComboBoxSelectionChanged"
ItemsSource="{Binding Source={StaticResource ComboBoxThemes}}" />
</StackPanel>
<StackPanel x:Name="_accentColorPanel"
Grid.Column="1" Margin="10,0,0,0"
Orientation="Horizontal"
VerticalAlignment="Top"
HorizontalAlignment="Left"
Visibility="Hidden">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<StackPanel>
<TextBlock Text="Accent Color"
FontFamily="Segoe UI"
FontSize="13"
Foreground="#414141" />
<StackPanel Orientation="Horizontal">
<RadioButton Background="#FFF4B300"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Gold"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF78BA00"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="LightGreen"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF2673EC"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Blue"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FFAE113D"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="MediumVioletRed"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF632F00"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Brown"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FFB01E00"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="DarkRed"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FFC1004F"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="PaleVioletRed"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF7200AC"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="DarkViolet"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF4617B4"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="DarkSlateBlue"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF006AC1"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="RoyalBlue"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF008287"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Teal"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF199900"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Green"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF00C13F"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Lime"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
</StackPanel>
</StackPanel>
<StackPanel Grid.Row="1" Orientation="Horizontal" Margin="0,2,0,0">
<RadioButton Background="#FFFF981D"
Margin="0,0,2,0"
IsChecked="True"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="LightSalmon"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FFFF2E12"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Red"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FFFF1D77"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="DeepPink"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FFAA40FF"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Purple"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF1FAEFF"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="DeepSkyBlue"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF56C5FF"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="DarkTurquoise"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF00D8CC"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Turquoise"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF91D100"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="YellowGreen"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FFE1B700"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="DarkYellow"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FFFF76BC"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Pink"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF00A4A4"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="LightSeaGreen"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FFFF7D23"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Orange"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
</StackPanel>
</Grid>
<StackPanel Margin="10,0,0,0">
<TextBlock Text="Custom Color"
FontFamily="Segoe UI"
FontSize="13"
Foreground="#414141" />
<StackPanel Orientation="Horizontal">
<RadioButton Margin="0,0,2,0"
Checked="RadioButton_Checked"
Background="{StaticResource customAccentBrush1}"
GroupName="themeRadioGroup"
Tag="Custom1"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Margin="0,0,2,0"
Checked="RadioButton_Checked"
Background="{StaticResource customAccentBrush2}"
GroupName="themeRadioGroup"
Tag="Custom2"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Margin="0,0,2,0"
Checked="RadioButton_Checked"
Background="{StaticResource customAccentBrush3}"
GroupName="themeRadioGroup"
Tag="Custom3"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
</StackPanel>
</StackPanel>
</StackPanel>
</Grid>
</GroupBox>
<TextBlock Grid.Row="1" Margin="10" HorizontalAlignment="Left" Text="Usage:" Style="{StaticResource Header}"/>
<Border Grid.Row="2" x:Name="myBorder">
<xclb:ListBox x:Name="_listBox"
ItemsSource="{Binding}"
ItemTemplate="{StaticResource orderListBoxItemTemplate}"
ToolPaneVisibility="Visible">
<xclb:SearchTextBox.FilteredFieldNames>
<xclb:FieldNameList>
<sys:String>ShipCountry</sys:String>
</xclb:FieldNameList>
</xclb:SearchTextBox.FilteredFieldNames>
<xclb:DataNavigationControl.DataNavigationConfiguration>
<xclb:AlphabeticalDataNavigationConfiguration />
</xclb:DataNavigationControl.DataNavigationConfiguration>
</xclb:ListBox>
</Border>
</Grid>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<Image Source="..\OpenSourceImages\ListBoxControls.png" Width="700" Height="500"/> <Image Source="..\OpenSourceImages\ListBoxControls.png" Width="700" Height="500"/>
##END-->
</local:DemoView> </local:DemoView>

1
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/WindowContainerView.xaml.cs.txt

@ -40,6 +40,7 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Window.Views
{ {
InitializeComponent(); InitializeComponent();
//# Use translucent colors in the Available Colors Tab from ColorPicker
ObservableCollection<ColorItem> alphaAvailableColors = new ObservableCollection<ColorItem>(); ObservableCollection<ColorItem> alphaAvailableColors = new ObservableCollection<ColorItem>();
foreach( ColorItem item in _modalBackgroundColorPicker.AvailableColors ) foreach( ColorItem item in _modalBackgroundColorPicker.AvailableColors )
{ {

2
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/CollectionControl/Implementation/CollectionControlDialog.xaml.cs

@ -108,11 +108,13 @@ namespace Xceed.Wpf.Toolkit
private void OkButton_Click( object sender, RoutedEventArgs e ) private void OkButton_Click( object sender, RoutedEventArgs e )
{ {
_propertyGrid.PersistChanges(); _propertyGrid.PersistChanges();
this.DialogResult = true;
Close(); Close();
} }
private void CancelButton_Click( object sender, RoutedEventArgs e ) private void CancelButton_Click( object sender, RoutedEventArgs e )
{ {
this.DialogResult = false;
Close(); Close();
} }

11
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Core/Primitives/UpDownBase.cs

@ -41,11 +41,12 @@ namespace Xceed.Wpf.Toolkit.Primitives
/// </summary> /// </summary>
internal const string PART_Spinner = "PART_Spinner"; internal const string PART_Spinner = "PART_Spinner";
internal bool _isTextChangedFromUI;
/// <summary> /// <summary>
/// Flags if the Text and Value properties are in the process of being sync'd /// Flags if the Text and Value properties are in the process of being sync'd
/// </summary> /// </summary>
private bool _isSyncingTextAndValueProperties; private bool _isSyncingTextAndValueProperties;
private bool _isTextChangedFromUI;
#endregion //Members #endregion //Members
@ -79,7 +80,7 @@ namespace Xceed.Wpf.Toolkit.Primitives
#endregion //AllowSpin #endregion //AllowSpin
#region ClipValueToMinMax #region ClipValueToMinMax
public static readonly DependencyProperty ClipValueToMinMaxProperty = DependencyProperty.Register( "ClipValueToMinMax", typeof( bool ), typeof( UpDownBase<T> ), new UIPropertyMetadata( false ) ); public static readonly DependencyProperty ClipValueToMinMaxProperty = DependencyProperty.Register( "ClipValueToMinMax", typeof( bool ), typeof( UpDownBase<T> ), new UIPropertyMetadata( false ) );
public bool ClipValueToMinMax public bool ClipValueToMinMax
@ -94,9 +95,9 @@ namespace Xceed.Wpf.Toolkit.Primitives
} }
} }
#endregion //ClipValueToMinMax #endregion //ClipValueToMinMax
#region DisplayDefaultValueOnEmptyText #region DisplayDefaultValueOnEmptyText
public static readonly DependencyProperty DisplayDefaultValueOnEmptyTextProperty = DependencyProperty.Register( "DisplayDefaultValueOnEmptyText", typeof( bool ), typeof( UpDownBase<T> ), new UIPropertyMetadata( false, OnDisplayDefaultValueOnEmptyTextChanged ) ); public static readonly DependencyProperty DisplayDefaultValueOnEmptyTextProperty = DependencyProperty.Register( "DisplayDefaultValueOnEmptyText", typeof( bool ), typeof( UpDownBase<T> ), new UIPropertyMetadata( false, OnDisplayDefaultValueOnEmptyTextChanged ) );
public bool DisplayDefaultValueOnEmptyText public bool DisplayDefaultValueOnEmptyText
@ -583,7 +584,7 @@ namespace Xceed.Wpf.Toolkit.Primitives
} }
} }
public bool CommitInput() public virtual bool CommitInput()
{ {
return this.SyncTextAndValueProperties( true, Text ); return this.SyncTextAndValueProperties( true, Text );
} }

21
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/DateTimeUpDown/Implementation/DateTimeUpDown.cs

@ -29,6 +29,12 @@ namespace Xceed.Wpf.Toolkit
{ {
public class DateTimeUpDown : DateTimeUpDownBase<DateTime?> public class DateTimeUpDown : DateTimeUpDownBase<DateTime?>
{ {
#region Members
private DateTime? _lastValidDate;
#endregion
#region Properties #region Properties
#region Format #region Format
@ -123,6 +129,13 @@ namespace Xceed.Wpf.Toolkit
#region Base Class Overrides #region Base Class Overrides
public override bool CommitInput()
{
bool isSyncValid = this.SyncTextAndValueProperties( true, Text );
_lastValidDate = this.Value;
return isSyncValid;
}
protected override void OnCultureInfoChanged( CultureInfo oldValue, CultureInfo newValue ) protected override void OnCultureInfoChanged( CultureInfo oldValue, CultureInfo newValue )
{ {
FormatUpdated(); FormatUpdated();
@ -209,6 +222,11 @@ namespace Xceed.Wpf.Toolkit
ParseValueIntoDateTimeInfo(); ParseValueIntoDateTimeInfo();
base.OnValueChanged( oldValue, newValue ); base.OnValueChanged( oldValue, newValue );
if( !_isTextChangedFromUI )
{
_lastValidDate = newValue;
}
} }
protected override void RaiseValueChangedEvent( DateTime? oldValue, DateTime? newValue ) protected override void RaiseValueChangedEvent( DateTime? oldValue, DateTime? newValue )
@ -701,6 +719,9 @@ namespace Xceed.Wpf.Toolkit
isValid = DateTime.TryParseExact( text, this.GetFormatString( this.Format ), this.CultureInfo, DateTimeStyles.None, out result ); isValid = DateTime.TryParseExact( text, this.GetFormatString( this.Format ), this.CultureInfo, DateTimeStyles.None, out result );
} }
if( !isValid )
result = ( _lastValidDate != null ) ? _lastValidDate.Value : current;
return isValid; return isValid;
} }

2
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/NumericUpDown/Themes/Aero2.NormalColor.xaml

@ -33,7 +33,7 @@
<Setter Property="BorderBrush" Value="{DynamicResource {x:Static themes:ResourceKeys.ControlNormalBorderKey}}" /> <Setter Property="BorderBrush" Value="{DynamicResource {x:Static themes:ResourceKeys.ControlNormalBorderKey}}" />
<Setter Property="BorderThickness" Value="1" /> <Setter Property="BorderThickness" Value="1" />
<Setter Property="HorizontalContentAlignment" Value="Right" /> <Setter Property="HorizontalContentAlignment" Value="Right" />
<Setter Property="IsTabStop" Value="False" /> <Setter Property="Focusable" Value="False" />
<Setter Property="VerticalContentAlignment" Value="Center" /> <Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="TextAlignment" Value="Right" /> <Setter Property="TextAlignment" Value="Right" />
<Setter Property="WatermarkTemplate" Value="{StaticResource DefaultWatermarkTemplate}" /> <Setter Property="WatermarkTemplate" Value="{StaticResource DefaultWatermarkTemplate}" />

2
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/NumericUpDown/Themes/Generic.xaml

@ -33,7 +33,7 @@
<Setter Property="BorderThickness" Value="1" /> <Setter Property="BorderThickness" Value="1" />
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}" /> <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}" />
<Setter Property="HorizontalContentAlignment" Value="Right" /> <Setter Property="HorizontalContentAlignment" Value="Right" />
<Setter Property="IsTabStop" Value="False" /> <Setter Property="Focusable" Value="False" />
<Setter Property="VerticalContentAlignment" Value="Center" /> <Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="TextAlignment" Value="Right" /> <Setter Property="TextAlignment" Value="Right" />
<Setter Property="WatermarkTemplate" Value="{StaticResource DefaultWatermarkTemplate}" /> <Setter Property="WatermarkTemplate" Value="{StaticResource DefaultWatermarkTemplate}" />

5
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/PropertyGrid/Implementation/Definitions/PropertyDefinitionBase.cs

@ -68,7 +68,10 @@ namespace Xceed.Wpf.Toolkit.PropertyGrid
} }
} }
_targetProperties = new ReadOnlyCollection<object>( newList ); //In Designer Mode, the Designer is broken if using a ReadOnlyCollection
_targetProperties = DesignerProperties.GetIsInDesignMode( this )
? new Collection<object>( newList )
: new ReadOnlyCollection<object>( newList ) as IList;
} }
} }
} }

11
Main/Source/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/PropertyGrid/Implementation/ObjectContainerHelperBase.cs

@ -346,8 +346,14 @@ namespace Xceed.Wpf.Toolkit.PropertyGrid
DescriptorPropertyDefinitionBase pd = propertyItem.DescriptorDefinition; DescriptorPropertyDefinitionBase pd = propertyItem.DescriptorDefinition;
object definitionKey = null; object definitionKey = null;
Type definitionKeyAsType = definitionKey as Type; Type definitionKeyAsType = definitionKey as Type;
ITypeEditor editor = null;
if( pd.IsReadOnly )
editor = new TextBlockEditor();
if( editor == null )
editor = pd.CreateAttributeEditor();
ITypeEditor editor = pd.CreateAttributeEditor();
if( editor != null ) if( editor != null )
editorElement = editor.ResolveEditor( propertyItem ); editorElement = editor.ResolveEditor( propertyItem );
@ -360,9 +366,6 @@ namespace Xceed.Wpf.Toolkit.PropertyGrid
if( editorElement == null ) if( editorElement == null )
{ {
if( pd.IsReadOnly )
editor = new TextBlockEditor();
// Fallback: Use a default type editor. // Fallback: Use a default type editor.
if( editor == null ) if( editor == null )
{ {

2
Main/Source/ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/CollectionControl/Implementation/CollectionControlDialog.xaml.cs

@ -108,11 +108,13 @@ namespace Xceed.Wpf.Toolkit
private void OkButton_Click( object sender, RoutedEventArgs e ) private void OkButton_Click( object sender, RoutedEventArgs e )
{ {
_propertyGrid.PersistChanges(); _propertyGrid.PersistChanges();
this.DialogResult = true;
Close(); Close();
} }
private void CancelButton_Click( object sender, RoutedEventArgs e ) private void CancelButton_Click( object sender, RoutedEventArgs e )
{ {
this.DialogResult = false;
Close(); Close();
} }

11
Main/Source/ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/Core/Primitives/UpDownBase.cs

@ -41,11 +41,12 @@ namespace Xceed.Wpf.Toolkit.Primitives
/// </summary> /// </summary>
internal const string PART_Spinner = "PART_Spinner"; internal const string PART_Spinner = "PART_Spinner";
internal bool _isTextChangedFromUI;
/// <summary> /// <summary>
/// Flags if the Text and Value properties are in the process of being sync'd /// Flags if the Text and Value properties are in the process of being sync'd
/// </summary> /// </summary>
private bool _isSyncingTextAndValueProperties; private bool _isSyncingTextAndValueProperties;
private bool _isTextChangedFromUI;
#endregion //Members #endregion //Members
@ -79,7 +80,7 @@ namespace Xceed.Wpf.Toolkit.Primitives
#endregion //AllowSpin #endregion //AllowSpin
#region ClipValueToMinMax #region ClipValueToMinMax
public static readonly DependencyProperty ClipValueToMinMaxProperty = DependencyProperty.Register( "ClipValueToMinMax", typeof( bool ), typeof( UpDownBase<T> ), new UIPropertyMetadata( false ) ); public static readonly DependencyProperty ClipValueToMinMaxProperty = DependencyProperty.Register( "ClipValueToMinMax", typeof( bool ), typeof( UpDownBase<T> ), new UIPropertyMetadata( false ) );
public bool ClipValueToMinMax public bool ClipValueToMinMax
@ -94,9 +95,9 @@ namespace Xceed.Wpf.Toolkit.Primitives
} }
} }
#endregion //ClipValueToMinMax #endregion //ClipValueToMinMax
#region DisplayDefaultValueOnEmptyText #region DisplayDefaultValueOnEmptyText
public static readonly DependencyProperty DisplayDefaultValueOnEmptyTextProperty = DependencyProperty.Register( "DisplayDefaultValueOnEmptyText", typeof( bool ), typeof( UpDownBase<T> ), new UIPropertyMetadata( false, OnDisplayDefaultValueOnEmptyTextChanged ) ); public static readonly DependencyProperty DisplayDefaultValueOnEmptyTextProperty = DependencyProperty.Register( "DisplayDefaultValueOnEmptyText", typeof( bool ), typeof( UpDownBase<T> ), new UIPropertyMetadata( false, OnDisplayDefaultValueOnEmptyTextChanged ) );
public bool DisplayDefaultValueOnEmptyText public bool DisplayDefaultValueOnEmptyText
@ -583,7 +584,7 @@ namespace Xceed.Wpf.Toolkit.Primitives
} }
} }
public bool CommitInput() public virtual bool CommitInput()
{ {
return this.SyncTextAndValueProperties( true, Text ); return this.SyncTextAndValueProperties( true, Text );
} }

21
Main/Source/ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/DateTimeUpDown/Implementation/DateTimeUpDown.cs

@ -29,6 +29,12 @@ namespace Xceed.Wpf.Toolkit
{ {
public class DateTimeUpDown : DateTimeUpDownBase<DateTime?> public class DateTimeUpDown : DateTimeUpDownBase<DateTime?>
{ {
#region Members
private DateTime? _lastValidDate;
#endregion
#region Properties #region Properties
#region Format #region Format
@ -123,6 +129,13 @@ namespace Xceed.Wpf.Toolkit
#region Base Class Overrides #region Base Class Overrides
public override bool CommitInput()
{
bool isSyncValid = this.SyncTextAndValueProperties( true, Text );
_lastValidDate = this.Value;
return isSyncValid;
}
protected override void OnCultureInfoChanged( CultureInfo oldValue, CultureInfo newValue ) protected override void OnCultureInfoChanged( CultureInfo oldValue, CultureInfo newValue )
{ {
FormatUpdated(); FormatUpdated();
@ -209,6 +222,11 @@ namespace Xceed.Wpf.Toolkit
ParseValueIntoDateTimeInfo(); ParseValueIntoDateTimeInfo();
base.OnValueChanged( oldValue, newValue ); base.OnValueChanged( oldValue, newValue );
if( !_isTextChangedFromUI )
{
_lastValidDate = newValue;
}
} }
protected override void RaiseValueChangedEvent( DateTime? oldValue, DateTime? newValue ) protected override void RaiseValueChangedEvent( DateTime? oldValue, DateTime? newValue )
@ -701,6 +719,9 @@ namespace Xceed.Wpf.Toolkit
isValid = DateTime.TryParseExact( text, this.GetFormatString( this.Format ), this.CultureInfo, DateTimeStyles.None, out result ); isValid = DateTime.TryParseExact( text, this.GetFormatString( this.Format ), this.CultureInfo, DateTimeStyles.None, out result );
} }
if( !isValid )
result = ( _lastValidDate != null ) ? _lastValidDate.Value : current;
return isValid; return isValid;
} }

2
Main/Source/ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/NumericUpDown/Themes/Aero2.NormalColor.xaml

@ -33,7 +33,7 @@
<Setter Property="BorderBrush" Value="{DynamicResource {x:Static themes:ResourceKeys.ControlNormalBorderKey}}" /> <Setter Property="BorderBrush" Value="{DynamicResource {x:Static themes:ResourceKeys.ControlNormalBorderKey}}" />
<Setter Property="BorderThickness" Value="1" /> <Setter Property="BorderThickness" Value="1" />
<Setter Property="HorizontalContentAlignment" Value="Right" /> <Setter Property="HorizontalContentAlignment" Value="Right" />
<Setter Property="IsTabStop" Value="False" /> <Setter Property="Focusable" Value="False" />
<Setter Property="VerticalContentAlignment" Value="Center" /> <Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="TextAlignment" Value="Right" /> <Setter Property="TextAlignment" Value="Right" />
<Setter Property="WatermarkTemplate" Value="{StaticResource DefaultWatermarkTemplate}" /> <Setter Property="WatermarkTemplate" Value="{StaticResource DefaultWatermarkTemplate}" />

2
Main/Source/ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/NumericUpDown/Themes/Generic.xaml

@ -33,7 +33,7 @@
<Setter Property="BorderThickness" Value="1" /> <Setter Property="BorderThickness" Value="1" />
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}" /> <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}" />
<Setter Property="HorizontalContentAlignment" Value="Right" /> <Setter Property="HorizontalContentAlignment" Value="Right" />
<Setter Property="IsTabStop" Value="False" /> <Setter Property="Focusable" Value="False" />
<Setter Property="VerticalContentAlignment" Value="Center" /> <Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="TextAlignment" Value="Right" /> <Setter Property="TextAlignment" Value="Right" />
<Setter Property="WatermarkTemplate" Value="{StaticResource DefaultWatermarkTemplate}" /> <Setter Property="WatermarkTemplate" Value="{StaticResource DefaultWatermarkTemplate}" />

5
Main/Source/ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/PropertyGrid/Implementation/Definitions/PropertyDefinitionBase.cs

@ -68,7 +68,10 @@ namespace Xceed.Wpf.Toolkit.PropertyGrid
} }
} }
_targetProperties = new ReadOnlyCollection<object>( newList ); //In Designer Mode, the Designer is broken if using a ReadOnlyCollection
_targetProperties = DesignerProperties.GetIsInDesignMode( this )
? new Collection<object>( newList )
: new ReadOnlyCollection<object>( newList ) as IList;
} }
} }
} }

11
Main/Source/ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/PropertyGrid/Implementation/ObjectContainerHelperBase.cs

@ -346,8 +346,14 @@ namespace Xceed.Wpf.Toolkit.PropertyGrid
DescriptorPropertyDefinitionBase pd = propertyItem.DescriptorDefinition; DescriptorPropertyDefinitionBase pd = propertyItem.DescriptorDefinition;
object definitionKey = null; object definitionKey = null;
Type definitionKeyAsType = definitionKey as Type; Type definitionKeyAsType = definitionKey as Type;
ITypeEditor editor = null;
if( pd.IsReadOnly )
editor = new TextBlockEditor();
if( editor == null )
editor = pd.CreateAttributeEditor();
ITypeEditor editor = pd.CreateAttributeEditor();
if( editor != null ) if( editor != null )
editorElement = editor.ResolveEditor( propertyItem ); editorElement = editor.ResolveEditor( propertyItem );
@ -360,9 +366,6 @@ namespace Xceed.Wpf.Toolkit.PropertyGrid
if( editorElement == null ) if( editorElement == null )
{ {
if( pd.IsReadOnly )
editor = new TextBlockEditor();
// Fallback: Use a default type editor. // Fallback: Use a default type editor.
if( editor == null ) if( editor == null )
{ {

Loading…
Cancel
Save