Browse Source

pull/1242/head
BoucherS_cp 12 years ago
parent
commit
ac5ca4f242
  1. 6
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/AutoSelectTextboxView.xaml.txt
  2. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/AvalonDockView.xaml.txt
  3. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/BusyIndicatorCustomContentTemplateView.xaml.txt
  4. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/BusyIndicatorCustomContentView.xaml.txt
  5. 6
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ButtonSpinnerView.xaml.txt
  6. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/CalculatorView.xaml.txt
  7. 95
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartAxisView.xaml.cs.txt
  8. 199
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartAxisView.xaml.txt
  9. 3
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartLegendView.xaml.cs.txt
  10. 133
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartLegendView.xaml.txt
  11. 122
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartSeriesBasicTypesView.xaml.cs.txt
  12. 139
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartSeriesBasicTypesView.xaml.txt
  13. 3
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartSeriesDataPointsBindingView.xaml.cs.txt
  14. 46
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartSeriesDataPointsBindingView.xaml.txt
  15. 3
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingAxesGridView.xaml.cs.txt
  16. 184
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingAxesGridView.xaml.txt
  17. 3
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingColumnSeriesView.xaml.cs.txt
  18. 175
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingColumnSeriesView.xaml.txt
  19. 12
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingLineSeriesView.xaml.cs.txt
  20. 141
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingLineSeriesView.xaml.txt
  21. 3
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingPieSeriesView.xaml.cs.txt
  22. 173
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingPieSeriesView.xaml.txt
  23. 12
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/CheckListsView.xaml.txt
  24. 8
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChildWindowView.xaml.txt
  25. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ColorView.xaml.txt
  26. 32
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/DataGridView.xaml.txt
  27. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/DateTimeView.xaml.txt
  28. 40
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/DisplayLocalizationRes.Designer.cs.txt
  29. 159
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/DisplayLocalizationRes.fr.resx.txt
  30. 159
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/DisplayLocalizationRes.resx.txt
  31. 4
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/DropDownSplitButtonView.xaml.txt
  32. 8
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ListBoxView.xaml.cs.txt
  33. 1099
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ListBoxView.xaml.txt
  34. 4
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MagnifierView.xaml.txt
  35. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaskedTextboxView.xaml.txt
  36. 25
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MultiColumnComboBoxView.xaml.cs.txt
  37. 136
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MultiColumnComboBoxView.xaml.txt
  38. 4
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MultiLineTextEditorView.xaml.txt
  39. 18
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/NumericView.xaml.txt
  40. 4
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PieChartView.xaml.txt
  41. 4
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PieProgressView.xaml.txt
  42. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PieView.xaml.txt
  43. 124
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PileFlowPanelView.xaml.cs.txt
  44. 312
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PileFlowPanelView.xaml.txt
  45. 6
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridAttributesView.xaml.cs.txt
  46. 6
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridAttributesView.xaml.txt
  47. 4
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridBindingToStructsView.xaml.txt
  48. 6
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridCategoryOrderView.xaml.txt
  49. 4
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridCustomEditorsView.xaml.txt
  50. 11
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridCustomPropertyView.xaml.cs.txt
  51. 63
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridCustomPropertyView.xaml.txt
  52. 4
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridDefaultEditorsView.xaml.txt
  53. 20
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridDefinitionKeyView.xaml.cs.txt
  54. 18
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridDefinitionKeyView.xaml.txt
  55. 93
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridDisplayLocalizationView.xaml.cs.txt
  56. 37
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridDisplayLocalizationView.xaml.txt
  57. 45
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridEditorDefinitionsView.xaml.cs.txt
  58. 101
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridEditorDefinitionsView.xaml.txt
  59. 3
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridMultiSelectedObjectsView.xaml.cs.txt
  60. 37
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridMultiSelectedObjectsView.xaml.txt
  61. 52
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridPropertiesSourceView.xaml.cs.txt
  62. 61
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridPropertiesSourceView.xaml.txt
  63. 12
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridPropertiesView.xaml.cs.txt
  64. 73
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridPropertiesView.xaml.txt
  65. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridPropertyItemStyleView.xaml.cs.txt
  66. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridPropertyItemStyleView.xaml.txt
  67. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridSpecifyingPropertiesView.xaml.cs.txt
  68. 18
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridSpecifyingPropertiesView.xaml.txt
  69. 6
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridView.xaml.txt
  70. 23
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/RadialGaugeView.xaml.cs.txt
  71. 1023
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/RadialGaugeView.xaml.txt
  72. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/RangeSliderView.xaml.txt
  73. 33
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/RatingView.xaml.cs.txt
  74. 432
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/RatingView.xaml.txt
  75. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/RichTextboxView.xaml.txt
  76. 68
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/StylableWindowView.xaml.cs.txt
  77. 42
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/StylableWindowView.xaml.txt
  78. 470
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/SwitchPanelView.xaml.cs.txt
  79. 908
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/SwitchPanelView.xaml.txt
  80. 129
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingAvalonDockView.xaml.cs.txt
  81. 352
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingAvalonDockView.xaml.txt
  82. 158
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingCoreWPFView.xaml.cs.txt
  83. 1035
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingCoreWPFView.xaml.txt
  84. 94
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingDataGridView.xaml.cs.txt
  85. 539
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingDataGridView.xaml.txt
  86. 99
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingExtendedToolkitView.xaml.cs.txt
  87. 504
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingExtendedToolkitView.xaml.txt
  88. 154
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingListBoxView.xaml.cs.txt
  89. 363
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingListBoxView.xaml.txt
  90. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/TimeSpanView.xaml.txt
  91. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/TimelinePanelView.xaml.txt
  92. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/WatermarkTextboxView.xaml.txt
  93. 1
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/WindowContainerView.xaml.cs.txt
  94. 22
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/WindowContainerView.xaml.txt
  95. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/WizardView.xaml.txt
  96. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ZoomboxView.xaml.txt
  97. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/CollectionControl/Implementation/CollectionControlDialog.xaml.cs
  98. 13
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Core/Primitives/UpDownBase.cs
  99. 21
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/DateTimeUpDown/Implementation/DateTimeUpDown.cs
  100. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/NumericUpDown/Themes/Aero2.NormalColor.xaml

6
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/AutoSelectTextboxView.xaml.txt

@ -24,7 +24,7 @@
The AutoSelectTextBox allows the text content to be selected when the control get the focus. It also allows the Focus navigation behavior within the control to be affected.
</Paragraph>
</local:DemoView.Description>
<StackPanel>
<StackPanel.Resources>
<Style TargetType="{x:Type xctk:AutoSelectTextBox}">
@ -54,7 +54,7 @@
</StackPanel>
</Grid>
</GroupBox>
<StackPanel>
<TextBlock Text="Usage:" Style="{StaticResource Header}"/>
<RichTextBox IsReadOnly="True" BorderThickness="0">
@ -75,7 +75,7 @@
</Paragraph>
</FlowDocument>
</RichTextBox>
<!-- PHONE NUMBER FIELDS -->
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<TextBlock Text="(" VerticalAlignment="Center"/>

2
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/AvalonDockView.xaml.txt

@ -26,7 +26,7 @@
The AvalonDock layout system allows developers to create customizable layouts using a window docking system similar to what is found in many popular integrated development environements.
</Paragraph>
</local:DemoView.Description>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />

2
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/BusyIndicatorCustomContentTemplateView.xaml.txt

@ -24,7 +24,7 @@
This example demonstrates how to create a custom content template by setting the BusyContentTemplate property to an instance of a custom DataTemplate. Take notice of how the default ProgressBar is being hidden by setting the PrgressBarStyle property. The default OverlayStyle is also being set to a custom style.
</Paragraph>
</local:DemoView.Description>
<local:DemoView.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>

2
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/BusyIndicatorCustomContentView.xaml.txt

@ -24,7 +24,7 @@
This example demonstrates how to define your own custom content. This is done by setting the BusyContent property.
</Paragraph>
</local:DemoView.Description>
<local:DemoView.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>

6
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ButtonSpinnerView.xaml.txt

@ -25,9 +25,9 @@
The ButtonSpinner control allows you to add button spinners to any element and then respond to the Spin event to manipulate that element. The Spin event lets the developer know which direction the buttons are spinning; SpinDirection.Increase indicates an increment, SpinDirection.Decrease indicates a decrement.
</Paragraph>
</local:DemoView.Description>
<local:DemoView.Resources>
<x:Array x:Key="names" Type="s:String">
<s:String>John Smith</s:String>
<s:String>Janel Leverling</s:String>
@ -40,7 +40,7 @@
<s:String>Naomi Suyama</s:String>
</x:Array>
</local:DemoView.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />

2
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/CalculatorView.xaml.txt

@ -24,7 +24,7 @@
The Calculator is a control used for performing mathematical calculations.
</Paragraph>
</local:DemoView.Description>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />

95
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.Controls;
using System;
@ -26,33 +29,119 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Chart.Views
/// </summary>
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
public ChartAxisView()
{
InitializeComponent();
#if !OPEN_SOURCE
_axisComboBox.SelectedIndex = 0;
_xAxis.DateTimeFormat = System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern;
#endif
}
#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
#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
}
}

199
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartAxisView.xaml.txt

@ -25,29 +25,196 @@
<local:DemoView.Description>
<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>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak />
<Run>This feature is only available in the "Plus" version.</Run>
<LineBreak />
<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.
</Hyperlink>
##END-->
</Paragraph>
</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"/>
##END-->
</local:DemoView>

3
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.Diagnostics;
namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Chart.Views

133
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartLegendView.xaml.txt

@ -28,24 +28,135 @@
<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>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak />
<Run>This feature is only available in the "Plus" version.</Run>
<LineBreak />
<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.
</Hyperlink>
##END-->
</Paragraph>
</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"/>
##END-->
</local:DemoView>

122
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;
using Xceed.Wpf.Toolkit.Panels;
@ -26,8 +29,16 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Chart.Views
/// </summary>
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
@ -38,15 +49,126 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Chart.Views
#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
#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
}

139
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartSeriesBasicTypesView.xaml.txt

@ -25,26 +25,139 @@
<local:DemoView.Description>
<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>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak />
<Run>This feature is only available in the "Plus" version.</Run>
<LineBreak />
<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.
</Hyperlink>
##END-->
</Paragraph>
</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"/>
##END-->
</local:DemoView>

3
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;
using System.Collections.ObjectModel;

46
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartSeriesDataPointsBindingView.xaml.txt

@ -26,17 +26,57 @@
<local:DemoView.Description>
<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>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak />
<Run>This feature is only available in the "Plus" version.</Run>
<LineBreak />
<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.
</Hyperlink>
##END-->
</Paragraph>
</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"/>
##END-->
</local:DemoView>

3
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.Controls;
using System;

184
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingAxesGridView.xaml.txt

@ -24,32 +24,178 @@
<local:DemoView.Description>
<Paragraph FontSize="14" FontFamily="Segoe">
<Run>This sample shows how AxesGrid elements can be styled using a DataTemplate.</Run>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak />
<Run>This feature is only available in the "Plus" version.</Run>
<LineBreak />
<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.
</Hyperlink>
##END-->
</Paragraph>
</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"/>
##END-->
</local:DemoView>

3
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.Controls;
using System.Diagnostics;

175
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingColumnSeriesView.xaml.txt

@ -25,26 +25,175 @@
<local:DemoView.Description>
<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>
<!--##EXCLUDE_OPEN_SOURCE-->
<Run>Please move mouse on line and markers to see simple effects.</Run>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<LineBreak />
<Run>This feature is only available in the "Plus" version.</Run>
<LineBreak />
<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.
</Hyperlink>
##END-->
</Paragraph>
</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"/>
##END-->
</local:DemoView>

12
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.Controls;
using System.Windows;
@ -31,7 +34,16 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Chart.Views
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
}
}

141
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingLineSeriesView.xaml.txt

@ -24,23 +24,144 @@
<local:DemoView.Description>
<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>
<!--##EXCLUDE_OPEN_SOURCE-->
<Run>Please move mouse along the line and over the markers to see simple effects.</Run>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<LineBreak />
<Run>This feature is only available in the "Plus" version.</Run>
<LineBreak />
<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.
</Hyperlink>
##END-->
</Paragraph>
</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"/>
##END-->
</local:DemoView>

3
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.Controls;
using System;

173
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingPieSeriesView.xaml.txt

@ -24,26 +24,175 @@
<local:DemoView.Description>
<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>
<!--##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 />
<Run>This feature is only available in the "Plus" version.</Run>
<LineBreak />
<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.
</Hyperlink>
##END-->
</Paragraph>
</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"/>
##END-->
</local:DemoView>

12
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/CheckListsView.xaml.txt

@ -26,7 +26,7 @@
The CheckListBox and CheckComboBox controls represent a list of selected items that are displayed as CheckBoxes. Besides the common SelectedItem and SelectedItems properties, these controls give developers more alternatives for managing and handling selections.
</Paragraph>
</local:DemoView.Description>
<local:DemoView.Resources>
<x:Array x:Key="personProperties" Type="s:String">
<s:String>ID</s:String>
@ -34,7 +34,7 @@
<s:String>LastName</s:String>
</x:Array>
</local:DemoView.Resources>
<Grid >
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
@ -56,7 +56,7 @@
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Row="0" Grid.Column="0"
Text="Delimiter:"
Margin="2,5,5,5"/>
@ -98,7 +98,7 @@
HorizontalAlignment="Left"
IsEnabled="False"
Text="IsSelected" />
<TextBlock Grid.Row="1" Grid.Column="2"
Text="DisplayMemberPath:"
Margin="5"/>
@ -137,12 +137,12 @@
</StackPanel>
</Grid>
</GroupBox>
<GroupBox Header="Item Models" Grid.Row="1" Margin="5">
<ListBox DisplayMemberPath="ModelDisplay" FontFamily="Global Monospace"
ItemsSource="{Binding}"/>
</GroupBox>
<Grid Grid.Row="2">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />

8
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChildWindowView.xaml.txt

@ -25,6 +25,7 @@
<local:DemoView.Description>
<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>
<!--##INCLUDE_OPEN_SOURCE
<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>
@ -32,13 +33,14 @@
<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.
</Hyperlink>
##END-->
</Paragraph>
</local:DemoView.Description>
<local:DemoView.Resources>
<conv:IntToBoolConverter x:Key="IntToBoolConverter" />
<xctkconv:VisibilityToBoolConverter x:Key="VisibilityToBoolConverter" Inverted="True"/>
<ObjectDataProvider x:Key="WindowStates" MethodName="GetValues"
ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
@ -52,7 +54,7 @@
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
</local:DemoView.Resources>
<Grid>
<Grid.RowDefinitions>
@ -82,7 +84,7 @@
<TextBlock Grid.Row="2" Name="textBlock3" Text="Top:" Margin="2" VerticalAlignment="Center" IsEnabled="{Binding IsEnabled, ElementName=_txtTop}" Style="{StaticResource DisableGrayText}"/>
<xctk:DoubleUpDown x:Name="_txtTop" Grid.Column="1" Grid.Row="2" Value="0" Minimum="0" VerticalAlignment="Center" Margin="5" IsEnabled="{Binding SelectedIndex, ElementName=_cboWindowStartupLocations}"/>
<TextBlock Text="IsModal:" VerticalAlignment="Center" Margin="10,2,2,2" Grid.Column="2" />
<CheckBox x:Name="_chkIsModal" Grid.Column="3" VerticalAlignment="Center" Margin="5" IsChecked="True" />

2
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ColorView.xaml.txt

@ -39,7 +39,7 @@
</Trigger>
</Style.Triggers>
</Style>
<ObjectDataProvider x:Key="ColorModeOptions" MethodName="GetValues"
ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>

32
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/DataGridView.xaml.txt

@ -33,12 +33,12 @@
</Hyperlink>
</Paragraph>
</local:DemoView.Description>
<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"
@ -59,13 +59,13 @@
</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"
@ -82,9 +82,9 @@
VerticalAlignment="Center" />
</StackPanel>
</DataTemplate>
</local:DemoView.Resources>
<Grid>
<Grid.Resources>
<xcdg:DataGridCollectionViewSource x:Key="cvsOrders"
@ -108,38 +108,38 @@
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" />
@ -147,7 +147,7 @@
<xcdg:Column FieldName="ShipPostalCode"
Title="Postal Code"
Width="120" />
<xcdg:Column FieldName="RequiredDate"
Title="Required Date"
Width="140" />
@ -155,7 +155,7 @@
<xcdg:Column FieldName="ShippedDate"
Title="Shipped Date"
Width="140" />
<xcdg:Column FieldName="ShipName"
Visible="False" />

2
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/DateTimeView.xaml.txt

@ -27,7 +27,7 @@
The DateTimePicker and TimePicker controls let you select the date and the time in several ways. The TimePicker is used in the DateTimePicker.
</Paragraph>
</local:DemoView.Description>
<local:DemoView.Resources>
<conv:DateTimeToTimeSpanConverter x:Key="dateTimeToTimeSpanConverter" />
<conv:CustomFormatToBoolConverter x:Key="CustomFormatToBoolConverter" />

40
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/DisplayLocalizationRes.Designer.cs.txt

@ -10,8 +10,8 @@
namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
@ -23,15 +23,15 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class DisplayLocalizationRes {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal DisplayLocalizationRes() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
@ -45,7 +45,7 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views {
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
@ -59,7 +59,7 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized string similar to Details.
/// </summary>
@ -68,7 +68,7 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views {
return ResourceManager.GetString("DetailsCategory", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Favorite actor 1 (no DisplayName).
/// </summary>
@ -77,7 +77,7 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views {
return ResourceManager.GetString("FavoriteActor1", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to This property&apos;s type is an enum whose values have no DisplayName attributes. These values displayed are provided by the ToString() method..
/// </summary>
@ -86,7 +86,7 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views {
return ResourceManager.GetString("FavoriteActor1Desc", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Favorite actor 2 (with DisplayName).
/// </summary>
@ -95,7 +95,7 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views {
return ResourceManager.GetString("FavoriteActor2", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to This property&apos;s type is an enum whose values are decorated with the ExtendedDisplayName attribute. Combined with the EnumDisplayNameConverter, this allows display values to be customized..
/// </summary>
@ -104,7 +104,7 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views {
return ResourceManager.GetString("FavoriteActor2Desc", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Favorite actor 3.
/// </summary>
@ -113,7 +113,7 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views {
return ResourceManager.GetString("FavoriteActor3", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to &quot;(Not listed)&quot; enum value shows that enum values can also be localized..
/// </summary>
@ -122,7 +122,7 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views {
return ResourceManager.GetString("FavoriteActor3Desc", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to First name.
/// </summary>
@ -131,7 +131,7 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views {
return ResourceManager.GetString("FirstName", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to First name of that person.
/// </summary>
@ -140,7 +140,7 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views {
return ResourceManager.GetString("FirstNameDesc", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Information.
/// </summary>
@ -149,7 +149,7 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views {
return ResourceManager.GetString("InfoCategory", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Last name.
/// </summary>
@ -158,7 +158,7 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views {
return ResourceManager.GetString("LastName", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Usually the familly name of the person.
/// </summary>
@ -167,7 +167,7 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views {
return ResourceManager.GetString("LastNameDesc", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to (Not listed).
/// </summary>

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

4
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/DropDownSplitButtonView.xaml.txt

@ -27,7 +27,7 @@
<Run>The SplitButton control is a button that can be clicked and also provides a drop down in which you can place any custom content within.</Run>
</Paragraph>
</local:DemoView.Description>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
@ -53,7 +53,7 @@
</StackPanel>
</xctk:DropDownButton.DropDownContent>
</xctk:DropDownButton>
<TextBlock Text="SplitButton Usage:" Grid.Column="1" Style="{StaticResource Header}" />
<xctk:SplitButton x:Name="_splitButton"
Grid.Row="1"

8
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()
{
#if !OPEN_SOURCE
this.DataContext = SampleDataProvider.GetOrders();
#endif
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

1099
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ListBoxView.xaml.txt

File diff suppressed because it is too large

4
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MagnifierView.xaml.txt

@ -27,7 +27,7 @@
The Magnifier control allows the user to magnify parts of an application.
</Paragraph>
</local:DemoView.Description>
<local:DemoView.Resources>
<conv:ColorConverter x:Key="colorConverter" />
<conv:VisibilityConverter x:Key="visibilityConverter" />
@ -39,7 +39,7 @@
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
</local:DemoView.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />

2
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaskedTextboxView.xaml.txt

@ -25,7 +25,7 @@
The MaskedTextBox control lets you display and edit values based on a mask.
</Paragraph>
</local:DemoView.Description>
<Grid>
<Grid.RowDefinitions>

25
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()
{
#if !OPEN_SOURCE
this.DataContext = SampleDataProvider.GetOrders();
#endif
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
}
}

136
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MultiColumnComboBoxView.xaml.txt

@ -24,25 +24,137 @@
<local:DemoView.Description>
<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>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak />
<Run>This Control is only available in the "Plus" version.</Run>
<LineBreak />
<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.
</Hyperlink>
##END-->
</Paragraph>
</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"/>
##END-->
</local:DemoView>

4
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MultiLineTextEditorView.xaml.txt

@ -26,7 +26,7 @@
The MultiLineTextEditor is a TextBox that allows you to edit text that is too long to display in a regular TextBox. The popup is resizable to accommodate any text.
</Paragraph>
</local:DemoView.Description>
<local:DemoView.Resources>
<DataTemplate x:Key="multiLineTextEditorStyle" >
<xctk:MultiLineTextEditor
@ -38,7 +38,7 @@
Height="24" />
</DataTemplate>
</local:DemoView.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />

18
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/NumericView.xaml.txt

@ -35,7 +35,7 @@
<Run>All these numeric types support the following properties.</Run>
</Paragraph>
</local:DemoView.Description>
<local:DemoView.Resources>
<x:Array x:Key="FormatStringComboBox" Type="numeric:FormatObject">
<numeric:FormatObject Value="C2" DisplayValue="Currency" />
@ -69,12 +69,12 @@
</Trigger>
</Style.Triggers>
</Style>
<sys:String x:Key="allowInputSpecialValuesTooltip">Infinity and -Infinity input will not be accepted if Maximum and/or Minimum values does not allow them.</sys:String>
<sys:String x:Key="parsingNumberStyleTooltip">HexNumber is not a valid choice when used with a DoubleUpDown (current control used in this sample). It will work with the following controls: IntegerUpDown, ByteUpDown, LongUpDown, and ShortUpDown.</sys:String>
</local:DemoView.Resources>
<StackPanel>
<Grid>
<Grid.RowDefinitions>
@ -105,7 +105,7 @@
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="125" />
</Grid.ColumnDefinitions>
<!-- 1st column -->
<TextBlock Text="Mouse Wheel:" Grid.Row="0" VerticalAlignment="Center" />
<ComboBox Grid.Row="0" Grid.Column="1" SelectedItem="{Binding MouseWheelActiveTrigger, ElementName=_doubleUpDown}" Margin="5" VerticalAlignment="Center" >
@ -125,7 +125,7 @@
<TextBlock Text="Is Read Only:" Grid.Row="4" VerticalAlignment="Center" />
<CheckBox Grid.Row="4" Grid.Column="1" IsChecked="{Binding IsReadOnly, ElementName=_doubleUpDown}" ClickMode="Press" Margin="5" VerticalAlignment="Center" />
<TextBlock Text="DisplayDefaultValueOnEmptyText:" Grid.Row="5" VerticalAlignment="Center" />
<CheckBox Grid.Row="5" Grid.Column="1" IsChecked="{Binding DisplayDefaultValueOnEmptyText, ElementName=_doubleUpDown}" ClickMode="Press" Margin="5" VerticalAlignment="Center" />
@ -160,7 +160,7 @@
<TextBlock Text="Text:" Grid.Column="4" Grid.Row="4" VerticalAlignment="Center" Margin="10,0,0,0"/>
<TextBox Grid.Column="5" Grid.Row="4" Text="{Binding Text, ElementName=_doubleUpDown}" VerticalAlignment="Center" HorizontalAlignment="Stretch" Margin="5" />
<!-- last rows -->
<TextBlock Text="(DoubleUpDown and SingleUpDown support the AllowInputSpecialValues property)" Grid.Row="6" Grid.ColumnSpan="6" VerticalAlignment="Center" Margin="0,5,0,0"/>
<TextBlock Text="Allow Input Special Values:" VerticalAlignment="Center" Grid.Row="7" Grid.ColumnSpan="2"/>
@ -189,11 +189,11 @@
DefaultValue="10"
Value="25" />
</StackPanel>
<TextBlock Grid.Row="2" Margin="10,15,0,0"
Text="CalculatorUpDown is a DecimalUpDown with all the properties from a NumericUpDown. It provides a Calculator dropdown which allows you to perform mathematical calculations."
TextWrapping="Wrap" />
<GroupBox Header="CalculatorUpDown Features" Grid.Row="3" Margin="5,15,0,0">
<StackPanel Orientation="Horizontal" Margin="5" HorizontalAlignment="Left">
<TextBlock Text="Enter closes calculator:" VerticalAlignment="Center" />
@ -202,7 +202,7 @@
<xctk:IntegerUpDown Width="75" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" Minimum="0" Value="{Binding Precision, ElementName=_calculatorUpDown}" ToolTip="Gets/Sets the maximum number of digits displayed to the right of the decimal point." />
</StackPanel>
</GroupBox>
<StackPanel Grid.Row="4" Orientation="Horizontal" Margin="10" HorizontalAlignment="Left">
<TextBlock Text="CalculatorUpDown Usage:" Style="{StaticResource Header}" />
<xctk:CalculatorUpDown x:Name="_calculatorUpDown"

4
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PieChartView.xaml.txt

@ -25,8 +25,8 @@
Obviously, the Pie control can be used to create a pie chart.
</Paragraph>
</local:DemoView.Description>
<local:DemoView.Resources>
<XmlDataProvider x:Key="XMLData">
<x:XData>

4
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PieProgressView.xaml.txt

@ -24,7 +24,7 @@
The Pie control properties can be animated to create various effects and controls like this circular progress bar.
</Paragraph>
</local:DemoView.Description>
<local:DemoView.Resources>
<ControlTemplate x:Key="PieProgressTemplate"
TargetType="{x:Type ProgressBar}">
@ -69,7 +69,7 @@
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</local:DemoView.Resources>
<local:DemoView.Triggers>
<EventTrigger RoutedEvent="ButtonBase.Click"
SourceName="SimulateProgressButton">

2
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PieView.xaml.txt

@ -25,7 +25,7 @@
The Pie shape is a WPF shape that represents a portion of an ellipse. It is in the same shape as a slice of pie (hence the name). More precisely, the Pie shape is represented as either a full ellipse (Slice = 1.0), nothing (Slice = 0.0), or an arc of an ellipse joined to its center by two line segments.
</Paragraph>
</local:DemoView.Description>
<local:DemoView.Resources>
<xctk:ColorToSolidColorBrushConverter x:Key="colorConverter" />
</local:DemoView.Resources>

124
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()
{
#if !OPEN_SOURCE
this.DataContext = SampleDataProvider.SharedEmployees;
#endif
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
#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
#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
}

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

@ -31,40 +31,300 @@
<LineBreak />
<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 />
<Run>This feature is only available in the "Plus" version.</Run>
<LineBreak />
<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.
</Hyperlink>
##END-->
</Paragraph>
</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"/>
##END-->
</local:DemoView>

6
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridAttributesView.xaml.cs.txt

@ -33,7 +33,7 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views
public PropertyGridAttributesView()
{
InitializeComponent();
var person = new Man();
person.FirstName = "John";
person.LastName = "Doe";
@ -53,6 +53,9 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views
[CategoryOrder("Information", 0)]
[CategoryOrder( "Conections", 1 )]
[CategoryOrder( "Other", 2 )]
#if !OPEN_SOURCE
[ExpandedCategory( "Conections", false )]
#endif
public abstract class Person
{
// 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; }
[Category( "Other" )]
//# TODODOC
[Description( "This property uses the [Browsable(false)] attribute to not display the property" )]
[BrowsableAttribute( false )]
public string InvisibleProperty

6
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridAttributesView.xaml.txt

@ -69,7 +69,7 @@
LocalizedDescriptionAttribute
</Paragraph>
</local:DemoView.Description>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
@ -87,10 +87,10 @@
FontStyle="Italic"
Margin="0,10,0,0"/>
</StackPanel>
<xctk:PropertyGrid Grid.Row="1" x:Name="_propertyGrid" Width="450" MaxHeight="650" Margin="10"
SelectedObject="{Binding}">
</xctk:PropertyGrid>
</Grid>
</local:DemoView>

4
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridBindingToStructsView.xaml.txt

@ -31,13 +31,13 @@
<local:DemoView.Resources>
<conv:DimensionsConverter x:Key="DimensionsConverter" />
</local:DemoView.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<TextBlock Text="The solution to this problem is to create a custom editor and provide an IValueConverter to handle the proper conversion of the Struct values." TextWrapping="Wrap" />
<xctk:PropertyGrid x:Name="_propertyGrid" Grid.Row="1" Width="450" MaxHeight="250" Margin="10">
<xctk:PropertyGrid.EditorDefinitions>

6
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridCategoryOrderView.xaml.txt

@ -31,7 +31,7 @@
<Run>The PropertyGrid on the right uses the CategoryOrder attribute to order the categories in the desired order.</Run>
</Paragraph>
</local:DemoView.Description>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
@ -43,7 +43,7 @@
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<TextBlock Text="Non-Ordered Categories:" FontSize="16" FontWeight="Bold" HorizontalAlignment="Stretch" Margin="10"/>
<xctk:PropertyGrid x:Name="_propertyGrid1" Grid.Row="1" Width="290" MaxHeight="350" VerticalAlignment="Top" Margin="10"/>
</Grid>
@ -53,7 +53,7 @@
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<TextBlock Grid.Column="1" Text="Ordered Categories:" FontSize="16" FontWeight="Bold" Margin="10"/>
<xctk:PropertyGrid x:Name="_propertyGrid2" Grid.Row="1" Grid.Column="1" Width="290" MaxHeight="350" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="10"/>
</Grid>

4
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridCustomEditorsView.xaml.txt

@ -27,7 +27,7 @@
This example demonstrates the various methods of assigning custom editors to the properties. You can supply your own editor DataTemplate based on a Type, a property name, or both. To supply your own editor for a property, you must create an EditorDefinition for the PropertyGrid.
</Paragraph>
</local:DemoView.Description>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
@ -56,7 +56,7 @@
<TextBox Background="Green" Text="{Binding Value}" />
<!--
When using SelectedObject[s] bind to the "Value" property
When using PropertiesSource or Properties to specify your items,
your DataContext will be the item itself, so bind directly to the
property of your underlying item, hence, probably the same path as

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

63
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridCustomPropertyView.xaml.txt

@ -25,6 +25,7 @@
<local:DemoView.Description>
<Paragraph FontSize="14" FontFamily="Segoe">
Using the CustomPropertyItems class, you can flexibly modify the display of each of your properties.
<!--##INCLUDE_OPEN_SOURCE
<LineBreak />
<LineBreak />
<Run>This feature is only available in the "Plus" version.</Run>
@ -32,9 +33,10 @@
<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.
</Hyperlink>
##END-->
</Paragraph>
</local:DemoView.Description>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
@ -43,7 +45,13 @@
<StackPanel Grid.Row="0" Margin="10">
<TextBlock Text="This sample adds 'CustomPropertyItem' to the 'Properties' collection and directly controls the display of each item."
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>
<!--##INCLUDE_OPEN_SOURCE
<ScrollViewer Grid.Row="1"
VerticalScrollBarVisibility="Auto"
HorizontalScrollBarVisibility="Auto">
@ -52,10 +60,57 @@
<local:XamlBox CodeSource="/Samples/PropertyGrid/OpenSourceImages/CustomProperty.xaml.txt" />
</StackPanel>
</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>
</local:DemoView>

4
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridDefaultEditorsView.xaml.txt

@ -28,7 +28,7 @@
IList&lt;T&gt; (primtive type), IList&lt;T&gt; (custom type),
</Paragraph>
</local:DemoView.Description>
<DockPanel>
<TextBlock DockPanel.Dock="Top"
Text="Click on each property and see the description for details on the underlying editor."
@ -36,5 +36,5 @@
<xctk:PropertyGrid x:Name="_propertyGrid" SelectedObject="{Binding}" Width="450" Margin="10,30,0,0" />
</DockPanel>
</local:DemoView>

20
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()
{
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
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridDefinitionKeyView.xaml.txt

@ -32,6 +32,7 @@
<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).
<!--##INCLUDE_OPEN_SOURCE
<LineBreak />
<LineBreak />
<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">
Click here for more details about Xceed Extended WPF Toolkit Plus.
</Hyperlink>
##END-->
</Paragraph>
</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'"
TextWrapping="Wrap"
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>
<!--##INCLUDE_OPEN_SOURCE
<ScrollViewer Grid.Row="1"
VerticalScrollBarVisibility="Auto"
HorizontalScrollBarVisibility="Auto">
@ -65,5 +73,15 @@
<local:XamlBox CodeSource="/Samples/PropertyGrid/OpenSourceImages/DefinitionKey.xaml.txt" />
</StackPanel>
</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>
</local:DemoView>

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

@ -20,6 +20,9 @@ using System.ComponentModel;
using System.Windows;
using System.Windows.Media;
using Xceed.Wpf.Toolkit.PropertyGrid.Attributes;
#if !OPEN_SOURCE
using Xceed.Wpf.Toolkit.Core.Attributes;
#endif
using Xceed.Wpf.Toolkit.Core;
using System.Windows.Controls;
using System.Globalization;
@ -38,16 +41,90 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views
public PropertyGridDisplayLocalizationView()
{
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
}
}

37
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridDisplayLocalizationView.xaml.txt

@ -31,17 +31,46 @@
<Run>LocalizedDisplayName, LocalizedDescription, LocalizedCategory:</Run>
<LineBreak/>
<Run>Theses attributes allow to easily localize the DisplayName, Description, and Category attributes values using standard Resx resource files.</Run>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak />
<Run>This feature is only available in the "Plus" version.</Run>
<LineBreak />
<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.
</Hyperlink>
##END-->
</Paragraph>
</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"/>
##END-->
</local:DemoView>

45
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()
{
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
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridEditorDefinitionsView.xaml.txt

@ -23,10 +23,28 @@
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
VerticalScrollBarVisibility="Disabled"
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>
<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:
@ -51,6 +69,7 @@
EditorIntegerUpDownDefinition
<LineBreak />
EditorDoubleUpDownDefinition
<!--##INCLUDE_OPEN_SOURCE
<LineBreak />
<LineBreak />
<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">
Click here for more details about Extended WPF Toolkit Plus.
</Hyperlink>
##END-->
etc.
</Paragraph>
</local:DemoView.Description>
@ -66,7 +86,13 @@
<StackPanel DockPanel.Dock="Top">
<TextBlock Text="Each of the displayed properties has their display or behavior affected by an different EditorDefinition "
TextWrapping="Wrap"/>
<!--##EXCLUDE_OPEN_SOURCE-->
<TextBlock Text="(Click XAML and Code tabs to see details)"
FontStyle="Italic"
Margin="0,10,0,0"/>
<!--##END-->
</StackPanel>
<!--##INCLUDE_OPEN_SOURCE
<ScrollViewer VerticalScrollBarVisibility="Auto"
HorizontalScrollBarVisibility="Auto">
<StackPanel>
@ -74,12 +100,67 @@
<local:XamlBox CodeSource="/Samples/PropertyGrid/OpenSourceImages/EditorDefinitions.xaml.txt" />
</StackPanel>
</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>

3
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()
{
InitializeComponent();
#if !OPEN_SOURCE
_propertyGrid.SelectedObjectsOverride = new List<object>() { _textBox, _button, _comboBox };
#endif
}
}
}

37
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridMultiSelectedObjectsView.xaml.txt

@ -24,18 +24,51 @@
<local:DemoView.Description>
<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>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak />
<Run>This feature is only available in the "Plus" version.</Run>
<LineBreak />
<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.
</Hyperlink>
##END-->
</Paragraph>
</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"/>
##END-->
</local:DemoView>

52
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()
{
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
}
}

61
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridPropertiesSourceView.xaml.txt

@ -24,6 +24,7 @@
<local:DemoView.Description>
<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.
<!--##INCLUDE_OPEN_SOURCE
<LineBreak />
<LineBreak />
<Run>This feature is only available in the "Plus" version.</Run>
@ -31,9 +32,10 @@
<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.
</Hyperlink>
##END-->
</Paragraph>
</local:DemoView.Description>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
@ -43,7 +45,13 @@
<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."
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>
<!--##INCLUDE_OPEN_SOURCE
<ScrollViewer Grid.Row="2"
VerticalScrollBarVisibility="Auto"
HorizontalScrollBarVisibility="Auto">
@ -54,11 +62,52 @@
<local:XamlBox CodeSource="/Samples/PropertyGrid/OpenSourceImages/PropertiesSource.xaml.txt" />
</StackPanel>
</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>
</local:DemoView>

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

@ -34,5 +34,17 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views
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
}

73
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridPropertiesView.xaml.txt

@ -28,6 +28,7 @@
<LineBreak/>
<LineBreak/>
The sample also demonstrate the usage of CategoryGroupDescription to control the categorization of the elements.
<!--##INCLUDE_OPEN_SOURCE
<LineBreak />
<LineBreak />
<Run>This feature is only available in the "Plus" version.</Run>
@ -35,9 +36,10 @@
<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.
</Hyperlink>
##END-->
</Paragraph>
</local:DemoView.Description>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
@ -46,7 +48,13 @@
<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."
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>
<!--##INCLUDE_OPEN_SOURCE
<ScrollViewer Grid.Row="1"
VerticalScrollBarVisibility="Auto"
HorizontalScrollBarVisibility="Auto">
@ -57,11 +65,72 @@
<local:XamlBox CodeSource="/Samples/PropertyGrid/OpenSourceImages/Properties.xaml.txt" />
</StackPanel>
</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>
</local:DemoView>

2
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridPropertyItemStyleView.xaml.cs.txt

@ -37,7 +37,7 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views
var selObject = new Person();
selObject.Friend = new Person();
this.DataContext = selObject;
}

2
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridPropertyItemStyleView.xaml.txt

@ -29,7 +29,7 @@
<Bold>PreparePropertyItem</Bold> event to customize the display of the PropertyGrid content.
</Paragraph>
</local:DemoView.Description>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />

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

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

18
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridSpecifyingPropertiesView.xaml.txt

@ -26,14 +26,26 @@
By default the propertyGrid will autogenerate all the properties for a given object. You can override this behavior by setting the AutoGenerateProperties property to False, and then provide a collection of PropertyDefinitions of the properties you would like to show.
</Paragraph>
</local:DemoView.Description>
<Grid>
<xctk:PropertyGrid x:Name="_propertyGrid"
Width="450"
MaxHeight="245"
Margin="10"
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>
<!-- //# TODODOC
The following properties will be displayed in the PropertyGrid
@ -46,7 +58,7 @@
IsExpandable="True"/>
<!-- And all properties of type Boolean will be displayed in the PropertyGrid-->
<xctk:PropertyDefinition TargetProperties="{x:Type s:Boolean}" DisplayOrder="1"/>
<!-- //# TODODOC
This Property won't be displayed -->
<xctk:PropertyDefinition TargetProperties="WritingHand" IsBrowsable="False"/>

6
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridView.xaml.txt

@ -30,7 +30,7 @@
The PropertyGrid also supports complex properties, which allows you to drill down into a nested property hierarchy.
</Paragraph>
</local:DemoView.Description>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
@ -78,7 +78,7 @@
</GroupBox>
<DockPanel Grid.Row="1" Margin="10">
<TextBlock DockPanel.Dock="Top" Text="Usage:" Style="{StaticResource Header}" />
<TextBlock DockPanel.Dock="Top"
Text="Edit the values in the PropertyGrid to see the effect on the button."
@ -89,7 +89,7 @@
<ColumnDefinition MaxWidth="530" />
</Grid.ColumnDefinitions>
<Button x:Name="_button" Height="100" Width="100" Margin="20" HorizontalAlignment="Center" VerticalAlignment="Center">Button</Button>
<xctk:PropertyGrid Grid.Column="1"
x:Name="_propertyGrid"
ShowSummary="{Binding IsChecked, ElementName=_showSummary}"

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

@ -32,9 +32,32 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Gauge.Views
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
}
}

1023
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/RadialGaugeView.xaml.txt

File diff suppressed because it is too large

2
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/RangeSliderView.xaml.txt

@ -691,4 +691,4 @@
LowerRangeStyle="{x:Null}" />
</StackPanel>
</Grid>
</local:DemoView>
</local:DemoView>

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

@ -30,7 +30,40 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Rating.Views
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
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/RatingView.xaml.txt

@ -27,6 +27,7 @@
<Paragraph FontSize="14"
FontFamily="Segoe">
<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 />
<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">
Click here for more details about Xceed Extended WPF Toolkit Plus.
</Hyperlink>
##END-->
</Paragraph>
</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"/>
##END-->
</local:DemoView>

2
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/RichTextboxView.xaml.txt

@ -27,7 +27,7 @@
The RichTextBox is a TextBox that allows you to edit formatted text based on TextFormatters. The RichTextBoxFormatBar is a contextual formatting toolbar that mimics the behavior of the Microsoft Office 2010 formatting bar on selection.
</Paragraph>
</local:DemoView.Description>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />

68
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 WindowControlStyleKey = "windowControlStyle";
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.";
#else
private const string StylableWindowNoStyleKey = "stylableWindowNoStyle";
private const string StylableWindowStyleKey = "stylableWindowStyle";
private StylableWindow _stylableWindow;
#endif
public StylableWindowView()
{
InitializeComponent();
#if !OPEN_SOURCE
this.Unloaded += new RoutedEventHandler( OnSampleUnloaded );
#endif
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 )
{
#if OPEN_SOURCE
var msgBox = new Xceed.Wpf.Toolkit.MessageBox();
msgBox.DataContext = this.DataContext;
msgBox.Text = StylableWindowMessage;
msgBox.Caption = StyledMsgBoxTitle;
msgBox.Style = ( _enableStyleCheckBox.IsChecked.GetValueOrDefault() ) ? ( Style )this.Resources[ MessageBoxStyleKey ] : null;
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 )
{
System.Windows.MessageBox.Show( StandardMsgBoxMessage, StandardMsgBoxTitle );
@ -98,7 +150,15 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Window.Views
{
_childWindow.ClearValue( ChildWindow.StyleProperty );
}
#if !OPEN_SOURCE
if( _stylableWindow != null )
{
_stylableWindow.Style = ( styled )
? ( Style )this.Resources[ StylableWindowStyleKey ]
: ( Style )this.Resources[ StylableWindowNoStyleKey ];
}
#endif
}
}

42
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/StylableWindowView.xaml.txt

@ -28,10 +28,12 @@
<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>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak />
<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.
</Hyperlink>
##END-->
</Paragraph>
</local:DemoView.Description>
@ -54,6 +56,11 @@
<Setter Property="CaptionForeground" Value="{Binding TitleForeground}" />
<Setter Property="CaptionShadowBrush" Value="{Binding TitleShadowBrush}" />
<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 for the MessageBox-->
@ -65,10 +72,34 @@
<Setter Property="NoButtonStyle" Value="{StaticResource FancyButtonStyle}" />
</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>
</local:DemoView.Resources>
<local:DemoView.DataContext>
<!--A model containing the brushes and other properties was created to share theses values
@ -132,6 +163,7 @@
<GroupBox Header="Stylable Window" DockPanel.Dock="Top" Margin="5" HorizontalAlignment="Stretch" >
<Button Width="160" Height="30" Margin="10" HorizontalAlignment="Center"
Content="Show" Click="OnStylableWindow_Click" >
<!--##INCLUDE_OPEN_SOURCE
<Button.ContentTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
@ -143,6 +175,7 @@
</StackPanel>
</DataTemplate>
</Button.ContentTemplate>
##END-->
</Button>
</GroupBox>
<GroupBox Header="ChildWindow" Margin="5">
@ -156,6 +189,11 @@
WindowState="Open"
CloseButtonVisibility="{Binding CloseButtonVisibility}"
WindowStyle="{Binding WindowStyle}" >
<!--##EXCLUDE_OPEN_SOURCE-->
<xctk:ChildWindow.ResizeMode>
<Binding Path="ResizeMode"/>
</xctk:ChildWindow.ResizeMode>
<!--##END-->
<TextBlock>
This is the content of the child window.
</TextBlock>

470
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.IO;
using System.Diagnostics;
#if OPEN_SOURCE
using System.Windows.Media.Imaging;
#endif
namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Panels.Views
{
@ -35,6 +37,9 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Panels.Views
{
#region Members
#if !OPEN_SOURCE
private DependencyObject _textBlockIdentifier;
#endif
#endregion
@ -47,6 +52,7 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Panels.Views
private void OnLayoutComboSelectionChanged( object sender, RoutedEventArgs e )
{
#if OPEN_SOURCE
ComboBox comboBox = sender as ComboBox;
bool isPlusPanel = (comboBox.SelectedIndex >= 2);
@ -124,64 +130,524 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Panels.Views
if( _openSourceScreenShotDesc != null )
_openSourceScreenShotDesc.Text = desc;
}
#endif
}
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
#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
}

908
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/SwitchPanelView.xaml.txt

File diff suppressed because it is too large

129
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.Shapes;
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
{
@ -35,8 +40,13 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Theming.Views
/// </summary>
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
@ -54,10 +64,18 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Theming.Views
{
AvalonDockComboBoxItem comboBoxItem = sender as AvalonDockComboBoxItem;
#if OPEN_SOURCE
if( comboBoxItem != null )
{
this.SetOpenSourceImage( comboBoxItem );
}
#else
this.SetInternalControlsTheme( comboBoxItem );
if( _accentColorPanel != null )
{
_accentColorPanel.Visibility = Visibility.Hidden;
}
#endif
}
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 )
{
AvalonDockComboBoxItem comboBoxItem = sender as AvalonDockComboBoxItem;
#if OPEN_SOURCE
if( comboBoxItem != null )
{
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
#region private Methods
#if OPEN_SOURCE
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
}

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

@ -28,18 +28,143 @@
FontFamily="Segoe">
<!--//# 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>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak />
<Run>Some features of this sample are only available in the "Plus" version.</Run>
<LineBreak />
<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.
</Hyperlink>
##END-->
</Paragraph>
</local:DemoView.Description>
<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">
<Setter Property="Margin" Value="5,0,0,0"/>
<Setter Property="Text" Value="Plus Only"/>
@ -53,6 +178,7 @@
</DataTrigger>
</Style.Triggers>
</Style>
##END-->
<Style x:Key="plusItem"
TargetType="ComboBoxItem">
@ -64,7 +190,9 @@
<DockPanel>
<TextBlock DockPanel.Dock="Left"
Text="{Binding}" />
<!--##INCLUDE_OPEN_SOURCE
<TextBlock TextAlignment="Right" Style="{StaticResource plusSuffix}" />
##END-->
</DockPanel>
</DataTemplate>
</Setter.Value>
@ -77,7 +205,9 @@
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<!--##INCLUDE_OPEN_SOURCE
<RowDefinition Height="Auto" />
##END-->
</Grid.RowDefinitions>
<GroupBox Header="Features"
@ -126,16 +256,31 @@
Content="Office2007 Black"
Selected="DefaultComboBoxItem_Selected"
ThemeEnum="{x:Static view:AvalonDockThemesEnum.Office2007Black}">
<!--##EXCLUDE_OPEN_SOURCE-->
<view:AvalonDockComboBoxItem.Tag>
<xcad:Office2007BlackTheme />
</view:AvalonDockComboBoxItem.Tag>
<!--##END-->
</view:AvalonDockComboBoxItem>
<view:AvalonDockComboBoxItem Style="{StaticResource plusItem}"
Content="Office2007 Blue"
Selected="DefaultComboBoxItem_Selected"
ThemeEnum="{x:Static view:AvalonDockThemesEnum.Office2007Blue}">
<!--##EXCLUDE_OPEN_SOURCE-->
<view:AvalonDockComboBoxItem.Tag>
<xcad:Office2007BlueTheme />
</view:AvalonDockComboBoxItem.Tag>
<!--##END-->
</view:AvalonDockComboBoxItem>
<view:AvalonDockComboBoxItem Style="{StaticResource plusItem}"
Content="Office2007 Silver"
Selected="DefaultComboBoxItem_Selected"
ThemeEnum="{x:Static view:AvalonDockThemesEnum.Office2007Silver}">
<!--##EXCLUDE_OPEN_SOURCE-->
<view:AvalonDockComboBoxItem.Tag>
<xcad:Office2007SilverTheme />
</view:AvalonDockComboBoxItem.Tag>
<!--##END-->
</view:AvalonDockComboBoxItem>
<view:AvalonDockComboBoxItem x:Name="metroDarkComboBoxItem"
Style="{StaticResource plusItem}"
@ -153,8 +298,213 @@
</view:AvalonDockComboBoxItem>
</ComboBox>
</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>
</GroupBox>
@ -277,6 +627,7 @@
</xcad:DockingManager>
</Border>
<!--##INCLUDE_OPEN_SOURCE
<Image x:Name="_openSourceScreenShot" Grid.Row="2" Height="395" 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. "/>
@ -286,5 +637,6 @@
</Hyperlink>
</TextBlock>
</StackPanel>
##END-->
</Grid>
</local:DemoView>

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

@ -20,6 +20,11 @@ using System.ComponentModel;
using System.Windows;
using System.Windows.Controls;
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;
using System.Data;
@ -35,48 +40,187 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Theming.Views
/// </summary>
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
public ThemingCoreWPFView()
{
#if !OPEN_SOURCE
this.Initialized += new EventHandler( WPFControlsThemes_Initialized );
DataContext = this;
#endif
InitializeComponent();
}
#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
}
}

1035
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingCoreWPFView.xaml.txt

File diff suppressed because it is too large

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

@ -20,6 +20,11 @@ using System.ComponentModel;
using System.Windows;
using System.Windows.Controls;
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;
using Xceed.Wpf.Samples.SampleData;
@ -36,21 +41,100 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Theming.Views
/// </summary>
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()
{
#if !OPEN_SOURCE
this.DataContext = SampleDataProvider.GetOrders();
#endif
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
}
}

539
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingDataGridView.xaml.txt

@ -28,51 +28,514 @@
<Paragraph FontSize="14" FontFamily="Segoe">
<!--//# 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>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak />
<Run>This feature is only available in the "Plus" version.</Run>
<LineBreak />
<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.
</Hyperlink>
##END-->
</Paragraph>
</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"/>
##END-->
</local:DemoView>

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

@ -16,6 +16,12 @@
using System.Diagnostics;
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.Windows.Controls;
using System.Windows.Media;
@ -29,30 +35,117 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Theming.Views
/// </summary>
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()
{
#if !OPEN_SOURCE
this.Initialized += new EventHandler( ToolkitControlsThemes_Initialized );
#endif
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
}
}

504
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingExtendedToolkitView.xaml.txt

@ -26,41 +26,491 @@
<Paragraph FontSize="14" FontFamily="Segoe">
<!--//# 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>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak />
<Run>This feature is only available in the "Plus" version.</Run>
<LineBreak />
<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.
</Hyperlink>
##END-->
</Paragraph>
</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"/>
##END-->
</local:DemoView>

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

@ -20,6 +20,13 @@ using System.ComponentModel;
using System.Windows;
using System.Windows.Controls;
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;
using Xceed.Wpf.Samples.SampleData;
@ -30,41 +37,172 @@ using System.Windows.Threading;
namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Theming.Views
{
#if !OPEN_SOURCE
public enum ThemesEnum
{
System,
Office2007Blue,
Office2007Black,
Office2007Silver,
LiveExplorer,
MetroDark,
MetroLight,
MediaPlayer
}
#endif
/// <summary>
/// Interaction logic for ThemingListBoxView.xaml
/// </summary>
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
public ThemingListBoxView()
{
#if !OPEN_SOURCE
this.DataContext = SampleDataProvider.GetOrders();
#endif
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
#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
}
}

363
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingListBoxView.xaml.txt

@ -31,30 +31,377 @@
<LineBreak />
<!--//# 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>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak />
<Run>This feature is only available in the "Plus" version.</Run>
<LineBreak />
<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.
</Hyperlink>
##END-->
</Paragraph>
</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"/>
##END-->
</local:DemoView>

2
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/TimeSpanView.xaml.txt

@ -27,7 +27,7 @@
The TimeSpanUpDown controls let you increment or decrement a time over 24 hours. The Format is Days.Hours:Minutes:Seconds.
</Paragraph>
</local:DemoView.Description>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />

2
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/TimelinePanelView.xaml.txt

@ -26,7 +26,7 @@
TimelinePanel is a WPF panel at arranges it's children along a timeline. Items are placed along the timeline based on the Date attached property, which is set on each item.
</Paragraph>
</local:DemoView.Description>
<local:DemoView.Resources>
<ObjectDataProvider x:Key="Orientations" MethodName="GetValues"
ObjectType="{x:Type sys:Enum}">

2
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/WatermarkTextboxView.xaml.txt

@ -24,7 +24,7 @@
The WatermarkTextBox is simply a TextBox that allows you to sepcify an object, usually a String, to represent null or missing text.
</Paragraph>
</local:DemoView.Description>
<Grid>
<StackPanel Margin="10">
<TextBlock Text="Default:" Style="{StaticResource Header}" />

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

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

22
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/WindowContainerView.xaml.txt

@ -38,7 +38,7 @@
<local:DemoView.Resources>
<xctkconv:SolidColorBrushToColorConverter x:Key="SolidColorBrushToColorConverter" />
<conv:WindowStateToBoolConverter x:Key="WindowStateToBoolConverter" />
<ObjectDataProvider x:Key="GenderEnum" MethodName="GetValues"
ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
@ -52,25 +52,25 @@
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<GroupBox Header="Features" Grid.Row="0" Margin="5">
<Grid Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock Text="ModalBackgroundBrush:" VerticalAlignment="Center" />
<xctk:ColorPicker x:Name="_modalBackgroundColorPicker" Grid.Column="1" SelectedColor="{Binding ModalBackgroundBrush, ElementName=_windowContainer, Converter={StaticResource SolidColorBrushToColorConverter}}" Width="100" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5"/>
</Grid>
</GroupBox>
<Grid Grid.Row="1" Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<TextBlock Text="Usage:" Style="{StaticResource Header}" />
<Grid Grid.Row="1">
@ -84,7 +84,7 @@
<CheckBox x:Name="_modalChildWindowCheckBox" Content="Modal Child Window" Margin="5" IsChecked="{Binding WindowState, ElementName=_modalChildWindow, Converter={StaticResource WindowStateToBoolConverter}}" />
<CheckBox x:Name="_messageBoxCheckBox" Content="MessageBox" Margin="5" Checked="OnMessageBoxCheckBoxChecked" Unchecked="OnMessageBoxCheckBoxUnchecked" />
</StackPanel>
<Grid Column="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="80" />
@ -105,7 +105,7 @@
<TextBox Grid.Row="1" Grid.Column="1" Width="150" Height="30" Text="Thompson" HorizontalAlignment="Left"/>
<TextBlock Grid.Row="2" Text="Address:" VerticalAlignment="Center" Margin="10"/>
<TextBox Grid.Row="2" Grid.Column="1" Width="150" Height="30" Text="65 Main street" HorizontalAlignment="Left"/>
<!-- 2nd Column-->
<TextBlock Grid.Column="2" Text="Gender:" VerticalAlignment="Center" Margin="10"/>
<ComboBox Grid.Column="3" Width="100" Height="30" ItemsSource="{Binding Source={StaticResource GenderEnum}}" SelectedIndex="0" Margin="5" HorizontalAlignment="Left"/>
@ -114,7 +114,7 @@
<TextBlock Grid.Row="2" Grid.Column="2" Text="Salary:" VerticalAlignment="Center" Margin="10"/>
<xctk:IntegerUpDown Grid.Row="2" Width="100" Grid.Column="3" Height="30" Value="30000" Increment="5000" Margin="5" HorizontalAlignment="Left"/>
</Grid>
<Border Grid.Column="1"
BorderBrush="Black"
BorderThickness="2"
@ -131,7 +131,7 @@
WindowState="Open">
<TextBlock Text="This is a regular Child Window" Padding="10"/>
</xctk:ChildWindow>
<xctk:ChildWindow x:Name="_modalChildWindow"
Caption="Modal ChildWindow"
IsModal="True"
@ -142,13 +142,13 @@
WindowState="Open">
<TextBlock Text="This is a modal Child Window" Padding="10"/>
</xctk:ChildWindow>
<xctk:MessageBox x:Name="_messageBox"
Caption="MessageBox"
Text="This is a MessageBox, always modal"
Closed="OnMessageBoxClose" />
</xctk:WindowContainer>
</Border>
</Grid>
</Grid>

2
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/WizardView.xaml.txt

@ -24,7 +24,7 @@
The Wizard will explain how to do something in a series of steps.
</Paragraph>
</local:DemoView.Description>
<local:DemoView.Resources>
<xctk:Wizard x:Key="_wizard" FinishButtonClosesWindow="True" Help="OnWizardHelp">
<xctk:WizardPage Title="Welcome to my Wizard"

2
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ZoomboxView.xaml.txt

@ -25,7 +25,7 @@
The Zoombox control provides zoom and pan functionality for any UIElement (its content) that has a discrete size. It allows the content to be scaled up (zoomed in) or scaled down (zoomed out) using the mouse wheel, key bindings, or programmatically through methods and properties exposed by the control. Similarly, the content can be panned (translated) in any direction by dragging it with the mouse, using key bindings, or programmatically through methods and properties exposed by the control.&#x0a;&#x0a;The Zoombox control also provides a view finder that acts as a reduced-scale map of the contained element, showing exactly which portion of the content is visible within the Zoombox's viewport.
</Paragraph>
</local:DemoView.Description>
<Grid Grid.Row="1"
HorizontalAlignment="Stretch"

2
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 )
{
_propertyGrid.PersistChanges();
this.DialogResult = true;
Close();
}
private void CancelButton_Click( object sender, RoutedEventArgs e )
{
this.DialogResult = false;
Close();
}

13
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Core/Primitives/UpDownBase.cs

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

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

@ -29,6 +29,12 @@ namespace Xceed.Wpf.Toolkit
{
public class DateTimeUpDown : DateTimeUpDownBase<DateTime?>
{
#region Members
private DateTime? _lastValidDate;
#endregion
#region Properties
#region Format
@ -123,6 +129,13 @@ namespace Xceed.Wpf.Toolkit
#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 )
{
FormatUpdated();
@ -209,6 +222,11 @@ namespace Xceed.Wpf.Toolkit
ParseValueIntoDateTimeInfo();
base.OnValueChanged( oldValue, newValue );
if( !_isTextChangedFromUI )
{
_lastValidDate = 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 );
}
if( !isValid )
result = ( _lastValidDate != null ) ? _lastValidDate.Value : current;
return isValid;
}

2
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="BorderThickness" Value="1" />
<Setter Property="HorizontalContentAlignment" Value="Right" />
<Setter Property="IsTabStop" Value="False" />
<Setter Property="Focusable" Value="False" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="TextAlignment" Value="Right" />
<Setter Property="WatermarkTemplate" Value="{StaticResource DefaultWatermarkTemplate}" />

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save