Browse Source

V3.2.0 Released

pull/1181/merge
BoucherS 9 years ago
parent
commit
6dc73683a7
  1. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock.Themes.Aero/AssemblyVersionInfo.cs
  2. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock.Themes.Metro/AssemblyVersionInfo.cs
  3. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock.Themes.VS2010/AssemblyVersionInfo.cs
  4. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/AssemblyVersionInfo.cs
  5. 45
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutAnchorablePaneControl.cs
  6. 146
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutAnchorableTabItem.cs
  7. 23
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutFloatingWindowControl.cs
  8. 46
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutGridControl.cs
  9. 12
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutItem.cs
  10. 140
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/OverlayWindow.cs
  11. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/ILayoutPositionableElement.cs
  12. 56
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/LayoutAnchorableFloatingWindow.cs
  13. 21
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/LayoutContent.cs
  14. 47
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/LayoutDocumentFloatingWindow.cs
  15. 20
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/LayoutFloatingWindow.cs
  16. 29
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/LayoutPositionableGroup.cs
  17. 286
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/LayoutRoot.cs
  18. 4
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Themes/DictionaryTheme.cs
  19. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.DataGrid/AssemblyVersionInfo.cs
  20. 7
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.DataGrid/CheckBox.cs
  21. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChildWindowView.xaml.txt
  22. 4
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ColorView.xaml.txt
  23. 29
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/IconButtonView.xaml.cs.txt
  24. 180
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/IconButtonView.xaml.txt
  25. 111
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialHamburgerView.xaml.cs.txt
  26. 610
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialHamburgerView.xaml.txt
  27. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialToastView.xaml.txt
  28. 8
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PileFlowPanelView.xaml.txt
  29. 5
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridAttributesView.xaml.cs.txt
  30. 5
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridSelectedObjectView.xaml.txt
  31. 13
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridView.xaml.txt
  32. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingAvalonDockView.xaml.txt
  33. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingCoreWPFView.xaml.txt
  34. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingDataGridView.xaml.txt
  35. 1
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingExtendedToolkitView.xaml.txt
  36. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingListBoxView.xaml.txt
  37. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ToggleSwitchView.xaml.txt
  38. 26
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Core/Converters/ZeroToBoolConverter.cs
  39. 11
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/MainWindow.xaml
  40. 4
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Properties/AssemblyInfo.cs
  41. 10
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Properties/Resources.resx
  42. BIN
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/Button/Resources/Default.jpg
  43. BIN
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/Button/Resources/PencilTool16.png
  44. 180
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/Button/Views/IconButtonView.xaml
  45. 29
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/Button/Views/IconButtonView.xaml.cs
  46. 4
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/Color/Views/ColorView.xaml
  47. BIN
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/MaterialControls/OpenSourceImages/MaterialHamburger.png
  48. BIN
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/MaterialControls/Resources/Business.png
  49. BIN
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/MaterialControls/Resources/DataGrid.png
  50. BIN
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/MaterialControls/Resources/SFTP.png
  51. BIN
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/MaterialControls/Resources/Toolkit.png
  52. BIN
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/MaterialControls/Resources/Zip.png
  53. 74
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/MaterialControls/Views/MaterialHamburgerView.xaml
  54. 47
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/MaterialControls/Views/MaterialHamburgerView.xaml.cs
  55. 5
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/PropertyGrid/Views/PropertyGridAttributesView.xaml.cs
  56. 5
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/PropertyGrid/Views/PropertyGridSelectedObjectView.xaml
  57. 13
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/PropertyGrid/Views/PropertyGridView.xaml
  58. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/Theming/Views/ThemingAvalonDockView.xaml
  59. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/ToggleSwitch/Views/ToggleSwitchView.xaml
  60. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/Window/Views/ChildWindowView.xaml
  61. 40
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Xceed.Wpf.Toolkit.LiveExplorer.csproj
  62. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/AssemblyVersionInfo.cs
  63. 23
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/ButtonSpinner/Implementation/ButtonSpinner.cs
  64. 13
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/ButtonSpinner/Implementation/SpinEventArgs.cs
  65. 18
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/ButtonSpinner/Implementation/Spinner.cs
  66. 5
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/CalculatorUpDown/Implementation/CalculatorUpDown.cs
  67. 1
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/CalculatorUpDown/Themes/Aero2.NormalColor.xaml
  68. 1
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/CalculatorUpDown/Themes/Generic.xaml
  69. 129
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Chromes/Themes/Aero2.NormalColor.xaml
  70. 15
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/ColorCanvas/Implementation/ColorCanvas.cs
  71. 3
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/ColorCanvas/Implementation/ColorSpectrumSlider.cs
  72. 60
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/ColorPicker/Implementation/ColorPicker.cs
  73. 43
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/ColorPicker/Implementation/ColorPickerTabItem.cs
  74. 113
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/ColorPicker/Themes/Aero2.NormalColor.xaml
  75. 98
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/ColorPicker/Themes/Generic.xaml
  76. 37
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Core/Converters/ColorModeToTabItemSelectedConverter.cs
  77. 24
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Core/LocationEnum.cs
  78. 3
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Core/Utilities/CalculatorUtilities.cs
  79. 6
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/DateTimePicker/Implementation/DateTimePicker.cs
  80. 35
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/DateTimeUpDown/Implementation/DateTimeUpDown.cs
  81. 60
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/DropDownButton/Implementation/DropDownButton.cs
  82. 181
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/IconButton/Implementation/IconButton.cs
  83. 166
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/IconButton/Themes/Aero2.NormalColor.xaml
  84. 166
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/IconButton/Themes/Generic.xaml
  85. 6
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Magnifier/Implementation/MagnifierAdorner.cs
  86. 43
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/MaskedTextBox/Implementation/MaskedTextBox.cs
  87. 8
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/MultiLineTextEditor/Implementation/MultiLineTextEditor.cs
  88. 19
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/NumericUpDown/Implementation/NumericUpDown.cs
  89. 1
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/NumericUpDown/Themes/Aero2.NormalColor.xaml
  90. 1
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/NumericUpDown/Themes/Generic.xaml
  91. 15
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Primitives/DateTimeUpDownBase.cs
  92. 28
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Primitives/UpDownBase.cs
  93. 37
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Primitives/WindowControl.cs
  94. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/PropertyGrid/Implementation/CategoryGroupStyleSelector.cs
  95. 9
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/PropertyGrid/Implementation/ContainerHelperBase.cs
  96. 7
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/PropertyGrid/Implementation/Converters/SelectedObjectConverter.cs
  97. 19
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/PropertyGrid/Implementation/CustomPropertyItem.cs
  98. 11
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/PropertyGrid/Implementation/DescriptorPropertyDefinition.cs
  99. 33
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/PropertyGrid/Implementation/DescriptorPropertyDefinitionBase.cs
  100. 29
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/PropertyGrid/Implementation/ObjectContainerHelperBase.cs

2
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock.Themes.Aero/AssemblyVersionInfo.cs

@ -21,7 +21,7 @@
internal static class _XceedVersionInfo internal static class _XceedVersionInfo
{ {
[System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )] [System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )]
public const string BaseVersion = "3.1"; public const string BaseVersion = "3.2";
[System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )] [System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )]
public const string Version = BaseVersion + public const string Version = BaseVersion +
".0.0"; ".0.0";

2
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock.Themes.Metro/AssemblyVersionInfo.cs

@ -21,7 +21,7 @@
internal static class _XceedVersionInfo internal static class _XceedVersionInfo
{ {
[System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )] [System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )]
public const string BaseVersion = "3.1"; public const string BaseVersion = "3.2";
[System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )] [System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )]
public const string Version = BaseVersion + public const string Version = BaseVersion +
".0.0"; ".0.0";

2
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock.Themes.VS2010/AssemblyVersionInfo.cs

@ -21,7 +21,7 @@
internal static class _XceedVersionInfo internal static class _XceedVersionInfo
{ {
[System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )] [System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )]
public const string BaseVersion = "3.1"; public const string BaseVersion = "3.2";
[System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )] [System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )]
public const string Version = BaseVersion + public const string Version = BaseVersion +
".0.0"; ".0.0";

2
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/AssemblyVersionInfo.cs

@ -21,7 +21,7 @@
internal static class _XceedVersionInfo internal static class _XceedVersionInfo
{ {
[System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )] [System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )]
public const string BaseVersion = "3.1"; public const string BaseVersion = "3.2";
[System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )] [System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )]
public const string Version = BaseVersion + public const string Version = BaseVersion +
".0.0"; ".0.0";

45
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutAnchorablePaneControl.cs

@ -30,23 +30,23 @@ namespace Xceed.Wpf.AvalonDock.Controls
{ {
static LayoutAnchorablePaneControl() static LayoutAnchorablePaneControl()
{ {
FocusableProperty.OverrideMetadata(typeof(LayoutAnchorablePaneControl), new FrameworkPropertyMetadata(false)); FocusableProperty.OverrideMetadata( typeof( LayoutAnchorablePaneControl ), new FrameworkPropertyMetadata( false ) );
} }
public LayoutAnchorablePaneControl(LayoutAnchorablePane model) public LayoutAnchorablePaneControl( LayoutAnchorablePane model )
{ {
if (model == null) if( model == null )
throw new ArgumentNullException("model"); throw new ArgumentNullException( "model" );
_model = model; _model = model;
SetBinding(ItemsSourceProperty, new Binding("Model.Children") { Source = this }); SetBinding( ItemsSourceProperty, new Binding( "Model.Children" ) { Source = this } );
SetBinding(FlowDirectionProperty, new Binding("Model.Root.Manager.FlowDirection") { Source = this }); SetBinding( FlowDirectionProperty, new Binding( "Model.Root.Manager.FlowDirection" ) { Source = this } );
this.LayoutUpdated += new EventHandler(OnLayoutUpdated); this.LayoutUpdated += new EventHandler( OnLayoutUpdated );
} }
void OnLayoutUpdated(object sender, EventArgs e) void OnLayoutUpdated( object sender, EventArgs e )
{ {
var modelWithAtcualSize = _model as ILayoutPositionableElementWithActualSize; var modelWithAtcualSize = _model as ILayoutPositionableElementWithActualSize;
modelWithAtcualSize.ActualWidth = ActualWidth; modelWithAtcualSize.ActualWidth = ActualWidth;
@ -57,35 +57,42 @@ namespace Xceed.Wpf.AvalonDock.Controls
public ILayoutElement Model public ILayoutElement Model
{ {
get { return _model; } get
{
return _model;
}
} }
protected override void OnGotKeyboardFocus(System.Windows.Input.KeyboardFocusChangedEventArgs e) protected override void OnGotKeyboardFocus( System.Windows.Input.KeyboardFocusChangedEventArgs e )
{ {
if ((_model != null) && (_model.SelectedContent != null)) if( ( _model != null ) && ( _model.SelectedContent != null ) )
{ {
_model.SelectedContent.IsActive = true; _model.SelectedContent.IsActive = true;
} }
base.OnGotKeyboardFocus(e); base.OnGotKeyboardFocus( e );
} }
protected override void OnMouseLeftButtonDown(System.Windows.Input.MouseButtonEventArgs e) protected override void OnMouseLeftButtonDown( System.Windows.Input.MouseButtonEventArgs e )
{ {
base.OnMouseLeftButtonDown(e); base.OnMouseLeftButtonDown( e );
if (!e.Handled && _model.SelectedContent != null) if( !e.Handled && ( _model != null ) && ( _model.SelectedContent != null ) )
{
_model.SelectedContent.IsActive = true; _model.SelectedContent.IsActive = true;
} }
}
protected override void OnMouseRightButtonDown(System.Windows.Input.MouseButtonEventArgs e) protected override void OnMouseRightButtonDown( System.Windows.Input.MouseButtonEventArgs e )
{ {
base.OnMouseRightButtonDown(e); base.OnMouseRightButtonDown( e );
if (!e.Handled && _model.SelectedContent != null) if( !e.Handled && ( _model != null ) && ( _model.SelectedContent != null ) )
{
_model.SelectedContent.IsActive = true; _model.SelectedContent.IsActive = true;
}
} }
} }
} }

146
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutAnchorableTabItem.cs

@ -30,9 +30,17 @@ namespace Xceed.Wpf.AvalonDock.Controls
{ {
public class LayoutAnchorableTabItem : Control public class LayoutAnchorableTabItem : Control
{ {
#region Members
private bool _isMouseDown = false;
private static LayoutAnchorableTabItem _draggingItem = null;
private static bool _cancelMouseLeave = false;
#endregion
static LayoutAnchorableTabItem() static LayoutAnchorableTabItem()
{ {
DefaultStyleKeyProperty.OverrideMetadata(typeof(LayoutAnchorableTabItem), new FrameworkPropertyMetadata(typeof(LayoutAnchorableTabItem))); DefaultStyleKeyProperty.OverrideMetadata( typeof( LayoutAnchorableTabItem ), new FrameworkPropertyMetadata( typeof( LayoutAnchorableTabItem ) ) );
} }
public LayoutAnchorableTabItem() public LayoutAnchorableTabItem()
@ -47,9 +55,9 @@ namespace Xceed.Wpf.AvalonDock.Controls
/// Model Dependency Property /// Model Dependency Property
/// </summary> /// </summary>
public static readonly DependencyProperty ModelProperty = public static readonly DependencyProperty ModelProperty =
DependencyProperty.Register("Model", typeof(LayoutContent), typeof(LayoutAnchorableTabItem), DependencyProperty.Register( "Model", typeof( LayoutContent ), typeof( LayoutAnchorableTabItem ),
new FrameworkPropertyMetadata((LayoutContent)null, new FrameworkPropertyMetadata( (LayoutContent)null,
new PropertyChangedCallback(OnModelChanged))); new PropertyChangedCallback( OnModelChanged ) ) );
/// <summary> /// <summary>
/// Gets or sets the Model property. This dependency property /// Gets or sets the Model property. This dependency property
@ -57,27 +65,33 @@ namespace Xceed.Wpf.AvalonDock.Controls
/// </summary> /// </summary>
public LayoutContent Model public LayoutContent Model
{ {
get { return (LayoutContent)GetValue(ModelProperty); } get
set { SetValue(ModelProperty, value); } {
return (LayoutContent)GetValue( ModelProperty );
}
set
{
SetValue( ModelProperty, value );
}
} }
/// <summary> /// <summary>
/// Handles changes to the Model property. /// Handles changes to the Model property.
/// </summary> /// </summary>
private static void OnModelChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) private static void OnModelChanged( DependencyObject d, DependencyPropertyChangedEventArgs e )
{ {
((LayoutAnchorableTabItem)d).OnModelChanged(e); ( (LayoutAnchorableTabItem)d ).OnModelChanged( e );
} }
/// <summary> /// <summary>
/// Provides derived classes an opportunity to handle changes to the Model property. /// Provides derived classes an opportunity to handle changes to the Model property.
/// </summary> /// </summary>
protected virtual void OnModelChanged(DependencyPropertyChangedEventArgs e) protected virtual void OnModelChanged( DependencyPropertyChangedEventArgs e )
{ {
if (Model != null) if( Model != null )
SetLayoutItem(Model.Root.Manager.GetLayoutItemFromModel(Model)); SetLayoutItem( Model.Root.Manager.GetLayoutItemFromModel( Model ) );
else else
SetLayoutItem(null); SetLayoutItem( null );
//UpdateLogicalParent(); //UpdateLogicalParent();
} }
@ -89,8 +103,8 @@ namespace Xceed.Wpf.AvalonDock.Controls
/// LayoutItem Read-Only Dependency Property /// LayoutItem Read-Only Dependency Property
/// </summary> /// </summary>
private static readonly DependencyPropertyKey LayoutItemPropertyKey private static readonly DependencyPropertyKey LayoutItemPropertyKey
= DependencyProperty.RegisterReadOnly("LayoutItem", typeof(LayoutItem), typeof(LayoutAnchorableTabItem), = DependencyProperty.RegisterReadOnly( "LayoutItem", typeof( LayoutItem ), typeof( LayoutAnchorableTabItem ),
new FrameworkPropertyMetadata((LayoutItem)null)); new FrameworkPropertyMetadata( (LayoutItem)null ) );
public static readonly DependencyProperty LayoutItemProperty public static readonly DependencyProperty LayoutItemProperty
= LayoutItemPropertyKey.DependencyProperty; = LayoutItemPropertyKey.DependencyProperty;
@ -101,7 +115,10 @@ namespace Xceed.Wpf.AvalonDock.Controls
/// </summary> /// </summary>
public LayoutItem LayoutItem public LayoutItem LayoutItem
{ {
get { return (LayoutItem)GetValue(LayoutItemProperty); } get
{
return (LayoutItem)GetValue( LayoutItemProperty );
}
} }
/// <summary> /// <summary>
@ -109,105 +126,75 @@ namespace Xceed.Wpf.AvalonDock.Controls
/// This dependency property indicates the LayoutItem attached to this tag item. /// This dependency property indicates the LayoutItem attached to this tag item.
/// </summary> /// </summary>
/// <param name="value">The new value for the property.</param> /// <param name="value">The new value for the property.</param>
protected void SetLayoutItem(LayoutItem value) protected void SetLayoutItem( LayoutItem value )
{ {
SetValue(LayoutItemPropertyKey, value); SetValue( LayoutItemPropertyKey, value );
} }
#endregion #endregion
private bool _isMouseDown = false; protected override void OnMouseLeftButtonDown( System.Windows.Input.MouseButtonEventArgs e )
private static LayoutAnchorableTabItem _draggingItem = null;
// There's an issue with panes resizing when selecting another tab, causing a
// mouse leave event to make the tab undock. This fixes that.
private static bool _cancelNextMouseLeave = false;
internal static bool IsDraggingItem()
{
return _draggingItem != null;
}
internal static LayoutAnchorableTabItem GetDraggingItem()
{
return _draggingItem;
}
internal static void ResetDraggingItem()
{
_draggingItem = null;
}
internal static void CancelNextMouseLeave()
{
_cancelNextMouseLeave = true;
}
protected override void OnMouseLeftButtonDown(System.Windows.Input.MouseButtonEventArgs e)
{ {
base.OnMouseLeftButtonDown(e); base.OnMouseLeftButtonDown( e );
_isMouseDown = true; _isMouseDown = true;
_draggingItem = this; _draggingItem = this;
} }
protected override void OnMouseMove(System.Windows.Input.MouseEventArgs e) protected override void OnMouseMove( System.Windows.Input.MouseEventArgs e )
{ {
base.OnMouseMove(e); base.OnMouseMove( e );
if (e.LeftButton != MouseButtonState.Pressed) if( e.LeftButton != MouseButtonState.Pressed )
{ {
_isMouseDown = false; _isMouseDown = false;
_draggingItem = null; _draggingItem = null;
} }
else else
{ {
_cancelNextMouseLeave = false; _cancelMouseLeave = false;
} }
} }
protected override void OnMouseLeftButtonUp(System.Windows.Input.MouseButtonEventArgs e) protected override void OnMouseLeftButtonUp( System.Windows.Input.MouseButtonEventArgs e )
{ {
_isMouseDown = false; _isMouseDown = false;
base.OnMouseLeftButtonUp(e); base.OnMouseLeftButtonUp( e );
Model.IsActive = true; Model.IsActive = true;
} }
protected override void OnMouseLeave(System.Windows.Input.MouseEventArgs e) protected override void OnMouseLeave( System.Windows.Input.MouseEventArgs e )
{ {
base.OnMouseLeave(e); base.OnMouseLeave( e );
if (_isMouseDown && e.LeftButton == MouseButtonState.Pressed) if( _isMouseDown && e.LeftButton == MouseButtonState.Pressed )
{
if (!_cancelNextMouseLeave)
{
_draggingItem = this;
}
else
{ {
_draggingItem = null; // drag the item if the mouse leave is not canceled.
} // Mouse leave should be canceled when selecting a new tab to prevent automatic undock when Panel size is Auto.
_draggingItem = !_cancelMouseLeave ? this : null;
} }
_isMouseDown = false; _isMouseDown = false;
_cancelNextMouseLeave = false; _cancelMouseLeave = false;
} }
protected override void OnMouseEnter(MouseEventArgs e) protected override void OnMouseEnter( MouseEventArgs e )
{ {
base.OnMouseEnter(e); base.OnMouseEnter( e );
if (_draggingItem != null && if( _draggingItem != null &&
_draggingItem != this && _draggingItem != this &&
e.LeftButton == MouseButtonState.Pressed) e.LeftButton == MouseButtonState.Pressed )
{ {
var model = Model; var model = Model;
var container = model.Parent as ILayoutContainer; var container = model.Parent as ILayoutContainer;
var containerPane = model.Parent as ILayoutPane; var containerPane = model.Parent as ILayoutPane;
if( (containerPane is LayoutAnchorablePane) && !((LayoutAnchorablePane)containerPane).CanRepositionItems ) if( ( containerPane is LayoutAnchorablePane ) && !( (LayoutAnchorablePane)containerPane ).CanRepositionItems )
return; return;
if( (containerPane.Parent != null) && (containerPane.Parent is LayoutAnchorablePaneGroup) && !((LayoutAnchorablePaneGroup)containerPane.Parent).CanRepositionItems ) if( ( containerPane.Parent != null ) && ( containerPane.Parent is LayoutAnchorablePaneGroup ) && !( (LayoutAnchorablePaneGroup)containerPane.Parent ).CanRepositionItems )
return; return;
var childrenList = container.Children.ToList(); var childrenList = container.Children.ToList();
@ -215,10 +202,29 @@ namespace Xceed.Wpf.AvalonDock.Controls
} }
} }
protected override void OnPreviewGotKeyboardFocus(KeyboardFocusChangedEventArgs e) protected override void OnPreviewGotKeyboardFocus( KeyboardFocusChangedEventArgs e )
{
base.OnPreviewGotKeyboardFocus( e );
}
internal static bool IsDraggingItem()
{
return _draggingItem != null;
}
internal static LayoutAnchorableTabItem GetDraggingItem()
{ {
base.OnPreviewGotKeyboardFocus(e); return _draggingItem;
}
internal static void ResetDraggingItem()
{
_draggingItem = null;
}
internal static void CancelMouseLeave()
{
_cancelMouseLeave = true;
} }
} }
} }

23
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutFloatingWindowControl.cs

@ -36,6 +36,7 @@ namespace Xceed.Wpf.AvalonDock.Controls
public abstract class LayoutFloatingWindowControl : Window, ILayoutControl public abstract class LayoutFloatingWindowControl : Window, ILayoutControl
{ {
private ResourceDictionary currentThemeResourceDictionary; // = null private ResourceDictionary currentThemeResourceDictionary; // = null
private bool _isInternalChange; //false
static LayoutFloatingWindowControl() static LayoutFloatingWindowControl()
{ {
@ -387,7 +388,9 @@ namespace Xceed.Wpf.AvalonDock.Controls
posElement.IsMaximized = isMaximized; posElement.IsMaximized = isMaximized;
} }
IsMaximized = isMaximized; IsMaximized = isMaximized;
_isInternalChange = true;
WindowState = isMaximized ? WindowState.Maximized : WindowState.Normal; WindowState = isMaximized ? WindowState.Maximized : WindowState.Normal;
_isInternalChange = false;
} }
@ -529,19 +532,21 @@ namespace Xceed.Wpf.AvalonDock.Controls
protected override void OnStateChanged( EventArgs e ) protected override void OnStateChanged( EventArgs e )
{ {
//Windows sometimes send unwanted state changes (when minimizing application for instance) if( !_isInternalChange )
//We force internal state to be used {
if( WindowState == WindowState.Maximized )
{
UpdateMaximizedState( true );
}
else
{
WindowState = IsMaximized ? WindowState.Maximized : WindowState.Normal; WindowState = IsMaximized ? WindowState.Maximized : WindowState.Normal;
}
}
base.OnStateChanged( e ); base.OnStateChanged( e );
} }
#endregion #endregion
} }
} }

46
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutGridControl.cs

@ -380,60 +380,48 @@ namespace Xceed.Wpf.AvalonDock.Controls
var prevChildModel = (ILayoutPositionableElement)(prevChild as ILayoutControl).Model; var prevChildModel = (ILayoutPositionableElement)(prevChild as ILayoutControl).Model;
var nextChildModel = (ILayoutPositionableElement)(nextChild as ILayoutControl).Model; var nextChildModel = (ILayoutPositionableElement)(nextChild as ILayoutControl).Model;
if (Orientation == System.Windows.Controls.Orientation.Horizontal) if( Orientation == System.Windows.Controls.Orientation.Horizontal )
{
if (prevChildModel.DockWidth.IsStar)
{ {
prevChildModel.DockWidth = new GridLength(prevChildModel.DockWidth.Value * (prevChildActualSize.Width + delta) / prevChildActualSize.Width, GridUnitType.Star); if( prevChildModel.DockWidth.IsStar )
}
else if (prevChildModel.DockWidth.IsAuto)
{ {
prevChildModel.DockWidth = new GridLength(prevChildActualSize.Width + delta, GridUnitType.Pixel); prevChildModel.DockWidth = new GridLength( prevChildModel.DockWidth.Value * ( prevChildActualSize.Width + delta ) / prevChildActualSize.Width, GridUnitType.Star );
} }
else else
{ {
prevChildModel.DockWidth = new GridLength(prevChildModel.DockWidth.Value + delta, GridUnitType.Pixel); var width = ( prevChildModel.DockWidth.IsAuto ) ? prevChildActualSize.Width : prevChildModel.DockWidth.Value;
prevChildModel.DockWidth = new GridLength( width + delta, GridUnitType.Pixel );
} }
if (nextChildModel.DockWidth.IsStar) if( nextChildModel.DockWidth.IsStar )
{
nextChildModel.DockWidth = new GridLength(nextChildModel.DockWidth.Value * (nextChildActualSize.Width - delta) / nextChildActualSize.Width, GridUnitType.Star);
}
else if (nextChildModel.DockWidth.IsAuto)
{ {
nextChildModel.DockWidth = new GridLength(nextChildActualSize.Width - delta, GridUnitType.Pixel); nextChildModel.DockWidth = new GridLength( nextChildModel.DockWidth.Value * ( nextChildActualSize.Width - delta ) / nextChildActualSize.Width, GridUnitType.Star );
} }
else else
{ {
nextChildModel.DockWidth = new GridLength(nextChildModel.DockWidth.Value - delta, GridUnitType.Pixel); var width = ( nextChildModel.DockWidth.IsAuto ) ? nextChildActualSize.Width : nextChildModel.DockWidth.Value;
nextChildModel.DockWidth = new GridLength( width - delta, GridUnitType.Pixel );
} }
} }
else else
{ {
if (prevChildModel.DockHeight.IsStar) if( prevChildModel.DockHeight.IsStar )
{ {
prevChildModel.DockHeight = new GridLength(prevChildModel.DockHeight.Value * (prevChildActualSize.Height + delta) / prevChildActualSize.Height, GridUnitType.Star); prevChildModel.DockHeight = new GridLength( prevChildModel.DockHeight.Value * ( prevChildActualSize.Height + delta ) / prevChildActualSize.Height, GridUnitType.Star );
}
else if (prevChildModel.DockHeight.IsAuto)
{
prevChildModel.DockHeight = new GridLength(prevChildActualSize.Height + delta, GridUnitType.Pixel);
} }
else else
{ {
prevChildModel.DockHeight = new GridLength(prevChildModel.DockHeight.Value + delta, GridUnitType.Pixel); var height = ( prevChildModel.DockHeight.IsAuto ) ? prevChildActualSize.Height : prevChildModel.DockHeight.Value;
prevChildModel.DockHeight = new GridLength( height + delta, GridUnitType.Pixel );
} }
if (nextChildModel.DockHeight.IsStar) if( nextChildModel.DockHeight.IsStar )
{
nextChildModel.DockHeight = new GridLength(nextChildModel.DockHeight.Value * (nextChildActualSize.Height - delta) / nextChildActualSize.Height, GridUnitType.Star);
}
else if (nextChildModel.DockHeight.IsAuto)
{ {
nextChildModel.DockHeight = new GridLength(nextChildActualSize.Height - delta, GridUnitType.Pixel); nextChildModel.DockHeight = new GridLength( nextChildModel.DockHeight.Value * ( nextChildActualSize.Height - delta ) / nextChildActualSize.Height, GridUnitType.Star );
} }
else else
{ {
nextChildModel.DockHeight = new GridLength(nextChildModel.DockHeight.Value - delta, GridUnitType.Pixel); var height = ( nextChildModel.DockHeight.IsAuto ) ? nextChildActualSize.Height : nextChildModel.DockHeight.Value;
nextChildModel.DockHeight = new GridLength( height - delta, GridUnitType.Pixel );
} }
} }

12
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutItem.cs

@ -203,14 +203,14 @@ namespace Xceed.Wpf.AvalonDock.Controls
{ {
_view = new ContentPresenter(); _view = new ContentPresenter();
_view.SetBinding(ContentPresenter.ContentProperty, new Binding("Content") { Source = LayoutElement }); _view.SetBinding( ContentPresenter.ContentProperty, new Binding( "Content" ) { Source = LayoutElement } );
if ((LayoutElement != null) && (LayoutElement.Root != null)) if( ( LayoutElement != null ) && ( LayoutElement.Root != null ) )
{ {
_view.SetBinding(ContentPresenter.ContentTemplateProperty, new Binding("LayoutItemTemplate") { Source = LayoutElement.Root.Manager }); _view.SetBinding( ContentPresenter.ContentTemplateProperty, new Binding( "LayoutItemTemplate" ) { Source = LayoutElement.Root.Manager } );
_view.SetBinding(ContentPresenter.ContentTemplateSelectorProperty, new Binding("LayoutItemTemplateSelector") { Source = LayoutElement.Root.Manager }); _view.SetBinding( ContentPresenter.ContentTemplateSelectorProperty, new Binding( "LayoutItemTemplateSelector" ) { Source = LayoutElement.Root.Manager } );
if (LayoutElement.Root.Manager != null) if( LayoutElement.Root.Manager != null )
{ {
LayoutElement.Root.Manager.InternalAddLogicalChild(_view); LayoutElement.Root.Manager.InternalAddLogicalChild( _view );
} }
} }
} }

140
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/OverlayWindow.cs

@ -209,6 +209,7 @@ namespace Xceed.Wpf.AvalonDock.Controls
yield return new AnchorablePaneDropTarget(dropAreaAnchorablePane.AreaElement, _anchorablePaneDropTargetTop.GetScreenArea(), DropTargetType.AnchorablePaneDockTop); yield return new AnchorablePaneDropTarget(dropAreaAnchorablePane.AreaElement, _anchorablePaneDropTargetTop.GetScreenArea(), DropTargetType.AnchorablePaneDockTop);
yield return new AnchorablePaneDropTarget(dropAreaAnchorablePane.AreaElement, _anchorablePaneDropTargetRight.GetScreenArea(), DropTargetType.AnchorablePaneDockRight); yield return new AnchorablePaneDropTarget(dropAreaAnchorablePane.AreaElement, _anchorablePaneDropTargetRight.GetScreenArea(), DropTargetType.AnchorablePaneDockRight);
yield return new AnchorablePaneDropTarget(dropAreaAnchorablePane.AreaElement, _anchorablePaneDropTargetBottom.GetScreenArea(), DropTargetType.AnchorablePaneDockBottom); yield return new AnchorablePaneDropTarget(dropAreaAnchorablePane.AreaElement, _anchorablePaneDropTargetBottom.GetScreenArea(), DropTargetType.AnchorablePaneDockBottom);
if( _anchorablePaneDropTargetInto.IsVisible )
yield return new AnchorablePaneDropTarget(dropAreaAnchorablePane.AreaElement, _anchorablePaneDropTargetInto.GetScreenArea(), DropTargetType.AnchorablePaneDockInside); yield return new AnchorablePaneDropTarget(dropAreaAnchorablePane.AreaElement, _anchorablePaneDropTargetInto.GetScreenArea(), DropTargetType.AnchorablePaneDockInside);
var parentPaneModel = dropAreaAnchorablePane.AreaElement.Model as LayoutAnchorablePane; var parentPaneModel = dropAreaAnchorablePane.AreaElement.Model as LayoutAnchorablePane;
@ -342,6 +343,137 @@ namespace Xceed.Wpf.AvalonDock.Controls
_floatingWindow = null; _floatingWindow = null;
} }
/// <summary>
/// This method controls the DropTargetInto button of the overlay window.
/// It checks that only 1 of the defined ContentLayouts can be present on the LayoutDocumentPane or LayoutAnchorablePane.
/// The combination between the ContentLayout Title and the ContentId is the search key, and has to be unique.
/// If a floating window is dropped on a LayoutDocumentPane or LayoutAnchorablePane, it checks if one of the containing LayoutContents
/// is already present on the LayoutDocumentPane or LayoutAnchorablePane. If so, then it will disable the DropTargetInto button.
/// </summary>
/// <param name="positionableElement">The given LayoutDocumentPane or LayoutAnchorablePane</param>
private void SetDropTargetIntoVisibility( ILayoutPositionableElement positionableElement )
{
if( positionableElement is LayoutAnchorablePane )
{
_anchorablePaneDropTargetInto.Visibility = Visibility.Visible;
}
else if( positionableElement is LayoutDocumentPane )
{
_documentPaneDropTargetInto.Visibility = Visibility.Visible;
}
if( positionableElement == null || _floatingWindow.Model == null || positionableElement.AllowDuplicateContent )
{
return;
}
// Find all content layouts in the anchorable pane (object to drop on)
var contentLayoutsOnPositionableElementPane = GetAllLayoutContents( positionableElement );
// Find all content layouts in the floating window (object to drop)
var contentLayoutsOnFloatingWindow = GetAllLayoutContents( _floatingWindow.Model );
// If any of the content layouts is present in the drop area, then disable the DropTargetInto button.
foreach( var content in contentLayoutsOnFloatingWindow )
{
if( !contentLayoutsOnPositionableElementPane.Any( item =>
item.Title == content.Title &&
item.ContentId == content.ContentId ) )
{
continue;
}
if( positionableElement is LayoutAnchorablePane )
{
_anchorablePaneDropTargetInto.Visibility = Visibility.Hidden;
}
else if( positionableElement is LayoutDocumentPane )
{
_documentPaneDropTargetInto.Visibility = Visibility.Hidden;
}
break;
}
}
/// <summary>
/// Find any LayoutDocument or LayoutAnchorable from a given source (e.g. LayoutDocumentPane, LayoutAnchorableFloatingWindow, etc.)
/// </summary>
/// <param name="source">The given source to search in</param>
/// <returns>A list of all LayoutContent's</returns>
private List<LayoutContent> GetAllLayoutContents( object source )
{
var result = new List<LayoutContent>();
var documentFloatingWindow = source as LayoutDocumentFloatingWindow;
if( documentFloatingWindow != null )
{
foreach( var layoutElement in documentFloatingWindow.Children )
{
result.AddRange( GetAllLayoutContents( layoutElement ) );
}
}
var anchorableFloatingWindow = source as LayoutAnchorableFloatingWindow;
if( anchorableFloatingWindow != null )
{
foreach( var layoutElement in anchorableFloatingWindow.Children )
{
result.AddRange( GetAllLayoutContents( layoutElement ) );
}
}
var documentPaneGroup = source as LayoutDocumentPaneGroup;
if( documentPaneGroup != null )
{
foreach( var layoutDocumentPane in documentPaneGroup.Children )
{
result.AddRange( GetAllLayoutContents( layoutDocumentPane ) );
}
}
var anchorablePaneGroup = source as LayoutAnchorablePaneGroup;
if( anchorablePaneGroup != null )
{
foreach( var layoutDocumentPane in anchorablePaneGroup.Children )
{
result.AddRange( GetAllLayoutContents( layoutDocumentPane ) );
}
}
var documentPane = source as LayoutDocumentPane;
if( documentPane != null )
{
foreach( var layoutContent in documentPane.Children )
{
result.Add( layoutContent );
}
}
var anchorablePane = source as LayoutAnchorablePane;
if( anchorablePane != null )
{
foreach( var layoutContent in anchorablePane.Children )
{
result.Add( layoutContent );
}
}
var document = source as LayoutDocument;
if( document != null )
{
result.Add( document );
}
var anchorable = source as LayoutAnchorable;
if( anchorable != null )
{
result.Add( anchorable );
}
return result;
}
protected override void OnClosing(System.ComponentModel.CancelEventArgs e) protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
{ {
base.OnClosing(e); base.OnClosing(e);
@ -361,6 +493,10 @@ namespace Xceed.Wpf.AvalonDock.Controls
break; break;
case DropAreaType.AnchorablePane: case DropAreaType.AnchorablePane:
areaElement = _gridAnchorablePaneDropTargets; areaElement = _gridAnchorablePaneDropTargets;
var dropAreaAnchorablePaneGroup = area as DropArea<LayoutAnchorablePaneControl>;
var layoutAnchorablePane = dropAreaAnchorablePaneGroup.AreaElement.Model as LayoutAnchorablePane;
SetDropTargetIntoVisibility( layoutAnchorablePane );
break; break;
case DropAreaType.DocumentPaneGroup: case DropAreaType.DocumentPaneGroup:
{ {
@ -386,6 +522,8 @@ namespace Xceed.Wpf.AvalonDock.Controls
var layoutDocumentPane = dropAreaDocumentPaneGroup.AreaElement.Model as LayoutDocumentPane; var layoutDocumentPane = dropAreaDocumentPaneGroup.AreaElement.Model as LayoutDocumentPane;
var parentDocumentPaneGroup = layoutDocumentPane.Parent as LayoutDocumentPaneGroup; var parentDocumentPaneGroup = layoutDocumentPane.Parent as LayoutDocumentPaneGroup;
SetDropTargetIntoVisibility( layoutDocumentPane );
if (parentDocumentPaneGroup != null && if (parentDocumentPaneGroup != null &&
parentDocumentPaneGroup.Children.Where(c => c.IsVisible).Count() > 1) parentDocumentPaneGroup.Children.Where(c => c.IsVisible).Count() > 1)
{ {
@ -475,6 +613,8 @@ namespace Xceed.Wpf.AvalonDock.Controls
var layoutDocumentPane = dropAreaDocumentPaneGroup.AreaElement.Model as LayoutDocumentPane; var layoutDocumentPane = dropAreaDocumentPaneGroup.AreaElement.Model as LayoutDocumentPane;
var parentDocumentPaneGroup = layoutDocumentPane.Parent as LayoutDocumentPaneGroup; var parentDocumentPaneGroup = layoutDocumentPane.Parent as LayoutDocumentPaneGroup;
SetDropTargetIntoVisibility( layoutDocumentPane );
if (parentDocumentPaneGroup != null && if (parentDocumentPaneGroup != null &&
parentDocumentPaneGroup.Children.Where(c => c.IsVisible).Count() > 1) parentDocumentPaneGroup.Children.Where(c => c.IsVisible).Count() > 1)
{ {

2
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/ILayoutPositionableElement.cs

@ -39,7 +39,7 @@ namespace Xceed.Wpf.AvalonDock.Layout
double DockMinWidth { get; set; } double DockMinWidth { get; set; }
double DockMinHeight { get; set; } double DockMinHeight { get; set; }
bool AllowDuplicateContent { get; set; }
bool IsVisible { get; } bool IsVisible { get; }
} }

56
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/LayoutAnchorableFloatingWindow.cs

@ -21,6 +21,7 @@ using System.Text;
using System.Windows.Markup; using System.Windows.Markup;
using System.Diagnostics; using System.Diagnostics;
using System.Xml.Serialization; using System.Xml.Serialization;
using System.Xml;
namespace Xceed.Wpf.AvalonDock.Layout namespace Xceed.Wpf.AvalonDock.Layout
{ {
@ -156,11 +157,15 @@ namespace Xceed.Wpf.AvalonDock.Layout
void ILayoutElementWithVisibility.ComputeVisibility() void ILayoutElementWithVisibility.ComputeVisibility()
{ {
if (RootPanel != null) ComputeVisibility();
}
private void ComputeVisibility()
{
if( RootPanel != null )
IsVisible = RootPanel.IsVisible; IsVisible = RootPanel.IsVisible;
else else
IsVisible = false; IsVisible = false;
} }
public override bool IsValid public override bool IsValid
@ -168,6 +173,53 @@ namespace Xceed.Wpf.AvalonDock.Layout
get { return RootPanel != null; } get { return RootPanel != null; }
} }
public override void ReadXml( XmlReader reader )
{
reader.MoveToContent();
if( reader.IsEmptyElement )
{
reader.Read();
ComputeVisibility();
return;
}
var localName = reader.LocalName;
reader.Read();
while( true )
{
if( reader.LocalName.Equals( localName ) && (reader.NodeType == XmlNodeType.EndElement) )
{
break;
}
if( reader.NodeType == XmlNodeType.Whitespace )
{
reader.Read();
continue;
}
XmlSerializer serializer;
if( reader.LocalName.Equals("LayoutAnchorablePaneGroup") )
{
serializer = new XmlSerializer( typeof( LayoutAnchorablePaneGroup ) );
}
else
{
var type = LayoutRoot.FindType( reader.LocalName );
if( type == null )
{
throw new ArgumentException( "AvalonDock.LayoutAnchorableFloatingWindow doesn't know how to deserialize " + reader.LocalName );
}
serializer = new XmlSerializer( type );
}
RootPanel = ( LayoutAnchorablePaneGroup )serializer.Deserialize( reader );
}
reader.ReadEndElement();
}
#if TRACE #if TRACE
public override void ConsoleDump(int tab) public override void ConsoleDump(int tab)
{ {

21
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/LayoutContent.cs

@ -24,6 +24,7 @@ using System.Windows;
using System.Globalization; using System.Globalization;
using System.Windows.Media; using System.Windows.Media;
using System.ComponentModel; using System.ComponentModel;
using Xceed.Wpf.AvalonDock.Controls;
namespace Xceed.Wpf.AvalonDock.Layout namespace Xceed.Wpf.AvalonDock.Layout
{ {
@ -84,31 +85,25 @@ namespace Xceed.Wpf.AvalonDock.Layout
#region ContentId #region ContentId
//Added to make ContentId bindable private string _contentId = null;
public static DependencyProperty ContentIdProperty =
DependencyProperty.Register(nameof(ContentId),
typeof(string), typeof(LayoutContent), new FrameworkPropertyMetadata(null, (s, e) =>
{
(s as LayoutContent)?.RaisePropertyChanged(nameof(ContentId));
}));
public string ContentId public string ContentId
{ {
get get
{ {
if (GetValue(ContentIdProperty) == null) if (_contentId == null)
{ {
var contentAsControl = _content as FrameworkElement; var contentAsControl = _content as FrameworkElement;
if (contentAsControl != null && !string.IsNullOrWhiteSpace(contentAsControl.Name)) if (contentAsControl != null && !string.IsNullOrWhiteSpace(contentAsControl.Name))
return contentAsControl.Name; return contentAsControl.Name;
} }
return (string)GetValue(ContentIdProperty); return _contentId;
} }
set set
{ {
if (!String.Equals(GetValue(ContentIdProperty) as string, value)) if (_contentId != value)
{ {
SetValue(ContentIdProperty, value); _contentId = value;
RaisePropertyChanged("ContentId");
} }
} }
} }
@ -133,7 +128,7 @@ namespace Xceed.Wpf.AvalonDock.Layout
parentSelector.SelectedContentIndex = _isSelected ? parentSelector.IndexOf(this) : -1; parentSelector.SelectedContentIndex = _isSelected ? parentSelector.IndexOf(this) : -1;
OnIsSelectedChanged(oldValue, value); OnIsSelectedChanged(oldValue, value);
RaisePropertyChanged("IsSelected"); RaisePropertyChanged("IsSelected");
Controls.LayoutAnchorableTabItem.CancelNextMouseLeave(); LayoutAnchorableTabItem.CancelMouseLeave();
} }
} }
} }

47
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/LayoutDocumentFloatingWindow.cs

@ -20,6 +20,8 @@ using System.Linq;
using System.Text; using System.Text;
using System.Windows.Markup; using System.Windows.Markup;
using System.Diagnostics; using System.Diagnostics;
using System.Xml.Serialization;
using System.Xml;
namespace Xceed.Wpf.AvalonDock.Layout namespace Xceed.Wpf.AvalonDock.Layout
{ {
@ -92,6 +94,51 @@ namespace Xceed.Wpf.AvalonDock.Layout
get { return RootDocument != null; } get { return RootDocument != null; }
} }
public override void ReadXml( XmlReader reader )
{
reader.MoveToContent();
if( reader.IsEmptyElement )
{
reader.Read();
return;
}
var localName = reader.LocalName;
reader.Read();
while( true )
{
if( reader.LocalName.Equals(localName) && (reader.NodeType == XmlNodeType.EndElement) )
{
break;
}
if( reader.NodeType == XmlNodeType.Whitespace )
{
reader.Read();
continue;
}
XmlSerializer serializer;
if( reader.LocalName.Equals( "LayoutDocument" ) )
{
serializer = new XmlSerializer( typeof( LayoutDocument ) );
}
else
{
var type = LayoutRoot.FindType( reader.LocalName );
if( type == null )
{
throw new ArgumentException( "AvalonDock.LayoutDocumentFloatingWindow doesn't know how to deserialize " + reader.LocalName );
}
serializer = new XmlSerializer( type );
}
RootDocument = ( LayoutDocument )serializer.Deserialize( reader );
}
reader.ReadEndElement();
}
#if TRACE #if TRACE
public override void ConsoleDump(int tab) public override void ConsoleDump(int tab)

20
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/LayoutFloatingWindow.cs

@ -21,13 +21,13 @@ using System.Text;
using System.Windows.Markup; using System.Windows.Markup;
using System.Windows; using System.Windows;
using System.Xml.Serialization; using System.Xml.Serialization;
using System.Xml.Schema;
using System.Xml;
namespace Xceed.Wpf.AvalonDock.Layout namespace Xceed.Wpf.AvalonDock.Layout
{ {
[Serializable] [Serializable]
[XmlInclude(typeof(LayoutAnchorableFloatingWindow))] public abstract class LayoutFloatingWindow : LayoutElement, ILayoutContainer, IXmlSerializable
[XmlInclude(typeof(LayoutDocumentFloatingWindow))]
public abstract class LayoutFloatingWindow : LayoutElement, ILayoutContainer
{ {
public LayoutFloatingWindow() public LayoutFloatingWindow()
{ {
@ -45,8 +45,22 @@ namespace Xceed.Wpf.AvalonDock.Layout
public abstract bool IsValid { get; } public abstract bool IsValid { get; }
public XmlSchema GetSchema()
{
return null;
}
public abstract void ReadXml( XmlReader reader );
public virtual void WriteXml( XmlWriter writer )
{
foreach( var child in Children )
{
var type = child.GetType();
var serializer = new XmlSerializer( type );
serializer.Serialize( writer, child );
}
}
} }
} }

29
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/LayoutPositionableGroup.cs

@ -80,6 +80,34 @@ namespace Xceed.Wpf.AvalonDock.Layout
} }
#region AllowDuplicateContent
private bool _allowDuplicateContent = true;
/// <summary>
/// Gets or sets the AllowDuplicateContent property.
/// When this property is true, then the LayoutDocumentPane or LayoutAnchorablePane allows dropping
/// duplicate content (according to its Title and ContentId). When this dependency property is false,
/// then the LayoutDocumentPane or LayoutAnchorablePane hides the OverlayWindow.DropInto button to prevent dropping of duplicate content.
/// </summary>
public bool AllowDuplicateContent
{
get
{
return _allowDuplicateContent;
}
set
{
if( _allowDuplicateContent != value )
{
RaisePropertyChanging( "AllowDuplicateContent" );
_allowDuplicateContent = value;
RaisePropertyChanged( "AllowDuplicateContent" );
}
}
}
#endregion
#region CanRepositionItems #region CanRepositionItems
private bool _canRepositionItems = true; private bool _canRepositionItems = true;
@ -102,7 +130,6 @@ namespace Xceed.Wpf.AvalonDock.Layout
#endregion #endregion
#region DockMinWidth #region DockMinWidth
private double _dockMinWidth = 25.0; private double _dockMinWidth = 25.0;

286
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/LayoutRoot.cs

@ -23,12 +23,14 @@ using System.Collections.ObjectModel;
using System.Windows.Markup; using System.Windows.Markup;
using System.Xml.Serialization; using System.Xml.Serialization;
using Standard; using Standard;
using System.Xml;
using System.Xml.Schema;
namespace Xceed.Wpf.AvalonDock.Layout namespace Xceed.Wpf.AvalonDock.Layout
{ {
[ContentProperty("RootPanel")] [ContentProperty("RootPanel")]
[Serializable] [Serializable]
public class LayoutRoot : LayoutElement, ILayoutContainer, ILayoutRoot public class LayoutRoot : LayoutElement, ILayoutContainer, ILayoutRoot, IXmlSerializable
{ {
public LayoutRoot() public LayoutRoot()
{ {
@ -662,6 +664,288 @@ namespace Xceed.Wpf.AvalonDock.Layout
#endregion #endregion
public XmlSchema GetSchema()
{
return null;
}
public void ReadXml( XmlReader reader )
{
reader.MoveToContent();
if( reader.IsEmptyElement )
{
reader.Read();
return;
}
var layoutPanelElements = ReadRootPanel( reader );
if( layoutPanelElements != null )
{
//Create the RootPanel with the first child
RootPanel = new LayoutPanel( layoutPanelElements.First() );
//Add all children to RootPanel
for( int i = 1; i < layoutPanelElements.Count; ++i )
{
RootPanel.Children.Add( layoutPanelElements[ i ] );
}
}
TopSide = ( LayoutAnchorSide )ReadElement( reader );
if( TopSide != null )
{
TopSide.Children.Add( ( LayoutAnchorGroup )ReadElement( reader ) );
reader.Read();
}
RightSide = ( LayoutAnchorSide )ReadElement( reader );
if( RightSide != null )
{
RightSide.Children.Add( ( LayoutAnchorGroup )ReadElement( reader ) );
reader.Read();
}
LeftSide = ( LayoutAnchorSide )ReadElement( reader );
if( LeftSide != null )
{
LeftSide.Children.Add( ( LayoutAnchorGroup )ReadElement( reader ) );
reader.Read();
}
BottomSide = ( LayoutAnchorSide )ReadElement( reader );
if( BottomSide != null )
{
BottomSide.Children.Add( ( LayoutAnchorGroup )ReadElement( reader ) );
reader.Read();
}
FloatingWindows.Clear();
var floatingWindows = ReadElementList( reader );
foreach( var floatingWindow in floatingWindows )
{
FloatingWindows.Add( ( LayoutFloatingWindow )floatingWindow );
}
Hidden.Clear();
var hidden = ReadElementList( reader );
foreach( var hiddenObject in hidden )
{
Hidden.Add( ( LayoutAnchorable )hiddenObject );
}
}
private List<ILayoutPanelElement> ReadRootPanel( XmlReader reader )
{
var result = new List<ILayoutPanelElement>();
var startElementName = reader.LocalName;
reader.Read();
if( reader.LocalName.Equals(startElementName) && (reader.NodeType == XmlNodeType.EndElement) )
{
return null;
}
while( reader.NodeType == XmlNodeType.Whitespace )
{
reader.Read();
}
if( reader.LocalName.Equals("RootPanel"))
{
reader.Read();
while( true )
{
//Read all RootPanel children
var element = ReadElement( reader ) as ILayoutPanelElement;
if( element != null )
{
result.Add( element );
}
else if( reader.NodeType == XmlNodeType.EndElement )
{
break;
}
}
}
reader.ReadEndElement();
return result;
}
private List<object> ReadElementList( XmlReader reader )
{
var resultList = new List<object>();
if( reader.IsEmptyElement )
{
reader.Read();
return resultList;
}
var startElementName = reader.LocalName;
reader.Read();
if( reader.LocalName.Equals(startElementName) && (reader.NodeType == XmlNodeType.EndElement) )
{
return null;
}
while( reader.NodeType == XmlNodeType.Whitespace )
{
reader.Read();
}
while( true )
{
var result = ReadElement( reader ) as LayoutFloatingWindow;
if( result == null )
{
break;
}
resultList.Add( result );
}
reader.ReadEndElement();
return resultList;
}
private object ReadElement( XmlReader reader )
{
if( reader.NodeType == XmlNodeType.EndElement )
{
return null;
}
while( reader.NodeType == XmlNodeType.Whitespace )
{
reader.Read();
}
XmlSerializer serializer;
switch( reader.LocalName )
{
case "LayoutAnchorablePaneGroup":
serializer = new XmlSerializer( typeof( LayoutAnchorablePaneGroup ) );
break;
case "LayoutAnchorablePane":
serializer = new XmlSerializer( typeof( LayoutAnchorablePane ) );
break;
case "LayoutAnchorable":
serializer = new XmlSerializer( typeof( LayoutAnchorable ) );
break;
case "LayoutDocumentPaneGroup":
serializer = new XmlSerializer( typeof( LayoutDocumentPaneGroup ) );
break;
case "LayoutDocumentPane":
serializer = new XmlSerializer( typeof( LayoutDocumentPane ) );
break;
case "LayoutDocument":
serializer = new XmlSerializer( typeof( LayoutDocument ) );
break;
case "LayoutAnchorGroup":
serializer = new XmlSerializer( typeof( LayoutAnchorGroup ) );
break;
case "LayoutPanel":
serializer = new XmlSerializer( typeof( LayoutPanel ) );
break;
case "LayoutDocumentFloatingWindow":
serializer = new XmlSerializer( typeof( LayoutDocumentFloatingWindow ) );
break;
case "LayoutAnchorableFloatingWindow":
serializer = new XmlSerializer( typeof( LayoutAnchorableFloatingWindow ) );
break;
case "LeftSide":
case "RightSide":
case "TopSide":
case "BottomSide":
if( reader.IsEmptyElement )
{
reader.Read();
return null;
}
reader.Read();
return new LayoutAnchorSide();
default:
var type = LayoutRoot.FindType( reader.LocalName );
if( type == null )
{
throw new ArgumentException( "AvalonDock.LayoutRoot doesn't know how to deserialize " + reader.LocalName );
}
serializer = new XmlSerializer( type );
break;
}
return serializer.Deserialize( reader );
}
public void WriteXml( XmlWriter writer )
{
writer.WriteStartElement( "RootPanel" );
if( RootPanel != null )
{
RootPanel.WriteXml( writer );
}
writer.WriteEndElement();
writer.WriteStartElement( "TopSide" );
if( TopSide != null )
{
TopSide.WriteXml( writer );
}
writer.WriteEndElement();
writer.WriteStartElement( "RightSide" );
if( RightSide != null )
{
RightSide.WriteXml( writer );
}
writer.WriteEndElement();
writer.WriteStartElement( "LeftSide" );
if( LeftSide != null )
{
LeftSide.WriteXml( writer );
}
writer.WriteEndElement();
writer.WriteStartElement( "BottomSide" );
if( BottomSide != null )
{
BottomSide.WriteXml( writer );
}
writer.WriteEndElement();
// Write all floating windows (can be LayoutDocumentFloatingWindow or LayoutAnchorableFloatingWindow).
// To prevent "can not create instance of abstract type", the type is retrieved with GetType().Name
writer.WriteStartElement( "FloatingWindows" );
foreach( var layoutFloatingWindow in FloatingWindows )
{
writer.WriteStartElement( layoutFloatingWindow.GetType().Name );
layoutFloatingWindow.WriteXml( writer );
writer.WriteEndElement();
}
writer.WriteEndElement();
writer.WriteStartElement( "Hidden" );
foreach( var layoutAnchorable in Hidden )
{
layoutAnchorable.WriteXml( writer );
}
writer.WriteEndElement();
}
internal static Type FindType( string name )
{
foreach( var assembly in AppDomain.CurrentDomain.GetAssemblies() )
{
foreach( var type in assembly.GetTypes() )
{
if( type.Name.Equals( name ) )
return type;
}
}
return null;
}
#if TRACE #if TRACE
public override void ConsoleDump(int tab) public override void ConsoleDump(int tab)
{ {

4
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Themes/DictionaryTheme.cs

@ -24,6 +24,10 @@ namespace Xceed.Wpf.AvalonDock.Themes
{ {
public abstract class DictionaryTheme : Theme public abstract class DictionaryTheme : Theme
{ {
public DictionaryTheme()
{
}
public DictionaryTheme( ResourceDictionary themeResourceDictionary ) public DictionaryTheme( ResourceDictionary themeResourceDictionary )
{ {
this.ThemeResourceDictionary = themeResourceDictionary; this.ThemeResourceDictionary = themeResourceDictionary;

2
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.DataGrid/AssemblyVersionInfo.cs

@ -19,7 +19,7 @@
internal static class _XceedVersionInfo internal static class _XceedVersionInfo
{ {
[System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )] [System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )]
public const string BaseVersion = "3.1"; public const string BaseVersion = "3.2";
[System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )] [System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )]
public const string Version = BaseVersion + ".0.0"; public const string Version = BaseVersion + ".0.0";
[System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )] [System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )]

7
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.DataGrid/CheckBox.cs

@ -80,13 +80,6 @@ namespace Xceed.Wpf.DataGrid
#endregion IsThreeState Property #endregion IsThreeState Property
public override void OnApplyTemplate()
{
base.OnApplyTemplate();
ChildCheckBox.Background = new System.Windows.Media.SolidColorBrush( System.Windows.Media.Colors.Blue );
}
public static readonly RoutedEvent CheckedEvent; public static readonly RoutedEvent CheckedEvent;
public static readonly RoutedEvent UncheckedEvent; public static readonly RoutedEvent UncheckedEvent;
public static readonly RoutedEvent IndeterminateEvent; public static readonly RoutedEvent IndeterminateEvent;

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

@ -100,7 +100,7 @@
<xctk:WindowContainer ModalBackgroundBrush="LightGray"> <xctk:WindowContainer ModalBackgroundBrush="LightGray">
<xctk:ChildWindow x:Name="_childWindow" <xctk:ChildWindow x:Name="_childWindow"
Width="350" Width="350"
Height="220" Height="230"
Caption="{Binding Text, ElementName=_txtCaption}" Caption="{Binding Text, ElementName=_txtCaption}"
IsModal="{Binding IsChecked, ElementName=_chkIsModal}" IsModal="{Binding IsChecked, ElementName=_chkIsModal}"
Left="{Binding Value, ElementName=_txtLeft, Mode=TwoWay}" Left="{Binding Value, ElementName=_txtLeft, Mode=TwoWay}"

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

@ -269,8 +269,8 @@
<CheckBox Grid.Column="0" <CheckBox Grid.Column="0"
Grid.Row="6" Grid.Row="6"
Grid.ColumnSpan="2" Grid.ColumnSpan="2"
Content="ShowAdvancedButton" Content="ShowTabHeaders"
IsChecked="{Binding ElementName=_colorPicker, Path=ShowAdvancedButton, Mode=TwoWay}" /> IsChecked="{Binding ElementName=_colorPicker, Path=ShowTabHeaders, Mode=TwoWay}" />
<CheckBox Grid.Column="0" <CheckBox Grid.Column="0"
Grid.Row="7" Grid.Row="7"
Grid.ColumnSpan="2" Grid.ColumnSpan="2"

29
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/IconButtonView.xaml.cs.txt

@ -0,0 +1,29 @@
/***************************************************************************************
Toolkit for WPF
Copyright (C) 2007-2016 Xceed Software Inc.
This program is provided to you under the terms of the Microsoft Public
License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license
For more features, controls, and fast professional support,
pick up the Plus Edition at https://xceed.com/xceed-toolkit-plus-for-wpf/
Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids
*************************************************************************************/
namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Button.Views
{
/// <summary>
/// Interaction logic for IconButtonView.xaml
/// </summary>
public partial class IconButtonView : DemoView
{
public IconButtonView()
{
InitializeComponent();
}
}
}

180
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/IconButtonView.xaml.txt

@ -0,0 +1,180 @@
<!--*************************************************************************************
Toolkit for WPF
Copyright (C) 2007-2016 Xceed Software Inc.
This program is provided to you under the terms of the Microsoft Public
License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license
For more features, controls, and fast professional support,
pick up the Plus Edition at https://xceed.com/xceed-toolkit-plus-for-wpf/
Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids
***********************************************************************************-->
<local:DemoView x:Class="Xceed.Wpf.Toolkit.LiveExplorer.Samples.Button.Views.IconButtonView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Xceed.Wpf.Toolkit.LiveExplorer"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
Title="IconButton">
<local:DemoView.Description>
<!-- #// TODODOC -->
<Paragraph FontSize="14" FontFamily="Segoe">
The IconButton control is a Button that contains an icon and some data. The Foreground, Background and BorderBrush can be easily modified with properties while the Icon location is customizable.
</Paragraph>
</local:DemoView.Description>
<local:DemoView.Resources>
<xctk:SolidColorBrushToColorConverter x:Key="SolidColorBrushToColorConverter" />
<Image x:Key="Image1"
Source="../Resources/PencilTool16.png"
Width="20"
Margin="5" />
<Image x:Key="Image2"
Source="../Resources/Default.jpg"
Width="25"
Margin="5"/>
<ObjectDataProvider x:Key="ButtonLocationEnumData"
MethodName="GetValues"
ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="xctk:Location" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
</local:DemoView.Resources>
<Grid>
<Grid.RowDefinitions>
<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" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="100" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="100" />
</Grid.ColumnDefinitions>
<!-- 1st Column -->
<TextBlock Text="Icon:"
VerticalAlignment="Center" />
<ComboBox Grid.Column="1"
Margin="5"
VerticalContentAlignment="Center"
SelectedValue="{Binding Icon, ElementName=_iconButton}"
SelectedValuePath="Tag">
<ComboBoxItem Content="None"
Tag="{x:Null}" />
<ComboBoxItem Content="Image 1"
Tag="{StaticResource Image1}" />
<ComboBoxItem Content="Image 2"
Tag="{StaticResource Image2}" />
</ComboBox>
<TextBlock Grid.Row="1"
Text="Icon Location: "
VerticalAlignment="Center" />
<ComboBox Grid.Column="1"
Grid.Row="1"
ItemsSource="{Binding Source={StaticResource ButtonLocationEnumData}}"
SelectedItem="{Binding IconLocation, ElementName=_iconButton}"
Margin="5"
VerticalContentAlignment="Center" />
<!-- 2nd Column -->
<TextBlock Text="MouseOver Foreground:"
Grid.Column="2"
VerticalAlignment="Center"
Margin="10,0,0,0" />
<xctk:ColorPicker Grid.Column="3"
Margin="5"
SelectedColor="{Binding MouseOverForeground, ElementName=_iconButton, Converter={StaticResource SolidColorBrushToColorConverter}}" />
<TextBlock Text="MousePressed Foreground:"
Grid.Row="1"
Grid.Column="2"
VerticalAlignment="Center"
Margin="10,0,0,0" />
<xctk:ColorPicker Grid.Row="1"
Grid.Column="3"
Margin="5"
SelectedColor="{Binding MousePressedForeground, ElementName=_iconButton, Converter={StaticResource SolidColorBrushToColorConverter}}" />
<TextBlock Text="MouseOver Background:"
Grid.Row="2"
Grid.Column="2"
VerticalAlignment="Center"
Margin="10,0,0,0" />
<xctk:ColorPicker Grid.Row="2"
Grid.Column="3"
Margin="5"
SelectedColor="{Binding MouseOverBackground, ElementName=_iconButton, Converter={StaticResource SolidColorBrushToColorConverter}}" />
<TextBlock Text="MousePressed Background:"
Grid.Row="3"
Grid.Column="2"
VerticalAlignment="Center"
Margin="10,0,0,0" />
<xctk:ColorPicker Grid.Row="3"
Grid.Column="3"
Margin="5"
SelectedColor="{Binding MousePressedBackground, ElementName=_iconButton, Converter={StaticResource SolidColorBrushToColorConverter}}" />
<TextBlock Text="MouseOver BorderBrush:"
Grid.Row="4"
Grid.Column="2"
VerticalAlignment="Center"
Margin="10,0,0,0" />
<xctk:ColorPicker Grid.Row="4"
Grid.Column="3"
Margin="5"
SelectedColor="{Binding MouseOverBorderBrush, ElementName=_iconButton, Converter={StaticResource SolidColorBrushToColorConverter}}" />
<TextBlock Text="MousePressed BorderBrush:"
Grid.Row="5"
Grid.Column="2"
VerticalAlignment="Center"
Margin="10,0,0,0" />
<xctk:ColorPicker Grid.Row="5"
Grid.Column="3"
Margin="5"
SelectedColor="{Binding MousePressedBorderBrush, ElementName=_iconButton, Converter={StaticResource SolidColorBrushToColorConverter}}" />
</Grid>
</GroupBox>
<StackPanel Grid.Row="1" Margin="10">
<TextBlock Text="Usage:" Style="{StaticResource Header}" />
<xctk:IconButton x:Name="_iconButton"
Content="Test"
Icon="{StaticResource Image1}"
IconLocation="Left"
MouseOverForeground="Black"
MousePressedForeground="White"
MouseOverBackground="LightBlue"
MousePressedBackground="Blue"
MouseOverBorderBrush="LightGray"
MousePressedBorderBrush="LightGray"
Margin="10"
Padding="20,3"
HorizontalAlignment="Center">
</xctk:IconButton>
</StackPanel>
</Grid>
</local:DemoView>

111
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialHamburgerView.xaml.cs.txt

@ -0,0 +1,111 @@
/**************************************************************************************
Toolkit for WPF
Copyright (C) 2007-2016 Xceed Software Inc.
This program is provided to you under the terms of the Microsoft Public
License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license
For more features, controls, and fast professional support,
pick up the Plus Edition at https://xceed.com/xceed-toolkit-plus-for-wpf/
Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids
**************************************************************************************/
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;
namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.MaterialControls.Views
{
/// <summary>
/// Interaction logic for MaterialHamburgerView.xaml
/// </summary>
public partial class MaterialHamburgerView : MaterialDemoView
{
#region Constructors
public MaterialHamburgerView()
{
InitializeComponent();
}
#endregion
#if !OPEN_SOURCE
#region EventHandlers
private void CheckedContentComboBox_SelectionChanged( object sender, SelectionChangedEventArgs e )
{
if( materialHamburger == null )
return;
if( ( e.AddedItems != null ) && ( e.AddedItems.Count > 0 ) )
{
var selection = e.AddedItems[ 0 ] as ComboBoxItem;
if( selection != null )
{
if( selection.Tag != null )
{
materialHamburger.CheckedContent = selection.Tag;
}
else
{
materialHamburger.ClearValue( MaterialHamburger.CheckedContentProperty );
}
}
}
}
private void UncheckedContentComboBox_SelectionChanged( object sender, SelectionChangedEventArgs e )
{
if( materialHamburger == null )
return;
if( ( e.AddedItems != null ) && ( e.AddedItems.Count > 0 ) )
{
var selection = e.AddedItems[ 0 ] as ComboBoxItem;
if( selection != null )
{
if( selection.Tag != null )
{
materialHamburger.UncheckedContent = selection.Tag;
}
else
{
materialHamburger.ClearValue( MaterialHamburger.UncheckedContentProperty );
}
}
}
}
private void MenuLocationComboBox_SelectionChanged( object sender, SelectionChangedEventArgs e )
{
if( ( e.AddedItems != null ) && ( e.AddedItems.Count > 0 ) )
{
var menuLocation = ( HamburgerLocation )e.AddedItems[ 0 ];
materialHamburgerMenu.CloseButtonLocation = ( menuLocation == HamburgerLocation.Right ) ? Location.Left : Location.Right;
}
}
private void IconButton_Click( object sender, RoutedEventArgs e )
{
var button = sender as IconButton;
if( button != null )
{
Process.Start( new ProcessStartInfo( button.Tag as string ) );
}
}
private void ApplyButton_Click( object sender, RoutedEventArgs e )
{
materialHamburger.IsChecked = false;
}
#endregion
#endif
}
}

610
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialHamburgerView.xaml.txt

@ -0,0 +1,610 @@
<!--*************************************************************************************
Toolkit for WPF
Copyright (C) 2007-2016 Xceed Software Inc.
This program is provided to you under the terms of the Microsoft Public
License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license
For more features, controls, and fast professional support,
pick up the Plus Edition at https://xceed.com/xceed-toolkit-plus-for-wpf/
Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids
***********************************************************************************-->
<local:MaterialDemoView x:Class="Xceed.Wpf.Toolkit.LiveExplorer.Samples.MaterialControls.Views.MaterialHamburgerView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Xceed.Wpf.Toolkit.LiveExplorer"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:conv="clr-namespace:Xceed.Wpf.Toolkit.LiveExplorer.Samples.Converters"
Title="MaterialHamburger">
<local:DemoView.Description>
<!-- TODODOC-->
<Paragraph FontSize="14"
FontFamily="Segoe">
<Run>A ToggleButton that pops a menu from left, right, top or bottom of a Window (or any FrameworkElement). The menu can be an animated HamburgerMenu or any customized content. It uses the Material Brushes.</Run>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak />
<LineBreak />
<Run>This feature is only available in the "Plus" version.</Run>
<LineBreak />
<Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Toolkit Plus for WPF.
</Hyperlink>
##END-->
</Paragraph>
</local:DemoView.Description>
<!--##EXCLUDE_OPEN_SOURCE-->
<local:DemoView.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../Resources/CommonResources.xaml" />
</ResourceDictionary.MergedDictionaries>
<ObjectDataProvider x:Key="HamburgerLocationEnumData"
MethodName="GetValues"
ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="xctk:HamburgerLocation" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<ObjectDataProvider x:Key="LocationEnumData"
MethodName="GetValues"
ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="xctk:Location" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<conv:ZeroToBoolConverter x:Key="ZeroToBoolConverter" />
<ContentControl x:Key="CheckedContent1"
Content="Close" />
<ContentControl x:Key="UncheckedContent1"
Content="Open" />
<DataTemplate x:Key="MenuHeaderTemplate1">
<StackPanel Margin="20">
<TextBlock Text="{Binding}"
Margin="5" />
<Button Content="Test"
Margin="5" />
</StackPanel>
</DataTemplate>
<Path x:Key="LeftArrowPath"
x:Shared="False"
Data="F1M-218.342,2910.79L-234.066,2926.52 -233.954,2926.63 -225.428,2926.63 -210.87,2912.07 -206.495,2907.7 -225.313,2888.88 -234.066,2888.88 -218.342,2904.6 -259.829,2904.6 -259.829,2910.79 -218.342,2910.79z"
Stretch="Uniform"
Fill="White"
Width="16"
Height="16"
RenderTransformOrigin="0.5,0.5">
<Path.RenderTransform>
<ScaleTransform ScaleX="-1"
ScaleY="1" />
</Path.RenderTransform>
</Path>
<Path x:Key="RightArrowPath"
x:Shared="False"
Data="F1M-218.342,2910.79L-234.066,2926.52 -233.954,2926.63 -225.428,2926.63 -210.87,2912.07 -206.495,2907.7 -225.313,2888.88 -234.066,2888.88 -218.342,2904.6 -259.829,2904.6 -259.829,2910.79 -218.342,2910.79z"
Stretch="Uniform"
Fill="White"
Width="16"
Height="16">
</Path>
<Path x:Key="TopArrowPath"
x:Shared="False"
Data="F1M-218.342,2910.79L-234.066,2926.52 -233.954,2926.63 -225.428,2926.63 -210.87,2912.07 -206.495,2907.7 -225.313,2888.88 -234.066,2888.88 -218.342,2904.6 -259.829,2904.6 -259.829,2910.79 -218.342,2910.79z"
Stretch="Uniform"
Fill="White"
Width="16"
Height="16"
RenderTransformOrigin="0.5,0.5">
<Path.RenderTransform>
<RotateTransform Angle="-90" />
</Path.RenderTransform>
</Path>
<Path x:Key="BottomArrowPath"
x:Shared="False"
Data="F1M-218.342,2910.79L-234.066,2926.52 -233.954,2926.63 -225.428,2926.63 -210.87,2912.07 -206.495,2907.7 -225.313,2888.88 -234.066,2888.88 -218.342,2904.6 -259.829,2904.6 -259.829,2910.79 -218.342,2910.79z"
Stretch="Uniform"
Fill="White"
Width="16"
Height="16"
RenderTransformOrigin="0.5,0.5">
<Path.RenderTransform>
<RotateTransform Angle="90" />
</Path.RenderTransform>
</Path>
<Style x:Key="DefaultHamburgerMenuCloseButtonStyle"
TargetType="{x:Type Button}">
<Setter Property="Content"
Value="{StaticResource LeftArrowPath}" />
<Setter Property="Foreground"
Value="White" />
<Setter Property="Margin"
Value="4" />
<Setter Property="Background"
Value="Transparent" />
<Setter Property="BorderBrush"
Value="Transparent" />
<Setter Property="Cursor"
Value="Hand" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<ContentPresenter HorizontalAlignment="Center"
VerticalAlignment="Center" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<!--Right Arrow when Menu is positionned on right-->
<DataTrigger Binding="{Binding MenuLocation, RelativeSource={RelativeSource AncestorType={x:Type xctk:MaterialHamburgerMenu}}}"
Value="Right">
<Setter Property="Content"
Value="{StaticResource RightArrowPath}" />
</DataTrigger>
<!--Top Arrow when Menu is positionned on top-->
<DataTrigger Binding="{Binding MenuLocation, RelativeSource={RelativeSource AncestorType={x:Type xctk:MaterialHamburgerMenu}}}"
Value="Top">
<Setter Property="Content"
Value="{StaticResource TopArrowPath}" />
</DataTrigger>
<!--Bottom Arrow when Menu is positionned on Bottom-->
<DataTrigger Binding="{Binding MenuLocation, RelativeSource={RelativeSource AncestorType={x:Type xctk:MaterialHamburgerMenu}}}"
Value="Bottom">
<Setter Property="Content"
Value="{StaticResource BottomArrowPath}" />
</DataTrigger>
</Style.Triggers>
</Style>
<Style x:Key="HamburgerMenuCloseButtonStyle1"
TargetType="{x:Type Button}">
<Setter Property="Content"
Value="OK" />
</Style>
<Border x:Key="CustomizedHamburgerContent"
Background="White"
BorderBrush="Black"
BorderThickness="1"
Margin="5">
<StackPanel>
<xctk:MaterialTextField Text="Mike"
Watermark="Your Name"
Margin="10,30,10,10" />
<StackPanel Orientation="Horizontal"
Margin="10">
<TextBlock Text="Volume:"
Margin="3" />
<xctk:MaterialComboBox SelectedIndex="1"
Width="130">
<xctk:MaterialComboBoxItem Content="High" />
<xctk:MaterialComboBoxItem Content="Medium" />
<xctk:MaterialComboBoxItem Content="Low" />
<xctk:MaterialComboBoxItem Content="Vibration" />
</xctk:MaterialComboBox>
</StackPanel>
<StackPanel Orientation="Horizontal"
Margin="10">
<TextBlock Text="Music: "
Margin="5" />
<xctk:MaterialRadioButton GroupName="Choice"
IsChecked="True"
Content="On"
Margin="5" />
<xctk:MaterialRadioButton GroupName="Choice"
Content="Off"
Margin="5" />
</StackPanel>
<StackPanel Orientation="Horizontal"
Margin="10">
<TextBlock Text="Plane Mode:"
Margin="5,0,5,0" />
<xctk:MaterialSwitch />
</StackPanel>
<StackPanel Orientation="Horizontal"
Margin="10">
<xctk:MaterialCheckBox IsChecked="True"
Content="English"
Margin="0,5,5,5" />
<xctk:MaterialCheckBox IsChecked="False"
Content="French"
Margin="5" />
</StackPanel>
<xctk:MaterialButton Content="Apply"
Margin="10"
Padding="8"
Click="ApplyButton_Click" />
</StackPanel>
</Border>
<Style x:Key="IconButtonStyle"
TargetType="{x:Type xctk:IconButton}">
<Setter Property="BorderThickness"
Value="0" />
<Setter Property="MouseOverForeground"
Value="{Binding MaterialAccentBrush, RelativeSource={RelativeSource AncestorType={x:Type xctk:MaterialHamburgerMenu}}}" />
<Setter Property="MousePressedForeground"
Value="{Binding MaterialAccentBrush, RelativeSource={RelativeSource AncestorType={x:Type xctk:MaterialHamburgerMenu}}}" />
<Setter Property="Background"
Value="White" />
<Setter Property="MouseOverBackground"
Value="White" />
<Setter Property="MousePressedBackground"
Value="White" />
<Setter Property="IconLocation"
Value="Left" />
<Setter Property="HorizontalAlignment"
Value="Left" />
<Setter Property="Margin"
Value="5" />
</Style>
</ResourceDictionary>
</local:DemoView.Resources>
<Grid>
<StackPanel Margin="10,5,10,5">
<GroupBox Header="Features"
Margin="0,3,0,3">
<Grid Margin="3">
<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="Auto" />
<ColumnDefinition Width="190" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="160" />
</Grid.ColumnDefinitions>
<!-- First Column -->
<TextBlock Text="MaterialHamburger:"
Foreground="#FFC72035"
Grid.ColumnSpan="2" />
<TextBlock Grid.Column="0"
Grid.Row="1"
Text="Material Accent Brush: "
VerticalAlignment="Center" />
<ComboBox Grid.Column="1"
Grid.Row="1"
ItemsSource="{Binding MaterialBrushes, RelativeSource={RelativeSource AncestorType={x:Type local:MaterialDemoView}}}"
SelectedItem="{Binding MaterialAccentBrush, ElementName=materialHamburger}"
ItemTemplate="{StaticResource ColorItemTemplate}"
VerticalAlignment="Center"
Margin="5,3,5,3" />
<TextBlock Grid.Column="0"
Grid.Row="2"
Text="MenuLocation: "
VerticalAlignment="Center" />
<ComboBox Grid.Column="1"
Grid.Row="2"
ItemsSource="{Binding Source={StaticResource HamburgerLocationEnumData}}"
SelectedItem="{Binding MenuLocation, ElementName=materialHamburger}"
SelectionChanged="MenuLocationComboBox_SelectionChanged"
Margin="5,3,5,3"
VerticalContentAlignment="Center" />
<TextBlock Grid.Column="0"
Grid.Row="3"
Text="Checked Content: "
VerticalAlignment="Center" />
<ComboBox Grid.Column="1"
Grid.Row="3"
Margin="5,3,5,3"
VerticalContentAlignment="Center"
SelectedIndex="0"
SelectionChanged="CheckedContentComboBox_SelectionChanged">
<ComboBoxItem Content="Default"
Tag="{x:Null}" />
<ComboBoxItem Content="Content 1"
Tag="{StaticResource CheckedContent1}" />
</ComboBox>
<TextBlock Grid.Column="0"
Grid.Row="4"
Text="Unchecked Content: "
VerticalAlignment="Center" />
<ComboBox Grid.Column="1"
Grid.Row="4"
Margin="5,3,5,3"
VerticalContentAlignment="Center"
SelectedIndex="0"
SelectionChanged="UncheckedContentComboBox_SelectionChanged">
<ComboBoxItem Content="Default"
Tag="{x:Null}" />
<ComboBoxItem Content="Content 1"
Tag="{StaticResource UncheckedContent1}" />
</ComboBox>
<TextBlock Grid.Column="0"
Grid.Row="5"
Text="Menu Owner: "
VerticalAlignment="Center" />
<ComboBox x:Name="toastOwnerComboBox"
Grid.Column="1"
Grid.Row="5"
Margin="5,3,5,3"
SelectedValue="{Binding MenuOwner, ElementName=materialHamburger}"
SelectedValuePath="Tag"
VerticalContentAlignment="Center">
<ComboBoxItem Content="Sample Window"
Tag="{x:Null}" />
<ComboBoxItem Content="LightBlue Border"
Tag="{Binding ElementName=LightBlueBorder}" />
<ComboBoxItem Content="LightGreen Border"
Tag="{Binding ElementName=LightGreenBorder}" />
</ComboBox>
<TextBlock Grid.Column="0"
Grid.Row="6"
Text="Menu Content: "
VerticalAlignment="Center" />
<ComboBox x:Name="menuContentComboBox"
Grid.Column="1"
Grid.Row="6"
Margin="5,3,5,3"
SelectedIndex="0"
VerticalContentAlignment="Center">
<ComboBoxItem Content="HamburgerMenu with items">
<ComboBoxItem.Tag>
<xctk:MaterialHamburgerMenu x:Name="materialHamburgerMenu"
Header="Xceed Products"
HeaderTemplate="{x:Null}"
CloseButtonLocation="Right"
Padding="0"
CloseButtonStyle="{StaticResource DefaultHamburgerMenuCloseButtonStyle}"
IsAnimatingItems="True">
<TextBlock Text="WPF Controls"
Foreground="Gray"
HorizontalAlignment="Center"
Margin="5" />
<xctk:IconButton Content="DataGrid For WPF"
Tag="https://xceed.com/xceed-datagrid-for-wpf/"
Click="IconButton_Click"
Style="{StaticResource IconButtonStyle}">
<xctk:IconButton.Icon>
<Image Source="../Resources/DataGrid.png"
Width="20"
Margin="5" />
</xctk:IconButton.Icon>
</xctk:IconButton>
<xctk:IconButton Content="Toolkit For WPF"
Tag="https://xceed.com/xceed-toolkit-plus-for-wpf/"
Click="IconButton_Click"
Style="{StaticResource IconButtonStyle}">
<xctk:IconButton.Icon>
<Image Source="../Resources/Toolkit.png"
Width="20"
Margin="5" />
</xctk:IconButton.Icon>
</xctk:IconButton>
<xctk:IconButton Content="Business Suite For WPF"
Tag="https://xceed.com/xceed-business-suite-for-wpf/"
Click="IconButton_Click"
Style="{StaticResource IconButtonStyle}">
<xctk:IconButton.Icon>
<Image Source="../Resources/Business.png"
Width="20"
Margin="5" />
</xctk:IconButton.Icon>
</xctk:IconButton>
<Separator Margin="0,20" />
<TextBlock Text=".NET Libraries"
HorizontalAlignment="Center"
Foreground="Gray"
Margin="5,0,5,5" />
<xctk:IconButton Content="Zip For .NET"
Tag="https://xceed.com/xceed-zip-for-net/"
Click="IconButton_Click"
Style="{StaticResource IconButtonStyle}">
<xctk:IconButton.Icon>
<Image Source="../Resources/Zip.png"
Width="20"
Margin="5" />
</xctk:IconButton.Icon>
</xctk:IconButton>
<xctk:IconButton Content="SFTP For .NET"
Tag="https://xceed.com/xceed-sftp-for-net/"
Click="IconButton_Click"
Style="{StaticResource IconButtonStyle}">
<xctk:IconButton.Icon>
<Image Source="../Resources/SFTP.png"
Width="20"
Margin="5" />
</xctk:IconButton.Icon>
</xctk:IconButton>
<xctk:IconButton Content="Real-Time Zip For .NET"
Tag="https://xceed.com/xceed-real-time-zip-for-net/"
Click="IconButton_Click"
Style="{StaticResource IconButtonStyle}">
<xctk:IconButton.Icon>
<Image Source="../Resources/Zip.png"
Width="20"
Margin="5" />
</xctk:IconButton.Icon>
</xctk:IconButton>
</xctk:MaterialHamburgerMenu>
</ComboBoxItem.Tag>
</ComboBoxItem>
<ComboBoxItem Content="Customized content"
Tag="{StaticResource CustomizedHamburgerContent}" />
</ComboBox>
<TextBlock Grid.Column="0"
Grid.Row="7"
Text="Can Resize Menu: "
VerticalAlignment="Center" />
<CheckBox Grid.Column="1"
Grid.Row="7"
Margin="5,3,5,3"
IsChecked="{Binding CanResizeMenu, ElementName=materialHamburger}"
VerticalContentAlignment="Center" />
<!-- Second Column -->
<TextBlock Text="MaterialHamburgerMenu:"
Foreground="#FFC72035"
Grid.Column="2"
Grid.ColumnSpan="2"
Margin="10,0,0,0" />
<TextBlock Grid.Column="2"
Grid.Row="1"
Text="Material Accent Brush: "
VerticalAlignment="Center"
Margin="10,0,0,0"
IsEnabled="{Binding SelectedIndex, ElementName=menuContentComboBox, Converter={StaticResource ZeroToBoolConverter}}"
Style="{StaticResource DisableGrayText}" />
<ComboBox Grid.Column="3"
Grid.Row="1"
ItemsSource="{Binding MaterialBrushes, RelativeSource={RelativeSource AncestorType={x:Type local:MaterialDemoView}}}"
SelectedItem="{Binding MaterialAccentBrush, ElementName=materialHamburgerMenu}"
ItemTemplate="{StaticResource ColorItemTemplate}"
VerticalAlignment="Center"
Margin="5,3,5,3"
IsEnabled="{Binding SelectedIndex, ElementName=menuContentComboBox, Converter={StaticResource ZeroToBoolConverter}}"
Style="{StaticResource DisableGrayComboBox}" />
<TextBlock Grid.Column="2"
Grid.Row="2"
Text="Header: "
VerticalAlignment="Center"
Margin="10,0,0,0"
IsEnabled="{Binding SelectedIndex, ElementName=menuContentComboBox, Converter={StaticResource ZeroToBoolConverter}}"
Style="{StaticResource DisableGrayText}" />
<TextBox Grid.Column="3"
Grid.Row="2"
Text="{Binding Header, ElementName=materialHamburgerMenu}"
VerticalAlignment="Center"
Margin="5,3,5,3"
IsEnabled="{Binding SelectedIndex, ElementName=menuContentComboBox, Converter={StaticResource ZeroToBoolConverter}}" />
<TextBlock Grid.Column="2"
Grid.Row="3"
Text="Header Template: "
VerticalAlignment="Center"
Margin="10,0,0,0"
IsEnabled="{Binding SelectedIndex, ElementName=menuContentComboBox, Converter={StaticResource ZeroToBoolConverter}}"
Style="{StaticResource DisableGrayText}" />
<ComboBox Grid.Column="3"
Grid.Row="3"
SelectedValue="{Binding HeaderTemplate, ElementName=materialHamburgerMenu}"
SelectedValuePath="Tag"
VerticalAlignment="Center"
Margin="5,3,5,3"
IsEnabled="{Binding SelectedIndex, ElementName=menuContentComboBox, Converter={StaticResource ZeroToBoolConverter}}"
Style="{StaticResource DisableGrayComboBox}">
<ComboBoxItem Content="Default"
Tag="{x:Null}" />
<ComboBoxItem Content="Template 1"
Tag="{StaticResource MenuHeaderTemplate1}" />
</ComboBox>
<TextBlock Grid.Column="2"
Grid.Row="4"
Text="Close Button Location: "
VerticalAlignment="Center"
Margin="10,0,0,0"
IsEnabled="{Binding SelectedIndex, ElementName=menuContentComboBox, Converter={StaticResource ZeroToBoolConverter}}"
Style="{StaticResource DisableGrayText}" />
<ComboBox Grid.Column="3"
Grid.Row="4"
ItemsSource="{Binding Source={StaticResource LocationEnumData}}"
SelectedItem="{Binding CloseButtonLocation, ElementName=materialHamburgerMenu}"
VerticalAlignment="Center"
Margin="5,3,5,3"
IsEnabled="{Binding SelectedIndex, ElementName=menuContentComboBox, Converter={StaticResource ZeroToBoolConverter}}"
Style="{StaticResource DisableGrayComboBox}" />
<TextBlock Grid.Column="2"
Grid.Row="5"
Text="Close Button Style: "
VerticalAlignment="Center"
Margin="10,0,0,0"
IsEnabled="{Binding SelectedIndex, ElementName=menuContentComboBox, Converter={StaticResource ZeroToBoolConverter}}"
Style="{StaticResource DisableGrayText}" />
<ComboBox Grid.Column="3"
Grid.Row="5"
SelectedValue="{Binding CloseButtonStyle, ElementName=materialHamburgerMenu}"
SelectedValuePath="Tag"
VerticalAlignment="Center"
Margin="5,3,5,3"
IsEnabled="{Binding SelectedIndex, ElementName=menuContentComboBox, Converter={StaticResource ZeroToBoolConverter}}"
Style="{StaticResource DisableGrayComboBox}">
<ComboBoxItem Content="Default"
Tag="{StaticResource DefaultHamburgerMenuCloseButtonStyle}" />
<ComboBoxItem Content="Style 1"
Tag="{StaticResource HamburgerMenuCloseButtonStyle1}" />
</ComboBox>
<TextBlock Grid.Column="2"
Grid.Row="6"
Text="Is Animating Items: "
VerticalAlignment="Center"
Margin="10,0,0,0"
IsEnabled="{Binding SelectedIndex, ElementName=menuContentComboBox, Converter={StaticResource ZeroToBoolConverter}}"
Style="{StaticResource DisableGrayText}" />
<CheckBox Grid.Column="3"
Grid.Row="6"
IsChecked="{Binding IsAnimatingItems, ElementName=materialHamburgerMenu}"
VerticalAlignment="Center"
Margin="5,3,5,3"
IsEnabled="{Binding SelectedIndex, ElementName=menuContentComboBox, Converter={StaticResource ZeroToBoolConverter}}" />
</Grid>
</GroupBox>
<StackPanel>
<TextBlock Text="Usage:"
Style="{StaticResource Header}" />
<xctk:MaterialHamburger x:Name="materialHamburger"
Margin="5"
MenuContent="{Binding SelectedItem.Tag, ElementName=menuContentComboBox}" />
<StackPanel Orientation="Horizontal">
<Border x:Name="LightBlueBorder"
Background="LightBlue"
Width="335"
Height="330"
Margin="5" />
<Border x:Name="LightGreenBorder"
Background="LightGreen"
Width="335"
Height="330"
Margin="5" />
</StackPanel>
</StackPanel>
</StackPanel>
</Grid>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<Image Source="..\OpenSourceImages\MaterialHamburger.png" Width="600" Height="400"/>
##END-->
</local:MaterialDemoView>

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

@ -63,7 +63,7 @@
<Style x:Key="MaterialToastCloseButtonStyle1" <Style x:Key="MaterialToastCloseButtonStyle1"
TargetType="{x:Type Button}"> TargetType="{x:Type Button}">
<Setter Property="Margin" <Setter Property="Margin"
Value="12,0,0,0" /> Value="2" />
<Setter Property="Content" <Setter Property="Content"
Value="OK" /> Value="OK" />
<Setter Property="Foreground" <Setter Property="Foreground"

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

@ -219,6 +219,14 @@
<TextBlock Grid.Row="1" Text="Usage:" Style="{StaticResource Header}" /> <TextBlock Grid.Row="1" Text="Usage:" Style="{StaticResource Header}" />
<ScrollViewer Grid.Row="2" Grid.ColumnSpan="2" VerticalScrollBarVisibility="Hidden" HorizontalScrollBarVisibility="Visible" CanContentScroll="true"> <ScrollViewer Grid.Row="2" Grid.ColumnSpan="2" VerticalScrollBarVisibility="Hidden" HorizontalScrollBarVisibility="Visible" CanContentScroll="true">
<!-- For MVVM : An ItemsControl can be used :
<ItemsControl ItemsSource="{Binding TheItems}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<xctk:PileFlowPanel />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>-->
<xctk:PileFlowPanel x:Name="_pileFlowPanel" <xctk:PileFlowPanel x:Name="_pileFlowPanel"
MinHeight="175" MinHeight="175"
ContentLabelOffsetY="100" ContentLabelOffsetY="100"

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

@ -131,10 +131,11 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views
set; set;
} }
[Range(0, 10)] [Range(0d, 10d)]
[Category( "Other" )] [Category( "Other" )]
[DefaultValue(5d)]
//# TODODOC //# TODODOC
[Description( "This property uses the [Range(0,10)] attribute to set the Minimum and Maximum properties." )] [Description( "This property uses the [Range(0,10)] and DefaultValue attributes to set the Minimum, Maximum and default properties." )]
public double RangeDouble public double RangeDouble
{ {
get; get;

5
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridSelectedObjectView.xaml.txt

@ -53,7 +53,10 @@
</StackPanel> </StackPanel>
<!-- The SelectedObject property will be assigned in code-behind when one <!-- The SelectedObject property will be assigned in code-behind when one
of the 3 controls receives focus. --> of the 3 controls receives focus. -->
<xctk:PropertyGrid x:Name="_propertyGrid" Grid.Column="1" HorizontalAlignment="Stretch" /> <xctk:PropertyGrid x:Name="_propertyGrid"
Grid.Column="1"
HorizontalAlignment="Stretch"
IsVirtualizing="True"/>
</Grid> </Grid>
</Grid> </Grid>
</local:DemoView> </local:DemoView>

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

@ -85,11 +85,21 @@
VerticalAlignment="Center" VerticalAlignment="Center"
Margin="5" Margin="5"
ToolTip="Set the IsReadOnly property to true or false." /> ToolTip="Set the IsReadOnly property to true or false." />
<TextBlock Text="ShowPreview:" <TextBlock Text="IsVirtualizing:"
VerticalAlignment="Center" VerticalAlignment="Center"
Grid.Row="3" Grid.Row="3"
Grid.Column="0" /> Grid.Column="0" />
<CheckBox Grid.Row="3" <CheckBox Grid.Row="3"
Grid.Column="1"
IsChecked="{Binding IsVirtualizing, ElementName=_propertyGrid}"
VerticalAlignment="Center"
Margin="5"
ToolTip="Set if the PropertyGrid is using virtualization. Using virtualization will load the PropertyGrid faster with large dataSets." />
<TextBlock Text="ShowPreview:"
VerticalAlignment="Center"
Grid.Row="4"
Grid.Column="0" />
<CheckBox Grid.Row="4"
Grid.Column="1" Grid.Column="1"
IsChecked="{Binding ShowPreview, ElementName=_propertyGrid}" IsChecked="{Binding ShowPreview, ElementName=_propertyGrid}"
VerticalAlignment="Center" VerticalAlignment="Center"
@ -183,6 +193,7 @@
IsCategorized="True" IsCategorized="True"
ShowAdvancedOptions="True" ShowAdvancedOptions="True"
IsReadOnly="False" IsReadOnly="False"
IsVirtualizing="False"
UpdateTextBoxSourceOnEnterKey="True" UpdateTextBoxSourceOnEnterKey="True"
IsMiscCategoryLabelHidden="False" IsMiscCategoryLabelHidden="False"
ShowPreview="True" ShowPreview="True"

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

@ -308,7 +308,7 @@
</view:AvalonDockComboBoxItem.Tag> </view:AvalonDockComboBoxItem.Tag>
<!--##END--> <!--##END-->
</view:AvalonDockComboBoxItem> </view:AvalonDockComboBoxItem>
<view:AvalonDockComboBoxItem Style="{StaticResource plusNewItem}" <view:AvalonDockComboBoxItem Style="{StaticResource plusItem}"
Content="Windows 10" Content="Windows 10"
Selected="DefaultComboBoxItem_Selected" Selected="DefaultComboBoxItem_Selected"
ThemeEnum="{x:Static view:AvalonDockThemesEnum.Windows10}"> ThemeEnum="{x:Static view:AvalonDockThemesEnum.Windows10}">

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

@ -226,8 +226,6 @@
<DockPanel> <DockPanel>
<TextBlock DockPanel.Dock="Left" <TextBlock DockPanel.Dock="Left"
Text="Windows 10" /> Text="Windows 10" />
<TextBlock TextAlignment="Right"
Style="{StaticResource newSuffix}" />
</DockPanel> </DockPanel>
</ComboBoxItem.Content> </ComboBoxItem.Content>
</ComboBoxItem> </ComboBoxItem>

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

@ -252,8 +252,6 @@
<DockPanel> <DockPanel>
<TextBlock DockPanel.Dock="Left" <TextBlock DockPanel.Dock="Left"
Text="Windows 10" /> Text="Windows 10" />
<TextBlock TextAlignment="Right"
Style="{StaticResource newSuffix}" />
</DockPanel> </DockPanel>
</ComboBoxItem.Content> </ComboBoxItem.Content>
</ComboBoxItem> </ComboBoxItem>

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

@ -211,7 +211,6 @@
<DockPanel> <DockPanel>
<TextBlock DockPanel.Dock="Left" <TextBlock DockPanel.Dock="Left"
Text="Windows 10" /> Text="Windows 10" />
<TextBlock TextAlignment="Right" Style="{StaticResource newSuffix}" />
</DockPanel> </DockPanel>
</ComboBoxItem.Content> </ComboBoxItem.Content>
</ComboBoxItem> </ComboBoxItem>

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

@ -177,8 +177,6 @@
<DockPanel> <DockPanel>
<TextBlock DockPanel.Dock="Left" <TextBlock DockPanel.Dock="Left"
Text="Windows 10" /> Text="Windows 10" />
<TextBlock TextAlignment="Right"
Style="{StaticResource newSuffix}" />
</DockPanel> </DockPanel>
</ComboBoxItem.Content> </ComboBoxItem.Content>
</ComboBoxItem> </ComboBoxItem>

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

@ -20,7 +20,7 @@
xmlns:local="clr-namespace:Xceed.Wpf.Toolkit.LiveExplorer" xmlns:local="clr-namespace:Xceed.Wpf.Toolkit.LiveExplorer"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:conv="clr-namespace:Xceed.Wpf.Toolkit.Core.Converters;assembly=Xceed.Wpf.Toolkit" xmlns:conv="clr-namespace:Xceed.Wpf.Toolkit.Core.Converters;assembly=Xceed.Wpf.Toolkit"
xmlns:localConv="clr-namespace:Xceed.Wpf.Toolkit.LiveExplorer.Samples.ToggleSwitch.Converters" xmlns:localConv="clr-namespace:Xceed.Wpf.Toolkit.LiveExplorer.Samples.Converters"
Title="ToggleSwitch"> Title="ToggleSwitch">
<local:DemoView.Description> <local:DemoView.Description>

26
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Core/Converters/ZeroToBoolConverter.cs

@ -0,0 +1,26 @@
/*************************************************************************************
Toolkit for WPF
Copyright (C) 2007-2016 Xceed Software Inc.
This program is provided to you under the terms of the Microsoft Public
License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license
For more features, controls, and fast professional support,
pick up the Plus Edition at https://xceed.com/xceed-toolkit-plus-for-wpf/
Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids
***********************************************************************************/
using System;
using System.Globalization;
using System.Windows.Data;
namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Converters
{
}

11
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/MainWindow.xaml

@ -430,6 +430,7 @@
</ResourceDictionary> </ResourceDictionary>
</Window.Resources> </Window.Resources>
<Grid>
<Grid Margin="30,30,0,0"> <Grid Margin="30,30,0,0">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition MinWidth="260" <ColumnDefinition MinWidth="260"
@ -488,8 +489,7 @@
SampleType="{x:Type samples:PropertyGrid.Views.PropertyGridCategoryOrderView}" /> SampleType="{x:Type samples:PropertyGrid.Views.PropertyGridCategoryOrderView}" />
<core:LiveExplorerTreeViewItem Header="Expanding non-primitives" <core:LiveExplorerTreeViewItem Header="Expanding non-primitives"
SampleType="{x:Type samples:PropertyGrid.Views.PropertyGridExpandingNonPrimitivesView}" SampleType="{x:Type samples:PropertyGrid.Views.PropertyGridExpandingNonPrimitivesView}"
IsPlusOnlyFeature="True" IsPlusOnlyFeature="True"/>
IsNewFeature="True"/>
<core:LiveExplorerTreeViewItem Header="Localization" <core:LiveExplorerTreeViewItem Header="Localization"
SampleType="{x:Type samples:PropertyGrid.Views.PropertyGridDisplayLocalizationView}" SampleType="{x:Type samples:PropertyGrid.Views.PropertyGridDisplayLocalizationView}"
IsPlusOnlyFeature="True" /> IsPlusOnlyFeature="True" />
@ -579,6 +579,9 @@
ItemContainerStyle="{StaticResource TreeViewItemStyle}"> ItemContainerStyle="{StaticResource TreeViewItemStyle}">
<core:LiveExplorerTreeViewItem Header="DropDown and Split Buttons" <core:LiveExplorerTreeViewItem Header="DropDown and Split Buttons"
SampleType="{x:Type samples:Button.Views.DropDownSplitButtonView}" /> SampleType="{x:Type samples:Button.Views.DropDownSplitButtonView}" />
<core:LiveExplorerTreeViewItem Header="IconButton"
SampleType="{x:Type samples:Button.Views.IconButtonView}"
IsNewFeature="True"/>
</core:LiveExplorerTreeViewItem> </core:LiveExplorerTreeViewItem>
<core:LiveExplorerTreeViewItem Header="Charts" <core:LiveExplorerTreeViewItem Header="Charts"
Style="{StaticResource TreeViewHeaderStyle}" Style="{StaticResource TreeViewHeaderStyle}"
@ -652,6 +655,9 @@
SampleType="{x:Type samples:MaterialControls.Views.MaterialDropDownView}" /> SampleType="{x:Type samples:MaterialControls.Views.MaterialDropDownView}" />
<core:LiveExplorerTreeViewItem Header="Frame" <core:LiveExplorerTreeViewItem Header="Frame"
SampleType="{x:Type samples:MaterialControls.Views.MaterialFrameView}" /> SampleType="{x:Type samples:MaterialControls.Views.MaterialFrameView}" />
<core:LiveExplorerTreeViewItem Header="Hamburger"
IsNewFeature="True"
SampleType="{x:Type samples:MaterialControls.Views.MaterialHamburgerView}" />
<core:LiveExplorerTreeViewItem Header="ListBox" <core:LiveExplorerTreeViewItem Header="ListBox"
SampleType="{x:Type samples:MaterialControls.Views.MaterialListBoxView}" /> SampleType="{x:Type samples:MaterialControls.Views.MaterialListBoxView}" />
<core:LiveExplorerTreeViewItem Header="ProgressBar" <core:LiveExplorerTreeViewItem Header="ProgressBar"
@ -862,4 +868,5 @@
</TabControl> </TabControl>
</Grid> </Grid>
</Grid> </Grid>
</Grid>
</Window> </Window>

4
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Properties/AssemblyInfo.cs

@ -49,8 +49,8 @@ using System.Windows;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion( "3.1.*" )] [assembly: AssemblyVersion( "3.2.*" )]
[assembly: AssemblyFileVersion( "3.1.0.0" )] [assembly: AssemblyFileVersion( "3.2.0.0" )]
#pragma warning disable 1699 #pragma warning disable 1699
[assembly: AssemblyDelaySign( false )] [assembly: AssemblyDelaySign( false )]

10
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Properties/Resources.resx

@ -3,7 +3,7 @@
<!-- <!--
Microsoft ResX Schema Microsoft ResX Schema
Version 3.1 Version 3.2
The primary goals of this format is to allow a simple XML format The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the that is mostly human readable. The generation and parsing of the
@ -14,7 +14,7 @@
... ado.net/XML headers & schema ... ... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader> <resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">3.1</resheader> <resheader name="version">3.2</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, 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="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
@ -106,12 +106,12 @@
<value>text/microsoft-resx</value> <value>text/microsoft-resx</value>
</resheader> </resheader>
<resheader name="version"> <resheader name="version">
<value>3.1</value> <value>3.2</value>
</resheader> </resheader>
<resheader name="reader"> <resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=3.2.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=3.2.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
</root> </root>

BIN
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/Button/Resources/Default.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 KiB

BIN
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/Button/Resources/PencilTool16.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 B

180
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/Button/Views/IconButtonView.xaml

@ -0,0 +1,180 @@
<!--*************************************************************************************
Toolkit for WPF
Copyright (C) 2007-2016 Xceed Software Inc.
This program is provided to you under the terms of the Microsoft Public
License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license
For more features, controls, and fast professional support,
pick up the Plus Edition at https://xceed.com/xceed-toolkit-plus-for-wpf/
Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids
***********************************************************************************-->
<local:DemoView x:Class="Xceed.Wpf.Toolkit.LiveExplorer.Samples.Button.Views.IconButtonView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Xceed.Wpf.Toolkit.LiveExplorer"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
Title="IconButton">
<local:DemoView.Description>
<!-- #// TODODOC -->
<Paragraph FontSize="14" FontFamily="Segoe">
The IconButton control is a Button that contains an icon and some data. The Foreground, Background and BorderBrush can be easily modified with properties while the Icon location is customizable.
</Paragraph>
</local:DemoView.Description>
<local:DemoView.Resources>
<xctk:SolidColorBrushToColorConverter x:Key="SolidColorBrushToColorConverter" />
<Image x:Key="Image1"
Source="../Resources/PencilTool16.png"
Width="20"
Margin="5" />
<Image x:Key="Image2"
Source="../Resources/Default.jpg"
Width="25"
Margin="5"/>
<ObjectDataProvider x:Key="ButtonLocationEnumData"
MethodName="GetValues"
ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="xctk:Location" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
</local:DemoView.Resources>
<Grid>
<Grid.RowDefinitions>
<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" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="100" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="100" />
</Grid.ColumnDefinitions>
<!-- 1st Column -->
<TextBlock Text="Icon:"
VerticalAlignment="Center" />
<ComboBox Grid.Column="1"
Margin="5"
VerticalContentAlignment="Center"
SelectedValue="{Binding Icon, ElementName=_iconButton}"
SelectedValuePath="Tag">
<ComboBoxItem Content="None"
Tag="{x:Null}" />
<ComboBoxItem Content="Image 1"
Tag="{StaticResource Image1}" />
<ComboBoxItem Content="Image 2"
Tag="{StaticResource Image2}" />
</ComboBox>
<TextBlock Grid.Row="1"
Text="Icon Location: "
VerticalAlignment="Center" />
<ComboBox Grid.Column="1"
Grid.Row="1"
ItemsSource="{Binding Source={StaticResource ButtonLocationEnumData}}"
SelectedItem="{Binding IconLocation, ElementName=_iconButton}"
Margin="5"
VerticalContentAlignment="Center" />
<!-- 2nd Column -->
<TextBlock Text="MouseOver Foreground:"
Grid.Column="2"
VerticalAlignment="Center"
Margin="10,0,0,0" />
<xctk:ColorPicker Grid.Column="3"
Margin="5"
SelectedColor="{Binding MouseOverForeground, ElementName=_iconButton, Converter={StaticResource SolidColorBrushToColorConverter}}" />
<TextBlock Text="MousePressed Foreground:"
Grid.Row="1"
Grid.Column="2"
VerticalAlignment="Center"
Margin="10,0,0,0" />
<xctk:ColorPicker Grid.Row="1"
Grid.Column="3"
Margin="5"
SelectedColor="{Binding MousePressedForeground, ElementName=_iconButton, Converter={StaticResource SolidColorBrushToColorConverter}}" />
<TextBlock Text="MouseOver Background:"
Grid.Row="2"
Grid.Column="2"
VerticalAlignment="Center"
Margin="10,0,0,0" />
<xctk:ColorPicker Grid.Row="2"
Grid.Column="3"
Margin="5"
SelectedColor="{Binding MouseOverBackground, ElementName=_iconButton, Converter={StaticResource SolidColorBrushToColorConverter}}" />
<TextBlock Text="MousePressed Background:"
Grid.Row="3"
Grid.Column="2"
VerticalAlignment="Center"
Margin="10,0,0,0" />
<xctk:ColorPicker Grid.Row="3"
Grid.Column="3"
Margin="5"
SelectedColor="{Binding MousePressedBackground, ElementName=_iconButton, Converter={StaticResource SolidColorBrushToColorConverter}}" />
<TextBlock Text="MouseOver BorderBrush:"
Grid.Row="4"
Grid.Column="2"
VerticalAlignment="Center"
Margin="10,0,0,0" />
<xctk:ColorPicker Grid.Row="4"
Grid.Column="3"
Margin="5"
SelectedColor="{Binding MouseOverBorderBrush, ElementName=_iconButton, Converter={StaticResource SolidColorBrushToColorConverter}}" />
<TextBlock Text="MousePressed BorderBrush:"
Grid.Row="5"
Grid.Column="2"
VerticalAlignment="Center"
Margin="10,0,0,0" />
<xctk:ColorPicker Grid.Row="5"
Grid.Column="3"
Margin="5"
SelectedColor="{Binding MousePressedBorderBrush, ElementName=_iconButton, Converter={StaticResource SolidColorBrushToColorConverter}}" />
</Grid>
</GroupBox>
<StackPanel Grid.Row="1" Margin="10">
<TextBlock Text="Usage:" Style="{StaticResource Header}" />
<xctk:IconButton x:Name="_iconButton"
Content="Test"
Icon="{StaticResource Image1}"
IconLocation="Left"
MouseOverForeground="Black"
MousePressedForeground="White"
MouseOverBackground="LightBlue"
MousePressedBackground="Blue"
MouseOverBorderBrush="LightGray"
MousePressedBorderBrush="LightGray"
Margin="10"
Padding="20,3"
HorizontalAlignment="Center">
</xctk:IconButton>
</StackPanel>
</Grid>
</local:DemoView>

29
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/Button/Views/IconButtonView.xaml.cs

@ -0,0 +1,29 @@
/***************************************************************************************
Toolkit for WPF
Copyright (C) 2007-2016 Xceed Software Inc.
This program is provided to you under the terms of the Microsoft Public
License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license
For more features, controls, and fast professional support,
pick up the Plus Edition at https://xceed.com/xceed-toolkit-plus-for-wpf/
Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids
*************************************************************************************/
namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Button.Views
{
/// <summary>
/// Interaction logic for IconButtonView.xaml
/// </summary>
public partial class IconButtonView : DemoView
{
public IconButtonView()
{
InitializeComponent();
}
}
}

4
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/Color/Views/ColorView.xaml

@ -269,8 +269,8 @@
<CheckBox Grid.Column="0" <CheckBox Grid.Column="0"
Grid.Row="6" Grid.Row="6"
Grid.ColumnSpan="2" Grid.ColumnSpan="2"
Content="ShowAdvancedButton" Content="ShowTabHeaders"
IsChecked="{Binding ElementName=_colorPicker, Path=ShowAdvancedButton, Mode=TwoWay}" /> IsChecked="{Binding ElementName=_colorPicker, Path=ShowTabHeaders, Mode=TwoWay}" />
<CheckBox Grid.Column="0" <CheckBox Grid.Column="0"
Grid.Row="7" Grid.Row="7"
Grid.ColumnSpan="2" Grid.ColumnSpan="2"

BIN
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/MaterialControls/OpenSourceImages/MaterialHamburger.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/MaterialControls/Resources/Business.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/MaterialControls/Resources/DataGrid.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/MaterialControls/Resources/SFTP.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/MaterialControls/Resources/Toolkit.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/MaterialControls/Resources/Zip.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

74
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/MaterialControls/Views/MaterialHamburgerView.xaml

@ -0,0 +1,74 @@
<!--*************************************************************************************
Toolkit for WPF
Copyright (C) 2007-2016 Xceed Software Inc.
This program is provided to you under the terms of the Microsoft Public
License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license
For more features, controls, and fast professional support,
pick up the Plus Edition at https://xceed.com/xceed-toolkit-plus-for-wpf/
Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids
***********************************************************************************-->
<local:MaterialDemoView x:Class="Xceed.Wpf.Toolkit.LiveExplorer.Samples.MaterialControls.Views.MaterialHamburgerView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Xceed.Wpf.Toolkit.LiveExplorer"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:conv="clr-namespace:Xceed.Wpf.Toolkit.LiveExplorer.Samples.Converters"
Title="MaterialHamburger">
<local:DemoView.Description>
<!-- TODODOC-->
<Paragraph FontSize="14"
FontFamily="Segoe">
<Run>A ToggleButton that pops a menu from left, right, top or bottom of a Window (or any FrameworkElement). The menu can be an animated HamburgerMenu or any customized content. It uses the Material Brushes.</Run>
<LineBreak />
<LineBreak />
<Run>This feature is only available in the "Plus" version.</Run>
<LineBreak />
<Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Toolkit Plus for WPF.
</Hyperlink>
</Paragraph>
</local:DemoView.Description>
<Image Source="..\OpenSourceImages\MaterialHamburger.png" Width="600" Height="400"/>
</local:MaterialDemoView>

47
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/MaterialControls/Views/MaterialHamburgerView.xaml.cs

@ -0,0 +1,47 @@
/**************************************************************************************
Toolkit for WPF
Copyright (C) 2007-2016 Xceed Software Inc.
This program is provided to you under the terms of the Microsoft Public
License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license
For more features, controls, and fast professional support,
pick up the Plus Edition at https://xceed.com/xceed-toolkit-plus-for-wpf/
Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids
**************************************************************************************/
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;
namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.MaterialControls.Views
{
/// <summary>
/// Interaction logic for MaterialHamburgerView.xaml
/// </summary>
public partial class MaterialHamburgerView : MaterialDemoView
{
#region Constructors
public MaterialHamburgerView()
{
InitializeComponent();
}
#endregion
}
}

5
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/PropertyGrid/Views/PropertyGridAttributesView.xaml.cs

@ -124,9 +124,10 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views
set; set;
} }
[Range(0, 10)] [Range(0d, 10d)]
[Category( "Other" )] [Category( "Other" )]
[Description( "This property uses the [Range(0,10)] attribute to set the Minimum and Maximum properties." )] [DefaultValue(5d)]
[Description( "This property uses the [Range(0,10)] and DefaultValue attributes to set the Minimum, Maximum and default properties." )]
public double RangeDouble public double RangeDouble
{ {
get; get;

5
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/PropertyGrid/Views/PropertyGridSelectedObjectView.xaml

@ -53,7 +53,10 @@
</StackPanel> </StackPanel>
<!-- The SelectedObject property will be assigned in code-behind when one <!-- The SelectedObject property will be assigned in code-behind when one
of the 3 controls receives focus. --> of the 3 controls receives focus. -->
<xctk:PropertyGrid x:Name="_propertyGrid" Grid.Column="1" HorizontalAlignment="Stretch" /> <xctk:PropertyGrid x:Name="_propertyGrid"
Grid.Column="1"
HorizontalAlignment="Stretch"
IsVirtualizing="True"/>
</Grid> </Grid>
</Grid> </Grid>
</local:DemoView> </local:DemoView>

13
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/PropertyGrid/Views/PropertyGridView.xaml

@ -85,11 +85,21 @@
VerticalAlignment="Center" VerticalAlignment="Center"
Margin="5" Margin="5"
ToolTip="Set the IsReadOnly property to true or false." /> ToolTip="Set the IsReadOnly property to true or false." />
<TextBlock Text="ShowPreview:" <TextBlock Text="IsVirtualizing:"
VerticalAlignment="Center" VerticalAlignment="Center"
Grid.Row="3" Grid.Row="3"
Grid.Column="0" /> Grid.Column="0" />
<CheckBox Grid.Row="3" <CheckBox Grid.Row="3"
Grid.Column="1"
IsChecked="{Binding IsVirtualizing, ElementName=_propertyGrid}"
VerticalAlignment="Center"
Margin="5"
ToolTip="Set if the PropertyGrid is using virtualization. Using virtualization will load the PropertyGrid faster with large dataSets." />
<TextBlock Text="ShowPreview:"
VerticalAlignment="Center"
Grid.Row="4"
Grid.Column="0" />
<CheckBox Grid.Row="4"
Grid.Column="1" Grid.Column="1"
IsChecked="{Binding ShowPreview, ElementName=_propertyGrid}" IsChecked="{Binding ShowPreview, ElementName=_propertyGrid}"
VerticalAlignment="Center" VerticalAlignment="Center"
@ -183,6 +193,7 @@
IsCategorized="True" IsCategorized="True"
ShowAdvancedOptions="True" ShowAdvancedOptions="True"
IsReadOnly="False" IsReadOnly="False"
IsVirtualizing="False"
UpdateTextBoxSourceOnEnterKey="True" UpdateTextBoxSourceOnEnterKey="True"
IsMiscCategoryLabelHidden="False" IsMiscCategoryLabelHidden="False"
ShowPreview="True" ShowPreview="True"

2
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/Theming/Views/ThemingAvalonDockView.xaml

@ -161,7 +161,7 @@
Selected="DefaultComboBoxItem_Selected" Selected="DefaultComboBoxItem_Selected"
ThemeEnum="{x:Static view:AvalonDockThemesEnum.Office2007Silver}"> ThemeEnum="{x:Static view:AvalonDockThemesEnum.Office2007Silver}">
</view:AvalonDockComboBoxItem> </view:AvalonDockComboBoxItem>
<view:AvalonDockComboBoxItem Style="{StaticResource plusNewItem}" <view:AvalonDockComboBoxItem Style="{StaticResource plusItem}"
Content="Windows 10" Content="Windows 10"
Selected="DefaultComboBoxItem_Selected" Selected="DefaultComboBoxItem_Selected"
ThemeEnum="{x:Static view:AvalonDockThemesEnum.Windows10}"> ThemeEnum="{x:Static view:AvalonDockThemesEnum.Windows10}">

2
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/ToggleSwitch/Views/ToggleSwitchView.xaml

@ -20,7 +20,7 @@
xmlns:local="clr-namespace:Xceed.Wpf.Toolkit.LiveExplorer" xmlns:local="clr-namespace:Xceed.Wpf.Toolkit.LiveExplorer"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:conv="clr-namespace:Xceed.Wpf.Toolkit.Core.Converters;assembly=Xceed.Wpf.Toolkit" xmlns:conv="clr-namespace:Xceed.Wpf.Toolkit.Core.Converters;assembly=Xceed.Wpf.Toolkit"
xmlns:localConv="clr-namespace:Xceed.Wpf.Toolkit.LiveExplorer.Samples.ToggleSwitch.Converters" xmlns:localConv="clr-namespace:Xceed.Wpf.Toolkit.LiveExplorer.Samples.Converters"
Title="ToggleSwitch"> Title="ToggleSwitch">
<local:DemoView.Description> <local:DemoView.Description>

2
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/Window/Views/ChildWindowView.xaml

@ -98,7 +98,7 @@
<xctk:WindowContainer ModalBackgroundBrush="LightGray"> <xctk:WindowContainer ModalBackgroundBrush="LightGray">
<xctk:ChildWindow x:Name="_childWindow" <xctk:ChildWindow x:Name="_childWindow"
Width="350" Width="350"
Height="220" Height="230"
Caption="{Binding Text, ElementName=_txtCaption}" Caption="{Binding Text, ElementName=_txtCaption}"
IsModal="{Binding IsChecked, ElementName=_chkIsModal}" IsModal="{Binding IsChecked, ElementName=_chkIsModal}"
Left="{Binding Value, ElementName=_txtLeft, Mode=TwoWay}" Left="{Binding Value, ElementName=_txtLeft, Mode=TwoWay}"

40
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Xceed.Wpf.Toolkit.LiveExplorer.csproj

@ -116,6 +116,7 @@
<SubType>Designer</SubType> <SubType>Designer</SubType>
</ApplicationDefinition> </ApplicationDefinition>
<Compile Include="CodeBox.cs" /> <Compile Include="CodeBox.cs" />
<Compile Include="Core\Converters\ZeroToBoolConverter.cs" />
<Compile Include="Core\CSharpFormatter.cs" /> <Compile Include="Core\CSharpFormatter.cs" />
<Compile Include="Core\XamlFormatter.cs" /> <Compile Include="Core\XamlFormatter.cs" />
<Compile Include="HomeView.xaml.cs"> <Compile Include="HomeView.xaml.cs">
@ -134,6 +135,9 @@
<Compile Include="Samples\BusyIndicator\Views\BusyIndicatorView.xaml.cs"> <Compile Include="Samples\BusyIndicator\Views\BusyIndicatorView.xaml.cs">
<DependentUpon>BusyIndicatorView.xaml</DependentUpon> <DependentUpon>BusyIndicatorView.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="Samples\Button\Views\IconButtonView.xaml.cs">
<DependentUpon>IconButtonView.xaml</DependentUpon>
</Compile>
<Compile Include="Samples\Button\Views\ButtonSpinnerView.xaml.cs"> <Compile Include="Samples\Button\Views\ButtonSpinnerView.xaml.cs">
<DependentUpon>ButtonSpinnerView.xaml</DependentUpon> <DependentUpon>ButtonSpinnerView.xaml</DependentUpon>
</Compile> </Compile>
@ -204,6 +208,9 @@
</Compile> </Compile>
<Compile Include="Samples\MaterialControls\Converters\EqualsMinusOneConverter.cs" /> <Compile Include="Samples\MaterialControls\Converters\EqualsMinusOneConverter.cs" />
<Compile Include="Samples\MaterialControls\Data\RequiredRule.cs" /> <Compile Include="Samples\MaterialControls\Data\RequiredRule.cs" />
<Compile Include="Samples\MaterialControls\Views\MaterialHamburgerView.xaml.cs">
<DependentUpon>MaterialHamburgerView.xaml</DependentUpon>
</Compile>
<Compile Include="Samples\MaterialControls\Views\MaterialComboBoxView.xaml.cs"> <Compile Include="Samples\MaterialControls\Views\MaterialComboBoxView.xaml.cs">
<DependentUpon>MaterialComboBoxView.xaml</DependentUpon> <DependentUpon>MaterialComboBoxView.xaml</DependentUpon>
</Compile> </Compile>
@ -388,7 +395,6 @@
<Compile Include="Samples\TimeSpan\Views\TimeSpanView.xaml.cs"> <Compile Include="Samples\TimeSpan\Views\TimeSpanView.xaml.cs">
<DependentUpon>TimeSpanView.xaml</DependentUpon> <DependentUpon>TimeSpanView.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="Samples\ToggleSwitch\Converters\ZeroToBoolConverter.cs" />
<Compile Include="Samples\ToggleSwitch\Views\ToggleSwitchView.xaml.cs"> <Compile Include="Samples\ToggleSwitch\Views\ToggleSwitchView.xaml.cs">
<DependentUpon>ToggleSwitchView.xaml</DependentUpon> <DependentUpon>ToggleSwitchView.xaml</DependentUpon>
</Compile> </Compile>
@ -477,6 +483,10 @@
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType> <SubType>Designer</SubType>
</Page> </Page>
<Page Include="Samples\Button\Views\IconButtonView.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Samples\Button\Views\ButtonSpinnerView.xaml"> <Page Include="Samples\Button\Views\ButtonSpinnerView.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType> <SubType>Designer</SubType>
@ -561,6 +571,10 @@
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</Page> </Page>
<Page Include="Samples\MaterialControls\Views\MaterialHamburgerView.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Samples\MaterialControls\Views\MaterialComboBoxView.xaml"> <Page Include="Samples\MaterialControls\Views\MaterialComboBoxView.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType> <SubType>Designer</SubType>
@ -1388,6 +1402,30 @@
<ItemGroup> <ItemGroup>
<Resource Include="Samples\Theming\OpenSourceImages\AvalonDockWindows10.png" /> <Resource Include="Samples\Theming\OpenSourceImages\AvalonDockWindows10.png" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Resource Include="CodeFiles\MaterialHamburgerView.xaml.cs.txt" />
<Resource Include="CodeFiles\MaterialHamburgerView.xaml.txt" />
</ItemGroup>
<ItemGroup>
<Resource Include="CodeFiles\IconButtonView.xaml.cs.txt" />
<Resource Include="CodeFiles\IconButtonView.xaml.txt" />
</ItemGroup>
<ItemGroup>
<Resource Include="Samples\Button\Resources\PencilTool16.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Samples\Button\Resources\Default.jpg" />
</ItemGroup>
<ItemGroup>
<Resource Include="Samples\MaterialControls\Resources\Business.png" />
<Resource Include="Samples\MaterialControls\Resources\DataGrid.png" />
<Resource Include="Samples\MaterialControls\Resources\SFTP.png" />
<Resource Include="Samples\MaterialControls\Resources\Toolkit.png" />
<Resource Include="Samples\MaterialControls\Resources\Zip.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Samples\MaterialControls\OpenSourceImages\MaterialHamburger.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup> <PropertyGroup>
<PostBuildEvent> <PostBuildEvent>

2
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/AssemblyVersionInfo.cs

@ -21,7 +21,7 @@
internal static class _XceedVersionInfo internal static class _XceedVersionInfo
{ {
[System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )] [System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )]
public const string BaseVersion = "3.1"; public const string BaseVersion = "3.2";
[System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )] [System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )]
public const string Version = BaseVersion + public const string Version = BaseVersion +
".0.0"; ".0.0";

23
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/ButtonSpinner/Implementation/ButtonSpinner.cs

@ -250,7 +250,7 @@ namespace Xceed.Wpf.Toolkit
{ {
if( this.AllowSpin ) if( this.AllowSpin )
{ {
this.OnSpin( new SpinEventArgs( SpinDirection.Increase ) ); this.OnSpin( new SpinEventArgs( Spinner.SpinnerSpinEvent, SpinDirection.Increase ) );
e.Handled = true; e.Handled = true;
} }
@ -260,7 +260,7 @@ namespace Xceed.Wpf.Toolkit
{ {
if( this.AllowSpin ) if( this.AllowSpin )
{ {
this.OnSpin( new SpinEventArgs( SpinDirection.Decrease ) ); this.OnSpin( new SpinEventArgs( Spinner.SpinnerSpinEvent, SpinDirection.Decrease ) );
e.Handled = true; e.Handled = true;
} }
@ -269,7 +269,8 @@ namespace Xceed.Wpf.Toolkit
case Key.Enter: case Key.Enter:
{ {
//Do not Spin on enter Key when spinners have focus //Do not Spin on enter Key when spinners have focus
if( this.IncreaseButton.IsFocused || this.DecreaseButton.IsFocused ) if( ((this.IncreaseButton != null) && (this.IncreaseButton.IsFocused))
|| (( this.DecreaseButton != null ) && this.DecreaseButton.IsFocused ))
{ {
e.Handled = true; e.Handled = true;
} }
@ -282,18 +283,14 @@ namespace Xceed.Wpf.Toolkit
{ {
base.OnMouseWheel( e ); base.OnMouseWheel( e );
if( this.IsKeyboardFocusWithin && !e.Handled && this.AllowSpin ) if( !e.Handled && this.AllowSpin )
{ {
if( e.Delta < 0 ) if( e.Delta != 0 )
{ {
this.OnSpin( new SpinEventArgs( SpinDirection.Decrease, true ) ); var spinnerEventArgs = new SpinEventArgs( Spinner.SpinnerSpinEvent, ( e.Delta < 0 ) ? SpinDirection.Decrease : SpinDirection.Increase, true );
this.OnSpin( spinnerEventArgs );
e.Handled = spinnerEventArgs.Handled;
} }
else if( 0 < e.Delta )
{
this.OnSpin( new SpinEventArgs( SpinDirection.Increase, true ) );
}
e.Handled = true;
} }
} }
@ -322,7 +319,7 @@ namespace Xceed.Wpf.Toolkit
if( AllowSpin ) if( AllowSpin )
{ {
SpinDirection direction = sender == IncreaseButton ? SpinDirection.Increase : SpinDirection.Decrease; SpinDirection direction = sender == IncreaseButton ? SpinDirection.Increase : SpinDirection.Decrease;
OnSpin( new SpinEventArgs( direction ) ); OnSpin( new SpinEventArgs( Spinner.SpinnerSpinEvent, direction ) );
} }
} }

13
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/ButtonSpinner/Implementation/SpinEventArgs.cs

@ -53,11 +53,24 @@ namespace Xceed.Wpf.Toolkit
Direction = direction; Direction = direction;
} }
public SpinEventArgs( RoutedEvent routedEvent, SpinDirection direction )
: base( routedEvent )
{
Direction = direction;
}
public SpinEventArgs( SpinDirection direction, bool usingMouseWheel ) public SpinEventArgs( SpinDirection direction, bool usingMouseWheel )
: base() : base()
{ {
Direction = direction; Direction = direction;
UsingMouseWheel = usingMouseWheel; UsingMouseWheel = usingMouseWheel;
} }
public SpinEventArgs( RoutedEvent routedEvent, SpinDirection direction, bool usingMouseWheel )
: base( routedEvent )
{
Direction = direction;
UsingMouseWheel = usingMouseWheel;
}
} }
} }

18
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/ButtonSpinner/Implementation/Spinner.cs

@ -63,6 +63,24 @@ namespace Xceed.Wpf.Toolkit
/// </summary> /// </summary>
public event EventHandler<SpinEventArgs> Spin; public event EventHandler<SpinEventArgs> Spin;
#region Events
public static readonly RoutedEvent SpinnerSpinEvent = EventManager.RegisterRoutedEvent( "SpinnerSpin", RoutingStrategy.Bubble, typeof( RoutedEventHandler ), typeof( Spinner ) );
public event RoutedEventHandler SpinnerSpin
{
add
{
AddHandler( SpinnerSpinEvent, value );
}
remove
{
RemoveHandler( SpinnerSpinEvent, value );
}
}
#endregion
/// <summary> /// <summary>
/// Initializes a new instance of the Spinner class. /// Initializes a new instance of the Spinner class.
/// </summary> /// </summary>

5
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/CalculatorUpDown/Implementation/CalculatorUpDown.cs

@ -178,12 +178,14 @@ namespace Xceed.Wpf.Toolkit
} }
private void OnCalculatorValueChanged( object sender, RoutedPropertyChangedEventArgs<object> e ) private void OnCalculatorValueChanged( object sender, RoutedPropertyChangedEventArgs<object> e )
{
if( _calculator != null )
{ {
if( IsValid( _calculator.Value ) ) if( IsValid( _calculator.Value ) )
{ {
if( this.UpdateValueOnEnterKey ) if( this.UpdateValueOnEnterKey )
{ {
this.TextBox.Text = (_calculator.Value != null) ? _calculator.Value.Value.ToString( this.FormatString, this.CultureInfo ) : null; this.TextBox.Text = ( _calculator.Value != null ) ? _calculator.Value.Value.ToString( this.FormatString, this.CultureInfo ) : null;
} }
else else
{ {
@ -191,6 +193,7 @@ namespace Xceed.Wpf.Toolkit
} }
} }
} }
}
#endregion //Base Class Overrides #endregion //Base Class Overrides

1
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/CalculatorUpDown/Themes/Aero2.NormalColor.xaml

@ -123,7 +123,6 @@
MinWidth="20" MinWidth="20"
AcceptsReturn="False" AcceptsReturn="False"
Padding="{TemplateBinding Padding}" Padding="{TemplateBinding Padding}"
SelectAllOnGotFocus="{TemplateBinding SelectAllOnGotFocus}"
AutoSelectBehavior="{TemplateBinding AutoSelectBehavior}" AutoSelectBehavior="{TemplateBinding AutoSelectBehavior}"
AutoMoveFocus="{TemplateBinding AutoMoveFocus}" AutoMoveFocus="{TemplateBinding AutoMoveFocus}"
TextAlignment="{TemplateBinding TextAlignment}" TextAlignment="{TemplateBinding TextAlignment}"

1
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/CalculatorUpDown/Themes/Generic.xaml

@ -137,7 +137,6 @@
MinWidth="20" MinWidth="20"
AcceptsReturn="False" AcceptsReturn="False"
Padding="{TemplateBinding Padding}" Padding="{TemplateBinding Padding}"
SelectAllOnGotFocus="{TemplateBinding SelectAllOnGotFocus}"
AutoSelectBehavior="{TemplateBinding AutoSelectBehavior}" AutoSelectBehavior="{TemplateBinding AutoSelectBehavior}"
AutoMoveFocus="{TemplateBinding AutoMoveFocus}" AutoMoveFocus="{TemplateBinding AutoMoveFocus}"
TextAlignment="{TemplateBinding TextAlignment}" TextAlignment="{TemplateBinding TextAlignment}"

129
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Chromes/Themes/Aero2.NormalColor.xaml

@ -25,19 +25,30 @@
<!-- =============================================================================== --> <!-- =============================================================================== -->
<Style TargetType="{x:Type chrome:ButtonChrome}"> <Style TargetType="{x:Type chrome:ButtonChrome}">
<Setter Property="CornerRadius" Value="0" /> <Setter Property="CornerRadius"
<Setter Property="IsTabStop" Value="False" /> Value="0" />
<Setter Property="SnapsToDevicePixels" Value="True" /> <Setter Property="IsTabStop"
<Setter Property="FocusVisualStyle" Value="{x:Null}" /> Value="False" />
<Setter Property="Background" Value="{DynamicResource {x:Static themes:ResourceKeys.ButtonNormalBackgroundKey}}" /> <Setter Property="SnapsToDevicePixels"
<Setter Property="BorderBrush" Value="{DynamicResource {x:Static themes:ResourceKeys.ButtonNormalOuterBorderKey}}" /> Value="True" />
<Setter Property="BorderThickness" Value="1" /> <Setter Property="FocusVisualStyle"
Value="{x:Null}" />
<Setter Property="Background"
Value="{DynamicResource {x:Static themes:ResourceKeys.ButtonNormalBackgroundKey}}" />
<Setter Property="BorderBrush"
Value="{DynamicResource {x:Static themes:ResourceKeys.ButtonNormalOuterBorderKey}}" />
<Setter Property="BorderThickness"
Value="1" />
<Setter Property="Template"> <Setter Property="Template">
<Setter.Value> <Setter.Value>
<ControlTemplate TargetType="{x:Type chrome:ButtonChrome}"> <ControlTemplate TargetType="{x:Type chrome:ButtonChrome}">
<Grid> <Grid>
<Border x:Name="OuterBorder" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding CornerRadius}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" /> <Border x:Name="OuterBorder"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}"
BorderBrush="{TemplateBinding BorderBrush}"
Background="{TemplateBinding Background}" />
<ContentPresenter Margin="{TemplateBinding Padding}" <ContentPresenter Margin="{TemplateBinding Padding}"
IsEnabled="{TemplateBinding IsEnabled}" IsEnabled="{TemplateBinding IsEnabled}"
@ -52,67 +63,109 @@
<!-- If button is disabled, not checked, and is rendered normal --> <!-- If button is disabled, not checked, and is rendered normal -->
<MultiTrigger> <MultiTrigger>
<MultiTrigger.Conditions> <MultiTrigger.Conditions>
<Condition Property="RenderEnabled" Value="False" /> <Condition Property="RenderEnabled"
<Condition Property="RenderChecked" Value="False" /> Value="False" />
<Condition Property="RenderChecked"
Value="False" />
</MultiTrigger.Conditions> </MultiTrigger.Conditions>
<Setter TargetName="OuterBorder" Property="BorderBrush" Value="{DynamicResource {x:Static themes:ResourceKeys.ButtonDisabledOuterBorderKey}}" /> <Setter TargetName="OuterBorder"
<Setter TargetName="OuterBorder" Property="Background" Value="{DynamicResource {x:Static themes:ResourceKeys.ControlDisabledBackgroundKey}}" /> Property="BorderBrush"
Value="{DynamicResource {x:Static themes:ResourceKeys.ButtonDisabledOuterBorderKey}}" />
<Setter TargetName="OuterBorder"
Property="Background"
Value="{DynamicResource {x:Static themes:ResourceKeys.ControlDisabledBackgroundKey}}" />
</MultiTrigger> </MultiTrigger>
<!-- if button is enabled and pressed --> <!-- if button is enabled and pressed -->
<MultiTrigger> <MultiTrigger>
<MultiTrigger.Conditions> <MultiTrigger.Conditions>
<Condition Property="RenderEnabled" Value="True" /> <Condition Property="RenderEnabled"
<Condition Property="RenderPressed" Value="True" /> Value="True" />
<Condition Property="RenderPressed"
Value="True" />
</MultiTrigger.Conditions> </MultiTrigger.Conditions>
<Setter TargetName="OuterBorder" Property="BorderBrush" Value="{DynamicResource {x:Static themes:ResourceKeys.ButtonPressedOuterBorderKey}}" /> <Setter TargetName="OuterBorder"
<Setter TargetName="OuterBorder" Property="Background" Value="{DynamicResource {x:Static themes:ResourceKeys.ButtonPressedBackgroundKey}}" /> Property="BorderBrush"
Value="{DynamicResource {x:Static themes:ResourceKeys.ButtonPressedOuterBorderKey}}" />
<Setter TargetName="OuterBorder"
Property="Background"
Value="{DynamicResource {x:Static themes:ResourceKeys.ButtonPressedBackgroundKey}}" />
</MultiTrigger> </MultiTrigger>
<!-- if button is enabled, is not checked, the mouse is over, and not pressed --> <!-- if button is enabled, is not checked, the mouse is over, and not pressed -->
<MultiTrigger> <MultiTrigger>
<MultiTrigger.Conditions> <MultiTrigger.Conditions>
<Condition Property="RenderEnabled" Value="True" /> <Condition Property="RenderEnabled"
<Condition Property="RenderChecked" Value="False" /> Value="True" />
<Condition Property="RenderMouseOver" Value="True" /> <Condition Property="RenderChecked"
<Condition Property="RenderPressed" Value="False" /> Value="False" />
<Condition Property="RenderMouseOver"
Value="True" />
<Condition Property="RenderPressed"
Value="False" />
</MultiTrigger.Conditions> </MultiTrigger.Conditions>
<Setter TargetName="OuterBorder" Property="BorderBrush" Value="{DynamicResource {x:Static themes:ResourceKeys.ButtonMouseOverOuterBorderKey}}" /> <Setter TargetName="OuterBorder"
<Setter TargetName="OuterBorder" Property="Background" Value="{DynamicResource {x:Static themes:ResourceKeys.ButtonMouseOverBackgroundKey}}" /> Property="BorderBrush"
Value="{DynamicResource {x:Static themes:ResourceKeys.ButtonMouseOverOuterBorderKey}}" />
<Setter TargetName="OuterBorder"
Property="Background"
Value="{DynamicResource {x:Static themes:ResourceKeys.ButtonMouseOverBackgroundKey}}" />
</MultiTrigger> </MultiTrigger>
<!-- if button is enabled, checked, the mouse is not over, and it is not pressed --> <!-- if button is enabled, checked, the mouse is not over, and it is not pressed -->
<MultiTrigger> <MultiTrigger>
<MultiTrigger.Conditions> <MultiTrigger.Conditions>
<Condition Property="RenderEnabled" Value="True" /> <Condition Property="RenderEnabled"
<Condition Property="RenderChecked" Value="True" /> Value="True" />
<Condition Property="RenderMouseOver" Value="False" /> <Condition Property="RenderChecked"
<Condition Property="RenderPressed" Value="False" /> Value="True" />
<Condition Property="RenderMouseOver"
Value="False" />
<Condition Property="RenderPressed"
Value="False" />
</MultiTrigger.Conditions> </MultiTrigger.Conditions>
<Setter TargetName="OuterBorder" Property="BorderBrush" Value="{DynamicResource {x:Static themes:ResourceKeys.ButtonPressedOuterBorderKey}}" /> <Setter TargetName="OuterBorder"
<Setter TargetName="OuterBorder" Property="Background" Value="{DynamicResource {x:Static themes:ResourceKeys.ButtonPressedBackgroundKey}}" /> Property="BorderBrush"
Value="{DynamicResource {x:Static themes:ResourceKeys.ButtonPressedOuterBorderKey}}" />
<Setter TargetName="OuterBorder"
Property="Background"
Value="{DynamicResource {x:Static themes:ResourceKeys.ButtonPressedBackgroundKey}}" />
</MultiTrigger> </MultiTrigger>
<!-- if button is focused, is enabled, not pressed, and the mouse is not over --> <!-- if button is focused, is enabled, not pressed, and the mouse is not over -->
<MultiTrigger> <MultiTrigger>
<MultiTrigger.Conditions> <MultiTrigger.Conditions>
<Condition Property="RenderFocused" Value="True" /> <Condition Property="RenderFocused"
<Condition Property="RenderEnabled" Value="True" /> Value="True" />
<Condition Property="RenderPressed" Value="False" /> <Condition Property="RenderEnabled"
<Condition Property="RenderMouseOver" Value="False" /> Value="True" />
<Condition Property="RenderPressed"
Value="False" />
<Condition Property="RenderMouseOver"
Value="False" />
</MultiTrigger.Conditions> </MultiTrigger.Conditions>
<Setter TargetName="OuterBorder" Property="BorderBrush" Value="{DynamicResource {x:Static themes:ResourceKeys.ButtonFocusedOuterBorderKey}}" /> <Setter TargetName="OuterBorder"
<Setter TargetName="OuterBorder" Property="Background" Value="{DynamicResource {x:Static themes:ResourceKeys.ButtonFocusedBackgroundKey}}" /> Property="BorderBrush"
Value="{DynamicResource {x:Static themes:ResourceKeys.ButtonFocusedOuterBorderKey}}" />
<Setter TargetName="OuterBorder"
Property="Background"
Value="{DynamicResource {x:Static themes:ResourceKeys.ButtonFocusedBackgroundKey}}" />
</MultiTrigger> </MultiTrigger>
<!-- if not rendered normally --> <!-- if not rendered normally -->
<MultiTrigger> <MultiTrigger>
<MultiTrigger.Conditions> <MultiTrigger.Conditions>
<Condition Property="RenderNormal" Value="False" /> <Condition Property="RenderNormal"
<Condition Property="RenderChecked" Value="False" /> Value="False" />
<Condition Property="RenderChecked"
Value="False" />
</MultiTrigger.Conditions> </MultiTrigger.Conditions>
<Setter TargetName="OuterBorder" Property="BorderBrush" Value="Transparent" /> <Setter TargetName="OuterBorder"
<Setter TargetName="OuterBorder" Property="Background" Value="Transparent" /> Property="BorderBrush"
Value="Transparent" />
<Setter TargetName="OuterBorder"
Property="Background"
Value="Transparent" />
</MultiTrigger> </MultiTrigger>
</ControlTemplate.Triggers> </ControlTemplate.Triggers>

15
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/ColorCanvas/Implementation/ColorCanvas.cs

@ -392,6 +392,8 @@ namespace Xceed.Wpf.Toolkit
#region Event Handlers #region Event Handlers
void ColorShadingCanvas_MouseLeftButtonDown( object sender, MouseButtonEventArgs e ) void ColorShadingCanvas_MouseLeftButtonDown( object sender, MouseButtonEventArgs e )
{
if( _colorShadingCanvas != null )
{ {
Point p = e.GetPosition( _colorShadingCanvas ); Point p = e.GetPosition( _colorShadingCanvas );
UpdateColorShadeSelectorPositionAndCalculateColor( p, true ); UpdateColorShadeSelectorPositionAndCalculateColor( p, true );
@ -399,13 +401,19 @@ namespace Xceed.Wpf.Toolkit
//Prevent from closing ColorCanvas after mouseDown in ListView //Prevent from closing ColorCanvas after mouseDown in ListView
e.Handled = true; e.Handled = true;
} }
}
void ColorShadingCanvas_MouseLeftButtonUp( object sender, MouseButtonEventArgs e ) void ColorShadingCanvas_MouseLeftButtonUp( object sender, MouseButtonEventArgs e )
{
if( _colorShadingCanvas != null )
{ {
_colorShadingCanvas.ReleaseMouseCapture(); _colorShadingCanvas.ReleaseMouseCapture();
} }
}
void ColorShadingCanvas_MouseMove( object sender, MouseEventArgs e ) void ColorShadingCanvas_MouseMove( object sender, MouseEventArgs e )
{
if( _colorShadingCanvas != null )
{ {
if( e.LeftButton == MouseButtonState.Pressed ) if( e.LeftButton == MouseButtonState.Pressed )
{ {
@ -414,6 +422,7 @@ namespace Xceed.Wpf.Toolkit
Mouse.Synchronize(); Mouse.Synchronize();
} }
} }
}
void ColorShadingCanvas_SizeChanged( object sender, SizeChangedEventArgs e ) void ColorShadingCanvas_SizeChanged( object sender, SizeChangedEventArgs e )
{ {
@ -493,6 +502,9 @@ namespace Xceed.Wpf.Toolkit
private void UpdateColorShadeSelectorPositionAndCalculateColor( Point p, bool calculateColor ) private void UpdateColorShadeSelectorPositionAndCalculateColor( Point p, bool calculateColor )
{ {
if( (_colorShadingCanvas == null) || ( _colorShadeSelector == null) )
return;
if( p.Y < 0 ) if( p.Y < 0 )
p.Y = 0; p.Y = 0;
@ -541,6 +553,9 @@ namespace Xceed.Wpf.Toolkit
private void CalculateColor( Point p ) private void CalculateColor( Point p )
{ {
if( _spectrumSlider == null )
return;
HsvColor hsv = new HsvColor( 360 - _spectrumSlider.Value, 1, 1 ) HsvColor hsv = new HsvColor( 360 - _spectrumSlider.Value, 1, 1 )
{ {
S = p.X, S = p.X,

3
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/ColorCanvas/Implementation/ColorSpectrumSlider.cs

@ -103,8 +103,11 @@ namespace Xceed.Wpf.Toolkit
} }
_pickerBrush.GradientStops[ i - 1 ].Offset = 1.0; _pickerBrush.GradientStops[ i - 1 ].Offset = 1.0;
if( _spectrumDisplay != null )
{
_spectrumDisplay.Fill = _pickerBrush; _spectrumDisplay.Fill = _pickerBrush;
} }
}
#endregion //Methods #endregion //Methods
} }

60
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/ColorPicker/Implementation/ColorPicker.cs

@ -45,7 +45,6 @@ namespace Xceed.Wpf.Toolkit
[TemplatePart( Name = PART_RecentColors, Type = typeof( ListBox ) )] [TemplatePart( Name = PART_RecentColors, Type = typeof( ListBox ) )]
[TemplatePart( Name = PART_ColorPickerToggleButton, Type = typeof( ToggleButton ) )] [TemplatePart( Name = PART_ColorPickerToggleButton, Type = typeof( ToggleButton ) )]
[TemplatePart( Name = PART_ColorPickerPalettePopup, Type = typeof( Popup ) )] [TemplatePart( Name = PART_ColorPickerPalettePopup, Type = typeof( Popup ) )]
[TemplatePart( Name = PART_ColorModeButton, Type = typeof( Button ) )]
public class ColorPicker : Control public class ColorPicker : Control
{ {
private const string PART_AvailableColors = "PART_AvailableColors"; private const string PART_AvailableColors = "PART_AvailableColors";
@ -53,7 +52,6 @@ namespace Xceed.Wpf.Toolkit
private const string PART_RecentColors = "PART_RecentColors"; private const string PART_RecentColors = "PART_RecentColors";
private const string PART_ColorPickerToggleButton = "PART_ColorPickerToggleButton"; private const string PART_ColorPickerToggleButton = "PART_ColorPickerToggleButton";
private const string PART_ColorPickerPalettePopup = "PART_ColorPickerPalettePopup"; private const string PART_ColorPickerPalettePopup = "PART_ColorPickerPalettePopup";
private const string PART_ColorModeButton = "PART_ColorModeButton";
#region Members #region Members
@ -62,7 +60,6 @@ namespace Xceed.Wpf.Toolkit
private ListBox _recentColors; private ListBox _recentColors;
private ToggleButton _toggleButton; private ToggleButton _toggleButton;
private Popup _popup; private Popup _popup;
private Button _colorModeButton;
private Color? _initialColor; private Color? _initialColor;
private bool _selectionChanged; private bool _selectionChanged;
@ -355,22 +352,22 @@ namespace Xceed.Wpf.Toolkit
#endregion //SelectedColorText #endregion //SelectedColorText
#region ShowAdvancedButton #region ShowTabHeaders
public static readonly DependencyProperty ShowAdvancedButtonProperty = DependencyProperty.Register( "ShowAdvancedButton", typeof( bool ), typeof( ColorPicker ), new UIPropertyMetadata( true ) ); public static readonly DependencyProperty ShowTabHeadersProperty = DependencyProperty.Register( "ShowTabHeaders", typeof( bool ), typeof( ColorPicker ), new UIPropertyMetadata( true ) );
public bool ShowAdvancedButton public bool ShowTabHeaders
{ {
get get
{ {
return ( bool )GetValue( ShowAdvancedButtonProperty ); return ( bool )GetValue( ShowTabHeadersProperty );
} }
set set
{ {
SetValue( ShowAdvancedButtonProperty, value ); SetValue( ShowTabHeadersProperty, value );
} }
} }
#endregion //ShowAdvancedButton #endregion //ShowTabHeaders
#region ShowAvailableColors #region ShowAvailableColors
@ -578,14 +575,6 @@ namespace Xceed.Wpf.Toolkit
_popup.Opened += Popup_Opened; _popup.Opened += Popup_Opened;
_toggleButton = this.Template.FindName( PART_ColorPickerToggleButton, this ) as ToggleButton; _toggleButton = this.Template.FindName( PART_ColorPickerToggleButton, this ) as ToggleButton;
if( _colorModeButton != null )
_colorModeButton.Click -= new RoutedEventHandler( this.ColorModeButton_Clicked );
_colorModeButton = this.Template.FindName( PART_ColorModeButton, this ) as Button;
if( _colorModeButton != null )
_colorModeButton.Click += new RoutedEventHandler( this.ColorModeButton_Clicked );
} }
protected override void OnMouseUp( MouseButtonEventArgs e ) protected override void OnMouseUp( MouseButtonEventArgs e )
@ -675,11 +664,6 @@ namespace Xceed.Wpf.Toolkit
listBoxItem.Focus(); listBoxItem.Focus();
} }
private void ColorModeButton_Clicked( object sender, RoutedEventArgs e )
{
this.ColorMode = ( this.ColorMode == ColorMode.ColorPalette ) ? ColorMode.ColorCanvas : ColorMode.ColorPalette;
}
#endregion //Event Handlers #endregion //Event Handlers
#region Events #region Events
@ -769,35 +753,35 @@ namespace Xceed.Wpf.Toolkit
private static ObservableCollection<ColorItem> CreateStandardColors() private static ObservableCollection<ColorItem> CreateStandardColors()
{ {
ObservableCollection<ColorItem> _standardColors = new ObservableCollection<ColorItem>(); ObservableCollection<ColorItem> standardColors = new ObservableCollection<ColorItem>();
_standardColors.Add( new ColorItem( Colors.Transparent, "Transparent" ) ); standardColors.Add( new ColorItem( Colors.Transparent, "Transparent" ) );
_standardColors.Add( new ColorItem( Colors.White, "White" ) ); standardColors.Add( new ColorItem( Colors.White, "White" ) );
_standardColors.Add( new ColorItem( Colors.Gray, "Gray" ) ); standardColors.Add( new ColorItem( Colors.Gray, "Gray" ) );
_standardColors.Add( new ColorItem( Colors.Black, "Black" ) ); standardColors.Add( new ColorItem( Colors.Black, "Black" ) );
_standardColors.Add( new ColorItem( Colors.Red, "Red" ) ); standardColors.Add( new ColorItem( Colors.Red, "Red" ) );
_standardColors.Add( new ColorItem( Colors.Green, "Green" ) ); standardColors.Add( new ColorItem( Colors.Green, "Green" ) );
_standardColors.Add( new ColorItem( Colors.Blue, "Blue" ) ); standardColors.Add( new ColorItem( Colors.Blue, "Blue" ) );
_standardColors.Add( new ColorItem( Colors.Yellow, "Yellow" ) ); standardColors.Add( new ColorItem( Colors.Yellow, "Yellow" ) );
_standardColors.Add( new ColorItem( Colors.Orange, "Orange" ) ); standardColors.Add( new ColorItem( Colors.Orange, "Orange" ) );
_standardColors.Add( new ColorItem( Colors.Purple, "Purple" ) ); standardColors.Add( new ColorItem( Colors.Purple, "Purple" ) );
return _standardColors; return standardColors;
} }
private static ObservableCollection<ColorItem> CreateAvailableColors() private static ObservableCollection<ColorItem> CreateAvailableColors()
{ {
ObservableCollection<ColorItem> _standardColors = new ObservableCollection<ColorItem>(); ObservableCollection<ColorItem> standardColors = new ObservableCollection<ColorItem>();
foreach( var item in ColorUtilities.KnownColors ) foreach( var item in ColorUtilities.KnownColors )
{ {
if( !String.Equals( item.Key, "Transparent" ) ) if( !String.Equals( item.Key, "Transparent" ) )
{ {
var colorItem = new ColorItem( item.Value, item.Key ); var colorItem = new ColorItem( item.Value, item.Key );
if( !_standardColors.Contains( colorItem ) ) if( !standardColors.Contains( colorItem ) )
_standardColors.Add( colorItem ); standardColors.Add( colorItem );
} }
} }
return _standardColors; return standardColors;
} }
#endregion //Methods #endregion //Methods

43
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/ColorPicker/Implementation/ColorPickerTabItem.cs

@ -0,0 +1,43 @@
/*************************************************************************************
Extended WPF Toolkit
Copyright (C) 2007-2013 Xceed Software Inc.
This program is provided to you under the terms of the Microsoft Public
License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license
For more features, controls, and fast professional support,
pick up the Plus Edition at http://xceed.com/wpf_toolkit
Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids
***********************************************************************************/
using System.Windows.Controls;
using System.Windows.Input;
namespace Xceed.Wpf.Toolkit
{
public class ColorPickerTabItem : TabItem
{
protected override void OnMouseLeftButtonDown( MouseButtonEventArgs e )
{
if( e.Source == this || !this.IsSelected )
return;
base.OnMouseLeftButtonDown( e );
}
protected override void OnMouseLeftButtonUp( MouseButtonEventArgs e )
{
//Selection on Mouse Up
if( e.Source == this || !this.IsSelected )
{
base.OnMouseLeftButtonDown( e );
}
base.OnMouseLeftButtonUp( e );
}
}
}

113
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/ColorPicker/Themes/Aero2.NormalColor.xaml

@ -31,6 +31,7 @@
<conv:InverseBoolConverter x:Key="InverseBoolConverter" /> <conv:InverseBoolConverter x:Key="InverseBoolConverter" />
<conv:ColorToSolidColorBrushConverter x:Key="ColorToSolidColorBrushConverter" /> <conv:ColorToSolidColorBrushConverter x:Key="ColorToSolidColorBrushConverter" />
<conv:AdditionConverter x:Key="AdditionConverter" /> <conv:AdditionConverter x:Key="AdditionConverter" />
<conv:ColorModeToTabItemSelectedConverter x:Key="ColorModeToTabItemSelectedConverter" />
<Style x:Key="ColorItemContainerStyle" <Style x:Key="ColorItemContainerStyle"
TargetType="{x:Type ListBoxItem}"> TargetType="{x:Type ListBoxItem}">
@ -226,6 +227,48 @@
Value="Single" /> Value="Single" />
</Style> </Style>
<ControlTemplate x:Key="TabItemTemplate"
TargetType="{x:Type local:ColorPickerTabItem}">
<Grid x:Name="templateRoot"
SnapsToDevicePixels="true">
<Border x:Name="mainBorder"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="1,1,1,0"
Background="#FFF0F0F0"
Margin="0">
<Border x:Name="innerBorder"
BorderBrush="#ACACAC"
BorderThickness="1,1,1,0"
Background="#FFF0F0F0"
Margin="-1"
Opacity="0" />
</Border>
<ContentPresenter x:Name="contentPresenter"
ContentSource="Header"
Focusable="False"
HorizontalAlignment="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"
Margin="{TemplateBinding Padding}"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
VerticalAlignment="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" />
</Grid>
<ControlTemplate.Triggers>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}"
Value="true" />
</MultiDataTrigger.Conditions>
<Setter Property="Panel.ZIndex"
Value="1" />
<Setter Property="Margin"
Value="-2,-2,-2,0" />
<Setter Property="Opacity"
TargetName="innerBorder"
Value="1" />
</MultiDataTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<!-- =============================================================================== --> <!-- =============================================================================== -->
<!-- ColorPicker --> <!-- ColorPicker -->
@ -311,15 +354,13 @@
Background="{StaticResource PanelBackgroundBrush}" Background="{StaticResource PanelBackgroundBrush}"
BorderBrush="{StaticResource PopupDarkBorderBrush}" BorderBrush="{StaticResource PopupDarkBorderBrush}"
Padding="3" > Padding="3" >
<Grid> <TabControl x:Name="ColorPickerTabControl"
<Grid.RowDefinitions> Background="Transparent"
<RowDefinition Height="Auto" /> SelectedIndex="{Binding ColorMode, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource ColorModeToTabItemSelectedConverter}}">
<RowDefinition /> <local:ColorPickerTabItem x:Name="StandardTabItem"
<RowDefinition Height="Auto" /> Header="{Binding StandardButtonHeader, RelativeSource={RelativeSource TemplatedParent}}"
</Grid.RowDefinitions> Template="{StaticResource TabItemTemplate}">
<Grid x:Name="_colorPaletteHost" <Grid x:Name="_colorPaletteHost"
Visibility="Collapsed"
Margin="4"> Margin="4">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
@ -386,28 +427,20 @@
</Grid> </Grid>
</Grid> </Grid>
</Grid> </Grid>
</local:ColorPickerTabItem>
<local:ColorPickerTabItem x:Name="AdvancedTabItem"
Header="{Binding AdvancedButtonHeader, RelativeSource={RelativeSource TemplatedParent}}"
Template="{StaticResource TabItemTemplate}">
<!-- ColorCanvas --> <!-- ColorCanvas -->
<Grid x:Name="_colorCanvasHost" <Grid x:Name="_colorCanvasHost">
Visibility="Collapsed">
<local:ColorCanvas Background="Transparent" <local:ColorCanvas Background="Transparent"
BorderThickness="0" BorderThickness="0"
UsingAlphaChannel="{Binding UsingAlphaChannel, RelativeSource={RelativeSource TemplatedParent}}" UsingAlphaChannel="{Binding UsingAlphaChannel, RelativeSource={RelativeSource TemplatedParent}}"
SelectedColor="{Binding SelectedColor, RelativeSource={RelativeSource TemplatedParent}}" SelectedColor="{Binding SelectedColor, RelativeSource={RelativeSource TemplatedParent}}"
Width="{Binding MaxDropDownWidth, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource AdditionConverter}, ConverterParameter=-18}"/> Width="{Binding MaxDropDownWidth, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource AdditionConverter}, ConverterParameter=-18}" />
</Grid>
<Separator Grid.Row="1"
HorizontalAlignment="Stretch"
Margin="5,0,5,0"
Visibility="{TemplateBinding ShowAdvancedButton, Converter={StaticResource BooleanToVisibilityConverter}}" />
<!-- More Colors Button -->
<Button x:Name="PART_ColorModeButton"
Grid.Row="2"
Margin="5"
Visibility="{TemplateBinding ShowAdvancedButton, Converter={StaticResource BooleanToVisibilityConverter}}" />
</Grid> </Grid>
</local:ColorPickerTabItem>
</TabControl>
</Border> </Border>
</Popup> </Popup>
</Grid> </Grid>
@ -422,30 +455,14 @@
Value="Visible" /> Value="Visible" />
</Trigger> </Trigger>
<Trigger Property="ColorMode" <Trigger Property="ShowTabHeaders"
Value="ColorPalette"> Value="False">
<Setter TargetName="_colorPaletteHost" <Setter Property="Visibility"
Property="Visibility" Value="Collapsed"
Value="Visible" /> TargetName="StandardTabItem" />
<Setter TargetName="_colorCanvasHost" <Setter Property="Visibility"
Property="Visibility" Value="Collapsed"
Value="Collapsed" /> TargetName="AdvancedTabItem" />
<Setter TargetName="PART_ColorModeButton"
Property="Content"
Value="{Binding AdvancedButtonHeader, RelativeSource={RelativeSource TemplatedParent}}" />
</Trigger>
<Trigger Property="ColorMode"
Value="ColorCanvas">
<Setter TargetName="_colorPaletteHost"
Property="Visibility"
Value="Collapsed" />
<Setter TargetName="_colorCanvasHost"
Property="Visibility"
Value="Visible" />
<Setter TargetName="PART_ColorModeButton"
Property="Content"
Value="{Binding StandardButtonHeader, RelativeSource={RelativeSource TemplatedParent}}" />
</Trigger> </Trigger>
<Trigger Property="ShowDropDownButton" <Trigger Property="ShowDropDownButton"

98
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/ColorPicker/Themes/Generic.xaml

@ -40,6 +40,7 @@
<conv:InverseBoolConverter x:Key="InverseBoolConverter" /> <conv:InverseBoolConverter x:Key="InverseBoolConverter" />
<conv:ColorToSolidColorBrushConverter x:Key="ColorToSolidColorBrushConverter" /> <conv:ColorToSolidColorBrushConverter x:Key="ColorToSolidColorBrushConverter" />
<conv:AdditionConverter x:Key="AdditionConverter" /> <conv:AdditionConverter x:Key="AdditionConverter" />
<conv:ColorModeToTabItemSelectedConverter x:Key="ColorModeToTabItemSelectedConverter" />
<LinearGradientBrush x:Key="ColorPickerDarkBorderBrush" EndPoint="0.5,1" StartPoint="0.5,0"> <LinearGradientBrush x:Key="ColorPickerDarkBorderBrush" EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FFA3AEB9" Offset="0" /> <GradientStop Color="#FFA3AEB9" Offset="0" />
@ -205,6 +206,48 @@
<Setter Property="SelectionMode" Value="Single" /> <Setter Property="SelectionMode" Value="Single" />
</Style> </Style>
<ControlTemplate x:Key="TabItemTemplate"
TargetType="{x:Type local:ColorPickerTabItem}">
<Grid x:Name="templateRoot"
SnapsToDevicePixels="true">
<Border x:Name="mainBorder"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="1,1,1,0"
Background="#FFF0F0F0"
Margin="0">
<Border x:Name="innerBorder"
BorderBrush="#ACACAC"
BorderThickness="1,1,1,0"
Background="#FFF0F0F0"
Margin="-1"
Opacity="0" />
</Border>
<ContentPresenter x:Name="contentPresenter"
ContentSource="Header"
Focusable="False"
HorizontalAlignment="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"
Margin="{TemplateBinding Padding}"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
VerticalAlignment="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" />
</Grid>
<ControlTemplate.Triggers>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}"
Value="true" />
</MultiDataTrigger.Conditions>
<Setter Property="Panel.ZIndex"
Value="1" />
<Setter Property="Margin"
Value="-2,-2,-2,0" />
<Setter Property="Opacity"
TargetName="innerBorder"
Value="1" />
</MultiDataTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<Style TargetType="{x:Type local:ColorPicker}"> <Style TargetType="{x:Type local:ColorPicker}">
<Setter Property="Background" Value="White" /> <Setter Property="Background" Value="White" />
<Setter Property="BorderBrush" Value="{StaticResource ColorPickerDarkBorderBrush}" /> <Setter Property="BorderBrush" Value="{StaticResource ColorPickerDarkBorderBrush}" />
@ -265,14 +308,13 @@
</Style> </Style>
</Popup.Resources> </Popup.Resources>
<Border BorderThickness="1" Background="{StaticResource PopupBackgroundBrush}" BorderBrush="{StaticResource ColorPickerDarkBorderBrush}" Padding="3"> <Border BorderThickness="1" Background="{StaticResource PopupBackgroundBrush}" BorderBrush="{StaticResource ColorPickerDarkBorderBrush}" Padding="3">
<Grid> <TabControl x:Name="ColorPickerTabControl"
<Grid.RowDefinitions> Background="Transparent"
<RowDefinition Height="Auto" /> SelectedIndex="{Binding ColorMode, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource ColorModeToTabItemSelectedConverter}}">
<RowDefinition /> <local:ColorPickerTabItem x:Name="StandardTabItem"
<RowDefinition Height="Auto" /> Header="{Binding StandardButtonHeader, RelativeSource={RelativeSource TemplatedParent}}"
</Grid.RowDefinitions> Template="{StaticResource TabItemTemplate}">
<Grid x:Name="_colorPaletteHost" Margin="4">
<Grid x:Name="_colorPaletteHost" Visibility="Collapsed" Margin="4">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
@ -325,24 +367,20 @@
</Grid> </Grid>
</Grid> </Grid>
</Grid> </Grid>
</local:ColorPickerTabItem>
<local:ColorPickerTabItem x:Name="AdvancedTabItem"
Header="{Binding AdvancedButtonHeader, RelativeSource={RelativeSource TemplatedParent}}"
Template="{StaticResource TabItemTemplate}">
<!-- ColorCanvas --> <!-- ColorCanvas -->
<Grid x:Name="_colorCanvasHost" Visibility="Collapsed"> <Grid x:Name="_colorCanvasHost">
<local:ColorCanvas Background="Transparent" <local:ColorCanvas Background="Transparent"
BorderThickness="0" BorderThickness="0"
UsingAlphaChannel="{Binding UsingAlphaChannel, RelativeSource={RelativeSource TemplatedParent}}" UsingAlphaChannel="{Binding UsingAlphaChannel, RelativeSource={RelativeSource TemplatedParent}}"
SelectedColor="{Binding SelectedColor, RelativeSource={RelativeSource TemplatedParent}}" SelectedColor="{Binding SelectedColor, RelativeSource={RelativeSource TemplatedParent}}"
Width="{Binding MaxDropDownWidth, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource AdditionConverter}, ConverterParameter=-18}" /> Width="{Binding MaxDropDownWidth, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource AdditionConverter}, ConverterParameter=-18}" />
</Grid> </Grid>
</local:ColorPickerTabItem>
<Separator Grid.Row="1" </TabControl>
HorizontalAlignment="Stretch"
Margin="5,0,5,0"
Visibility="{TemplateBinding ShowAdvancedButton, Converter={StaticResource BooleanToVisibilityConverter}}" />
<!-- More Colors Button -->
<Button x:Name="PART_ColorModeButton" Grid.Row="2" Margin="5" Visibility="{TemplateBinding ShowAdvancedButton, Converter={StaticResource BooleanToVisibilityConverter}}" />
</Grid>
</Border> </Border>
</Popup> </Popup>
</Grid> </Grid>
@ -352,20 +390,14 @@
<Setter TargetName="ColorAndName" Property="Visibility" Value="Visible" /> <Setter TargetName="ColorAndName" Property="Visibility" Value="Visible" />
</Trigger> </Trigger>
<Trigger Property="ColorMode" Value="ColorPalette"> <Trigger Property="ShowTabHeaders"
<Setter TargetName="_colorPaletteHost" Property="Visibility" Value="Visible" /> Value="False">
<Setter TargetName="_colorCanvasHost" Property="Visibility" Value="Collapsed" /> <Setter Property="Visibility"
<Setter TargetName="PART_ColorModeButton" Value="Collapsed"
Property="Content" TargetName="StandardTabItem" />
Value="{Binding AdvancedButtonHeader, RelativeSource={RelativeSource TemplatedParent}}" /> <Setter Property="Visibility"
</Trigger> Value="Collapsed"
TargetName="AdvancedTabItem" />
<Trigger Property="ColorMode" Value="ColorCanvas">
<Setter TargetName="_colorPaletteHost" Property="Visibility" Value="Collapsed" />
<Setter TargetName="_colorCanvasHost" Property="Visibility" Value="Visible" />
<Setter TargetName="PART_ColorModeButton"
Property="Content"
Value="{Binding StandardButtonHeader, RelativeSource={RelativeSource TemplatedParent}}" />
</Trigger> </Trigger>
<Trigger Property="ShowDropDownButton" Value="False"> <Trigger Property="ShowDropDownButton" Value="False">

37
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Core/Converters/ColorModeToTabItemSelectedConverter.cs

@ -0,0 +1,37 @@
/*************************************************************************************
Extended WPF Toolkit
Copyright (C) 2007-2013 Xceed Software Inc.
This program is provided to you under the terms of the Microsoft Public
License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license
For more features, controls, and fast professional support,
pick up the Plus Edition at http://xceed.com/wpf_toolkit
Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids
***********************************************************************************/
using System;
using System.Globalization;
using System.Windows.Data;
namespace Xceed.Wpf.Toolkit.Core.Converters
{
public class ColorModeToTabItemSelectedConverter : IValueConverter
{
public object Convert( object value, Type targetType, object parameter, CultureInfo culture )
{
var colorMode = ( ColorMode )value;
return (colorMode == ColorMode.ColorPalette) ? 0 : 1;
}
public object ConvertBack( object value, Type targetType, object parameter, CultureInfo culture )
{
var index = ( int )value;
return ( index == 0 ) ? ColorMode.ColorPalette : ColorMode.ColorCanvas;
}
}
}

24
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Core/LocationEnum.cs

@ -0,0 +1,24 @@
/*************************************************************************************
Extended WPF Toolkit
Copyright (C) 2007-2013 Xceed Software Inc.
This program is provided to you under the terms of the Microsoft Public
License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license
For more features, controls, and fast professional support,
pick up the Plus Edition at http://xceed.com/wpf_toolkit
Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids
***********************************************************************************/
namespace Xceed.Wpf.Toolkit.Core
{
public enum Location
{
Left,
Right
}
}

3
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Core/Utilities/CalculatorUtilities.cs

@ -78,6 +78,9 @@ namespace Xceed.Wpf.Toolkit.Core.Utilities
public static Button FindButtonByCalculatorButtonType( DependencyObject parent, Calculator.CalculatorButtonType type ) public static Button FindButtonByCalculatorButtonType( DependencyObject parent, Calculator.CalculatorButtonType type )
{ {
if( parent == null )
return null;
for( int i = 0; i < VisualTreeHelper.GetChildrenCount( parent ); i++ ) for( int i = 0; i < VisualTreeHelper.GetChildrenCount( parent ); i++ )
{ {
var child = VisualTreeHelper.GetChild( parent, i ); var child = VisualTreeHelper.GetChild( parent, i );

6
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/DateTimePicker/Implementation/DateTimePicker.cs

@ -275,7 +275,7 @@ namespace Xceed.Wpf.Toolkit
{ {
Mouse.Capture( null ); Mouse.Capture( null );
if( AutoCloseCalendar && ( _calendar.DisplayMode == CalendarMode.Month ) ) if( AutoCloseCalendar && (_calendar != null) && ( _calendar.DisplayMode == CalendarMode.Month ) )
{ {
ClosePopup( true ); ClosePopup( true );
} }
@ -299,8 +299,7 @@ namespace Xceed.Wpf.Toolkit
//If we change any part of the datetime without //If we change any part of the datetime without
//using the calendar when the actual date is temporary, //using the calendar when the actual date is temporary,
//clear the temporary value. //clear the temporary value.
if( _calendarTemporaryDateTime != null && if( (_calendar != null) && (_calendarTemporaryDateTime != null) && (newValue != _calendarTemporaryDateTime ))
newValue != _calendarTemporaryDateTime )
{ {
_calendarTemporaryDateTime = null; _calendarTemporaryDateTime = null;
_calendarIntendedDateTime = null; _calendarIntendedDateTime = null;
@ -352,6 +351,7 @@ namespace Xceed.Wpf.Toolkit
//Do not close the Calendar if the call is handled //Do not close the Calendar if the call is handled
//by the TimePicker inside the DateTimePicker template //by the TimePicker inside the DateTimePicker template
if( IsOpen if( IsOpen
&& ( _timePicker != null)
&& _timePicker.IsKeyboardFocusWithin && _timePicker.IsKeyboardFocusWithin
&& ( _timePicker.IsOpen || e.Handled ) ) && ( _timePicker.IsOpen || e.Handled ) )
return; return;

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

@ -193,6 +193,11 @@ namespace Xceed.Wpf.Toolkit
UpdateValueOnEnterKeyProperty.OverrideMetadata( typeof( DateTimeUpDown ), new FrameworkPropertyMetadata( true ) ); UpdateValueOnEnterKeyProperty.OverrideMetadata( typeof( DateTimeUpDown ), new FrameworkPropertyMetadata( true ) );
} }
public DateTimeUpDown()
{
this.Loaded += this.DateTimeUpDown_Loaded;
}
#endregion //Constructors #endregion //Constructors
#region Base Class Overrides #region Base Class Overrides
@ -432,6 +437,7 @@ namespace Xceed.Wpf.Toolkit
{ {
IsReadOnly = true, IsReadOnly = true,
Type = DateTimePart.DayName, Type = DateTimePart.DayName,
Length = elementLength,
Format = d Format = d
}; };
else else
@ -439,6 +445,7 @@ namespace Xceed.Wpf.Toolkit
{ {
IsReadOnly = false, IsReadOnly = false,
Type = DateTimePart.Day, Type = DateTimePart.Day,
Length = elementLength,
Format = d Format = d
}; };
break; break;
@ -454,6 +461,7 @@ namespace Xceed.Wpf.Toolkit
{ {
IsReadOnly = false, IsReadOnly = false,
Type = DateTimePart.Millisecond, Type = DateTimePart.Millisecond,
Length = elementLength,
Format = f Format = f
}; };
break; break;
@ -468,6 +476,7 @@ namespace Xceed.Wpf.Toolkit
{ {
IsReadOnly = false, IsReadOnly = false,
Type = DateTimePart.Hour12, Type = DateTimePart.Hour12,
Length = elementLength,
Format = h Format = h
}; };
break; break;
@ -482,6 +491,7 @@ namespace Xceed.Wpf.Toolkit
{ {
IsReadOnly = false, IsReadOnly = false,
Type = DateTimePart.Hour24, Type = DateTimePart.Hour24,
Length = elementLength,
Format = H Format = H
}; };
break; break;
@ -497,6 +507,7 @@ namespace Xceed.Wpf.Toolkit
{ {
IsReadOnly = false, IsReadOnly = false,
Type = DateTimePart.MonthName, Type = DateTimePart.MonthName,
Length = elementLength,
Format = M Format = M
}; };
else else
@ -504,6 +515,7 @@ namespace Xceed.Wpf.Toolkit
{ {
IsReadOnly = false, IsReadOnly = false,
Type = DateTimePart.Month, Type = DateTimePart.Month,
Length = elementLength,
Format = M Format = M
}; };
break; break;
@ -519,6 +531,7 @@ namespace Xceed.Wpf.Toolkit
{ {
IsReadOnly = false, IsReadOnly = false,
Type = DateTimePart.Second, Type = DateTimePart.Second,
Length = elementLength,
Format = s Format = s
}; };
break; break;
@ -534,6 +547,7 @@ namespace Xceed.Wpf.Toolkit
{ {
IsReadOnly = false, IsReadOnly = false,
Type = DateTimePart.AmPmDesignator, Type = DateTimePart.AmPmDesignator,
Length = elementLength,
Format = t Format = t
}; };
break; break;
@ -549,6 +563,7 @@ namespace Xceed.Wpf.Toolkit
{ {
IsReadOnly = false, IsReadOnly = false,
Type = DateTimePart.Year, Type = DateTimePart.Year,
Length = elementLength,
Format = y Format = y
}; };
break; break;
@ -578,6 +593,7 @@ namespace Xceed.Wpf.Toolkit
{ {
IsReadOnly = true, IsReadOnly = true,
Type = DateTimePart.Period, Type = DateTimePart.Period,
Length = elementLength,
Format = format.Substring( 0, elementLength ) Format = format.Substring( 0, elementLength )
}; };
break; break;
@ -592,6 +608,7 @@ namespace Xceed.Wpf.Toolkit
{ {
IsReadOnly = false, IsReadOnly = false,
Type = DateTimePart.Minute, Type = DateTimePart.Minute,
Length = elementLength,
Format = m Format = m
}; };
break; break;
@ -606,6 +623,7 @@ namespace Xceed.Wpf.Toolkit
{ {
IsReadOnly = true, IsReadOnly = true,
Type = DateTimePart.TimeZone, Type = DateTimePart.TimeZone,
Length = elementLength,
Format = z Format = z
}; };
break; break;
@ -645,6 +663,11 @@ namespace Xceed.Wpf.Toolkit
return (value1.Value > value2.Value); return (value1.Value > value2.Value);
} }
protected override void OnUpdateValueOnEnterKeyChanged( bool oldValue, bool newValue )
{
throw new NotSupportedException( "DateTimeUpDown controls do not support modifying UpdateValueOnEnterKey property." );
}
#endregion //Base Class Overrides #endregion //Base Class Overrides
#region Methods #region Methods
@ -942,5 +965,17 @@ namespace Xceed.Wpf.Toolkit
} }
#endregion //Methods #endregion //Methods
#region Event Handlers
private void DateTimeUpDown_Loaded( object sender, RoutedEventArgs e )
{
if( ( this.Format == DateTimeFormat.Custom ) && ( string.IsNullOrEmpty( this.FormatString ) ) )
{
throw new InvalidOperationException( "A FormatString is necessary when Format is set to Custom." );
}
}
#endregion
} }
} }

60
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/DropDownButton/Implementation/DropDownButton.cs

@ -47,12 +47,16 @@ namespace Xceed.Wpf.Toolkit
static DropDownButton() static DropDownButton()
{ {
DefaultStyleKeyProperty.OverrideMetadata( typeof( DropDownButton ), new FrameworkPropertyMetadata( typeof( DropDownButton ) ) ); DefaultStyleKeyProperty.OverrideMetadata( typeof( DropDownButton ), new FrameworkPropertyMetadata( typeof( DropDownButton ) ) );
EventManager.RegisterClassHandler( typeof( DropDownButton ), AccessKeyManager.AccessKeyPressedEvent, new AccessKeyPressedEventHandler( OnAccessKeyPressed ) );
} }
public DropDownButton() public DropDownButton()
{ {
Keyboard.AddKeyDownHandler( this, OnKeyDown ); Keyboard.AddKeyDownHandler( this, OnKeyDown );
Mouse.AddPreviewMouseDownOutsideCapturedElementHandler( this, OnMouseDownOutsideCapturedElement ); Mouse.AddPreviewMouseDownOutsideCapturedElementHandler( this, OnMouseDownOutsideCapturedElement );
//case 166525 : Do no inherit an implicit style of Button
this.InheritanceBehavior = InheritanceBehavior.SkipToThemeNow;
} }
#endregion //Constructors #endregion //Constructors
@ -125,6 +129,42 @@ namespace Xceed.Wpf.Toolkit
#endregion #endregion
#region IsDefault
public static readonly DependencyProperty IsDefaultProperty = DependencyProperty.Register( "IsDefault", typeof( bool ), typeof( DropDownButton ), new UIPropertyMetadata( false, OnIsDefaultChanged ) );
public bool IsDefault
{
get
{
return ( bool )GetValue( IsDefaultProperty );
}
set
{
SetValue( IsDefaultProperty, value );
}
}
private static void OnIsDefaultChanged( DependencyObject o, DependencyPropertyChangedEventArgs e )
{
var dropDownButton = o as DropDownButton;
if( dropDownButton != null )
dropDownButton.OnIsDefaultChanged( ( bool )e.OldValue, ( bool )e.NewValue );
}
protected virtual void OnIsDefaultChanged( bool oldValue, bool newValue )
{
if( newValue )
{
AccessKeyManager.Register( "\r", this );
}
else
{
AccessKeyManager.Unregister( "\r", this );
}
}
#endregion //IsDefault
#region IsOpen #region IsOpen
public static readonly DependencyProperty IsOpenProperty = DependencyProperty.Register( "IsOpen", typeof( bool ), typeof( DropDownButton ), new UIPropertyMetadata( false, OnIsOpenChanged ) ); public static readonly DependencyProperty IsOpenProperty = DependencyProperty.Register( "IsOpen", typeof( bool ), typeof( DropDownButton ), new UIPropertyMetadata( false, OnIsOpenChanged ) );
@ -225,6 +265,18 @@ namespace Xceed.Wpf.Toolkit
} }
} }
protected override void OnAccessKey( AccessKeyEventArgs e )
{
if( e.IsMultiple )
{
base.OnAccessKey( e );
}
else
{
this.OnClick();
}
}
#endregion //Base Class Overrides #endregion //Base Class Overrides
#region Events #region Events
@ -272,6 +324,14 @@ namespace Xceed.Wpf.Toolkit
#region Event Handlers #region Event Handlers
private static void OnAccessKeyPressed( object sender, AccessKeyPressedEventArgs e )
{
if( !e.Handled && ( e.Scope == null ) && ( e.Target == null ) )
{
e.Target = sender as DropDownButton;
}
}
private void OnKeyDown( object sender, KeyEventArgs e ) private void OnKeyDown( object sender, KeyEventArgs e )
{ {
if( !IsOpen ) if( !IsOpen )

181
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/IconButton/Implementation/IconButton.cs

@ -0,0 +1,181 @@
/*************************************************************************************
Extended WPF Toolkit
Copyright (C) 2007-2013 Xceed Software Inc.
This program is provided to you under the terms of the Microsoft Public
License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license
For more features, controls, and fast professional support,
pick up the Plus Edition at http://xceed.com/wpf_toolkit
Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids
***********************************************************************************/
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
namespace Xceed.Wpf.Toolkit
{
public class IconButton : Button
{
#region Constructors
static IconButton()
{
DefaultStyleKeyProperty.OverrideMetadata( typeof( IconButton ), new FrameworkPropertyMetadata( typeof( IconButton ) ) );
}
#endregion //Constructors
#region Properties
#region Icon
public static readonly DependencyProperty IconProperty = DependencyProperty.Register( "Icon", typeof( Image ), typeof( IconButton ), new FrameworkPropertyMetadata( null ) );
public Image Icon
{
get
{
return ( Image )this.GetValue( IconButton.IconProperty );
}
set
{
this.SetValue( IconButton.IconProperty, value );
}
}
#endregion //Icon
#region IconLocation
public static readonly DependencyProperty IconLocationProperty = DependencyProperty.Register( "IconLocation", typeof( Location ),
typeof( IconButton ), new FrameworkPropertyMetadata( Location.Left ) );
public Location IconLocation
{
get
{
return ( Location )this.GetValue( IconButton.IconLocationProperty );
}
set
{
this.SetValue( IconButton.IconLocationProperty, value );
}
}
#endregion //IconLocation
#region MouseOverBackground
public static readonly DependencyProperty MouseOverBackgroundProperty = DependencyProperty.Register( "MouseOverBackground", typeof( Brush ), typeof( IconButton ), new FrameworkPropertyMetadata( null ) );
public Brush MouseOverBackground
{
get
{
return ( Brush )this.GetValue( IconButton.MouseOverBackgroundProperty );
}
set
{
this.SetValue( IconButton.MouseOverBackgroundProperty, value );
}
}
#endregion //MouseOverBackground
#region MouseOverBorderBrush
public static readonly DependencyProperty MouseOverBorderBrushProperty = DependencyProperty.Register( "MouseOverBorderBrush", typeof( Brush ), typeof( IconButton ), new FrameworkPropertyMetadata( null ) );
public Brush MouseOverBorderBrush
{
get
{
return ( Brush )this.GetValue( IconButton.MouseOverBorderBrushProperty );
}
set
{
this.SetValue( IconButton.MouseOverBorderBrushProperty, value );
}
}
#endregion //MouseOverBorderBrush
#region MouseOverForeground
public static readonly DependencyProperty MouseOverForegroundProperty = DependencyProperty.Register( "MouseOverForeground", typeof( Brush ), typeof( IconButton ), new FrameworkPropertyMetadata( null ) );
public Brush MouseOverForeground
{
get
{
return ( Brush )this.GetValue( IconButton.MouseOverForegroundProperty );
}
set
{
this.SetValue( IconButton.MouseOverForegroundProperty, value );
}
}
#endregion //MouseOverForeground
#region MousePressedBackground
public static readonly DependencyProperty MousePressedBackgroundProperty = DependencyProperty.Register( "MousePressedBackground", typeof( Brush ), typeof( IconButton ), new FrameworkPropertyMetadata( null ) );
public Brush MousePressedBackground
{
get
{
return ( Brush )this.GetValue( IconButton.MousePressedBackgroundProperty );
}
set
{
this.SetValue( IconButton.MousePressedBackgroundProperty, value );
}
}
#endregion //MousePressedBackground
#region MousePressedBorderBrush
public static readonly DependencyProperty MousePressedBorderBrushProperty = DependencyProperty.Register( "MousePressedBorderBrush", typeof( Brush ), typeof( IconButton ), new FrameworkPropertyMetadata( null ) );
public Brush MousePressedBorderBrush
{
get
{
return ( Brush )this.GetValue( IconButton.MousePressedBorderBrushProperty );
}
set
{
this.SetValue( IconButton.MousePressedBorderBrushProperty, value );
}
}
#endregion //MousePressedBorderBrush
#region MousePressedForeground
public static readonly DependencyProperty MousePressedForegroundProperty = DependencyProperty.Register( "MousePressedForeground", typeof( Brush ), typeof( IconButton ), new FrameworkPropertyMetadata( null ) );
public Brush MousePressedForeground
{
get
{
return ( Brush )this.GetValue( IconButton.MousePressedForegroundProperty );
}
set
{
this.SetValue( IconButton.MousePressedForegroundProperty, value );
}
}
#endregion //MousePressedForeground
#endregion
}
}

166
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/IconButton/Themes/Aero2.NormalColor.xaml

@ -0,0 +1,166 @@
<!--***********************************************************************************
Extended WPF Toolkit
Copyright (C) 2007-2013 Xceed Software Inc.
This program is provided to you under the terms of the Microsoft Public
License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license
For more features, controls, and fast professional support,
pick up the Plus Edition at http://xceed.com/wpf_toolkit
Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids
**********************************************************************************-->
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Xceed.Wpf.Toolkit"
xmlns:themes="clr-namespace:Xceed.Wpf.Toolkit.Themes">
<!-- =============================================================================== -->
<!-- IconButton Style -->
<!-- =============================================================================== -->
<Style x:Key="FocusVisual">
<Setter Property="Control.Template">
<Setter.Value>
<ControlTemplate>
<Rectangle Margin="2"
SnapsToDevicePixels="true"
Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"
StrokeThickness="1"
StrokeDashArray="1 2" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type local:IconButton}">
<Setter Property="FocusVisualStyle"
Value="{StaticResource FocusVisual}" />
<Setter Property="Background"
Value="{DynamicResource {x:Static themes:ResourceKeys.ButtonNormalBackgroundKey}}" />
<Setter Property="BorderBrush"
Value="{DynamicResource {x:Static themes:ResourceKeys.ButtonNormalOuterBorderKey}}" />
<Setter Property="Foreground"
Value="Black" />
<Setter Property="BorderThickness"
Value="1" />
<Setter Property="MouseOverForeground"
Value="Black" />
<Setter Property="MousePressedForeground"
Value="Black" />
<Setter Property="MouseOverBackground"
Value="{DynamicResource {x:Static themes:ResourceKeys.ButtonMouseOverBackgroundKey}}" />
<Setter Property="MousePressedBackground"
Value="{DynamicResource {x:Static themes:ResourceKeys.ButtonPressedBackgroundKey}}" />
<Setter Property="MouseOverBorderBrush"
Value="{DynamicResource {x:Static themes:ResourceKeys.ButtonMouseOverOuterBorderKey}}" />
<Setter Property="MousePressedBorderBrush"
Value="{DynamicResource {x:Static themes:ResourceKeys.ButtonPressedOuterBorderKey}}" />
<Setter Property="HorizontalContentAlignment"
Value="Center" />
<Setter Property="VerticalContentAlignment"
Value="Center" />
<Setter Property="Padding"
Value="1" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type local:IconButton}">
<Border x:Name="defaultBorder"
BorderThickness="1"
BorderBrush="Transparent">
<Border x:Name="border"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Background="{TemplateBinding Background}"
SnapsToDevicePixels="True">
<Grid VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Margin="{TemplateBinding Padding}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
<Grid.ColumnDefinitions>
<ColumnDefinition x:Name="firstColumn"
Width="Auto" />
<ColumnDefinition x:Name="secondColumn"
Width="*" />
</Grid.ColumnDefinitions>
<ContentControl x:Name="icon"
Content="{TemplateBinding Icon}"
VerticalAlignment="Center" />
<ContentPresenter x:Name="contentPresenter"
Grid.Column="1"
Focusable="False"
RecognizesAccessKey="True"
VerticalAlignment="Center" />
</Grid>
</Border>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsDefaulted"
Value="True">
<Setter Property="BorderBrush"
TargetName="defaultBorder"
Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" />
</Trigger>
<Trigger Property="IsMouseOver"
Value="True">
<Setter Property="TextElement.Foreground"
TargetName="contentPresenter"
Value="{Binding MouseOverForeground, RelativeSource={RelativeSource TemplatedParent}}" />
<Setter Property="Background"
TargetName="border"
Value="{Binding MouseOverBackground, RelativeSource={RelativeSource TemplatedParent}}" />
<Setter Property="BorderBrush"
TargetName="border"
Value="{Binding MouseOverBorderBrush, RelativeSource={RelativeSource TemplatedParent}}" />
</Trigger>
<Trigger Property="IsPressed"
Value="True">
<Setter Property="TextElement.Foreground"
TargetName="contentPresenter"
Value="{Binding MousePressedForeground, RelativeSource={RelativeSource TemplatedParent}}" />
<Setter Property="Background"
TargetName="border"
Value="{Binding MousePressedBackground, RelativeSource={RelativeSource TemplatedParent}}" />
<Setter Property="BorderBrush"
TargetName="border"
Value="{Binding MousePressedBorderBrush, RelativeSource={RelativeSource TemplatedParent}}" />
</Trigger>
<Trigger Property="IsEnabled"
Value="False">
<Setter TargetName="border"
Property="BorderBrush"
Value="{DynamicResource {x:Static themes:ResourceKeys.ButtonDisabledOuterBorderKey}}" />
<Setter TargetName="border"
Property="Background"
Value="{DynamicResource {x:Static themes:ResourceKeys.ControlDisabledBackgroundKey}}" />
<Setter Property="TextElement.Foreground"
TargetName="contentPresenter"
Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
</Trigger>
<Trigger Property="IconLocation"
Value="Right">
<Setter Property="Width"
Value="*"
TargetName="firstColumn" />
<Setter Property="Width"
Value="Auto"
TargetName="secondColumn" />
<Setter Property="Grid.Column"
Value="1"
TargetName="icon" />
<Setter Property="Grid.Column"
Value="0"
TargetName="contentPresenter" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>

166
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/IconButton/Themes/Generic.xaml

@ -0,0 +1,166 @@
<!--***********************************************************************************
Extended WPF Toolkit
Copyright (C) 2007-2013 Xceed Software Inc.
This program is provided to you under the terms of the Microsoft Public
License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license
For more features, controls, and fast professional support,
pick up the Plus Edition at http://xceed.com/wpf_toolkit
Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids
**********************************************************************************-->
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Xceed.Wpf.Toolkit"
xmlns:themes="clr-namespace:Xceed.Wpf.Toolkit.Themes">
<!-- =============================================================================== -->
<!-- IconButton Style -->
<!-- =============================================================================== -->
<Style x:Key="FocusVisual">
<Setter Property="Control.Template">
<Setter.Value>
<ControlTemplate>
<Rectangle Margin="2"
SnapsToDevicePixels="true"
Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"
StrokeThickness="1"
StrokeDashArray="1 2" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type local:IconButton}">
<Setter Property="FocusVisualStyle"
Value="{StaticResource FocusVisual}" />
<Setter Property="Background"
Value="{DynamicResource {x:Static themes:ResourceKeys.ButtonNormalBackgroundKey}}" />
<Setter Property="BorderBrush"
Value="{DynamicResource {x:Static themes:ResourceKeys.ButtonNormalOuterBorderKey}}" />
<Setter Property="Foreground"
Value="Black" />
<Setter Property="BorderThickness"
Value="1" />
<Setter Property="MouseOverForeground"
Value="Black" />
<Setter Property="MousePressedForeground"
Value="Black" />
<Setter Property="MouseOverBackground"
Value="{DynamicResource {x:Static themes:ResourceKeys.ButtonMouseOverBackgroundKey}}" />
<Setter Property="MousePressedBackground"
Value="{DynamicResource {x:Static themes:ResourceKeys.ButtonPressedBackgroundKey}}" />
<Setter Property="MouseOverBorderBrush"
Value="{DynamicResource {x:Static themes:ResourceKeys.ButtonMouseOverOuterBorderKey}}" />
<Setter Property="MousePressedBorderBrush"
Value="{DynamicResource {x:Static themes:ResourceKeys.ButtonPressedOuterBorderKey}}" />
<Setter Property="HorizontalContentAlignment"
Value="Center" />
<Setter Property="VerticalContentAlignment"
Value="Center" />
<Setter Property="Padding"
Value="1" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type local:IconButton}">
<Border x:Name="defaultBorder"
BorderThickness="1"
BorderBrush="Transparent">
<Border x:Name="border"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Background="{TemplateBinding Background}"
SnapsToDevicePixels="True">
<Grid VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Margin="{TemplateBinding Padding}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
<Grid.ColumnDefinitions>
<ColumnDefinition x:Name="firstColumn"
Width="Auto" />
<ColumnDefinition x:Name="secondColumn"
Width="*" />
</Grid.ColumnDefinitions>
<ContentControl x:Name="icon"
Content="{TemplateBinding Icon}"
VerticalAlignment="Center" />
<ContentPresenter x:Name="contentPresenter"
Grid.Column="1"
Focusable="False"
RecognizesAccessKey="True"
VerticalAlignment="Center" />
</Grid>
</Border>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsDefaulted"
Value="True">
<Setter Property="BorderBrush"
TargetName="defaultBorder"
Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" />
</Trigger>
<Trigger Property="IsMouseOver"
Value="True">
<Setter Property="TextElement.Foreground"
TargetName="contentPresenter"
Value="{Binding MouseOverForeground, RelativeSource={RelativeSource TemplatedParent}}" />
<Setter Property="Background"
TargetName="border"
Value="{Binding MouseOverBackground, RelativeSource={RelativeSource TemplatedParent}}" />
<Setter Property="BorderBrush"
TargetName="border"
Value="{Binding MouseOverBorderBrush, RelativeSource={RelativeSource TemplatedParent}}" />
</Trigger>
<Trigger Property="IsPressed"
Value="True">
<Setter Property="TextElement.Foreground"
TargetName="contentPresenter"
Value="{Binding MousePressedForeground, RelativeSource={RelativeSource TemplatedParent}}" />
<Setter Property="Background"
TargetName="border"
Value="{Binding MousePressedBackground, RelativeSource={RelativeSource TemplatedParent}}" />
<Setter Property="BorderBrush"
TargetName="border"
Value="{Binding MousePressedBorderBrush, RelativeSource={RelativeSource TemplatedParent}}" />
</Trigger>
<Trigger Property="IsEnabled"
Value="False">
<Setter TargetName="border"
Property="BorderBrush"
Value="{DynamicResource {x:Static themes:ResourceKeys.ButtonDisabledOuterBorderKey}}" />
<Setter TargetName="border"
Property="Background"
Value="{DynamicResource {x:Static themes:ResourceKeys.ControlDisabledBackgroundKey}}" />
<Setter Property="TextElement.Foreground"
TargetName="contentPresenter"
Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
</Trigger>
<Trigger Property="IconLocation"
Value="Right">
<Setter Property="Width"
Value="*"
TargetName="firstColumn" />
<Setter Property="Width"
Value="Auto"
TargetName="secondColumn" />
<Setter Property="Grid.Column"
Value="1"
TargetName="icon" />
<Setter Property="Grid.Column"
Value="0"
TargetName="contentPresenter" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>

6
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Magnifier/Implementation/MagnifierAdorner.cs

@ -27,6 +27,7 @@ namespace Xceed.Wpf.Toolkit
private Magnifier _magnifier; private Magnifier _magnifier;
private Point _currentMousePosition; private Point _currentMousePosition;
private double _currentZoomFactor;
#endregion #endregion
@ -36,6 +37,7 @@ namespace Xceed.Wpf.Toolkit
: base( element ) : base( element )
{ {
_magnifier = magnifier; _magnifier = magnifier;
_currentZoomFactor = _magnifier.ZoomFactor;
UpdateViewBox(); UpdateViewBox();
AddVisualChild( _magnifier ); AddVisualChild( _magnifier );
@ -43,6 +45,7 @@ namespace Xceed.Wpf.Toolkit
Unloaded += ( s, e ) => InputManager.Current.PostProcessInput -= OnProcessInput; Unloaded += ( s, e ) => InputManager.Current.PostProcessInput -= OnProcessInput;
} }
#endregion #endregion
#region Private/Internal methods #region Private/Internal methods
@ -51,10 +54,11 @@ namespace Xceed.Wpf.Toolkit
{ {
Point pt = Mouse.GetPosition( this ); Point pt = Mouse.GetPosition( this );
if( _currentMousePosition == pt ) if( (_currentMousePosition == pt) && (_magnifier.ZoomFactor == _currentZoomFactor) )
return; return;
_currentMousePosition = pt; _currentMousePosition = pt;
_currentZoomFactor = _magnifier.ZoomFactor;
UpdateViewBox(); UpdateViewBox();
InvalidateArrange(); InvalidateArrange();
} }

43
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/MaskedTextBox/Implementation/MaskedTextBox.cs

@ -842,14 +842,23 @@ namespace Xceed.Wpf.Toolkit
int notUsed; int notUsed;
MaskedTextResultHint hint; MaskedTextResultHint hint;
if( provider.Set( text, out notUsed, out hint ) ) //0 – Digit zero to 9[ Required ]
{ //9 – Digit 0 – 9[ Optional ]
coercedText = this.GetFormattedString( provider ); //A – Alpha Numeric. [Required]
//a – Alpha Numeric. [Optional]
//L – Letters a-z, A-Z[ Required ]
//? – Letters a-z, A-Z[ Optional ]
//C – Any non-control character [Optional]
//< - When first, all following characters are in lower case.
//> - When first, all following characters are in upper case.
if( provider.Set( text, out notUsed, out hint ) || provider.Mask.StartsWith( ">" ) || provider.Mask.StartsWith( "<" ) )
{
coercedText = this.GetFormattedString( provider, text );
} }
else else
{ {
// Coerce the text to remain the same. // Coerce the text to remain the same.
coercedText = this.GetFormattedString( m_maskedTextProvider ); coercedText = this.GetFormattedString( m_maskedTextProvider, text );
// The TextPropertyChangedCallback won't be called. // The TextPropertyChangedCallback won't be called.
// Therefore, we must sync the maskedTextProvider. // Therefore, we must sync the maskedTextProvider.
@ -864,12 +873,12 @@ namespace Xceed.Wpf.Toolkit
if( this.CanReplace( provider, text, 0, m_maskedTextProvider.Length, this.RejectInputOnFirstFailure, out caretIndex ) ) if( this.CanReplace( provider, text, 0, m_maskedTextProvider.Length, this.RejectInputOnFirstFailure, out caretIndex ) )
{ {
coercedText = this.GetFormattedString( provider ); coercedText = this.GetFormattedString( provider, text );
} }
else else
{ {
// Coerce the text to remain the same. // Coerce the text to remain the same.
coercedText = this.GetFormattedString( m_maskedTextProvider ); coercedText = this.GetFormattedString( m_maskedTextProvider, text );
// The TextPropertyChangedCallback won't be called. // The TextPropertyChangedCallback won't be called.
// Therefore, we must sync the maskedTextProvider. // Therefore, we must sync the maskedTextProvider.
@ -896,6 +905,12 @@ namespace Xceed.Wpf.Toolkit
{ {
m_maskedTextProvider.Set( newText ); m_maskedTextProvider.Set( newText );
if( m_maskedTextProvider.Mask.StartsWith( ">" ) || m_maskedTextProvider.Mask.StartsWith( "<" ) )
{
this.CaretIndex = newText.Length;
}
else
{
int caretIndex = m_maskedTextProvider.FindUnassignedEditPositionFrom( 0, true ); int caretIndex = m_maskedTextProvider.FindUnassignedEditPositionFrom( 0, true );
if( caretIndex == -1 ) if( caretIndex == -1 )
@ -905,6 +920,7 @@ namespace Xceed.Wpf.Toolkit
} }
} }
} }
}
// m_maskedTextProvider can be null in the designer. With WPF 3.5 SP1, sometimes, // m_maskedTextProvider can be null in the designer. With WPF 3.5 SP1, sometimes,
// TextChanged will be triggered before OnInitialized is called. // TextChanged will be triggered before OnInitialized is called.
@ -1441,7 +1457,9 @@ namespace Xceed.Wpf.Toolkit
internal override bool GetIsEditTextEmpty() internal override bool GetIsEditTextEmpty()
{ {
return MaskedTextProvider != null && (MaskedTextProvider.AssignedEditPositionCount == 0 ); if( !m_maskIsNull )
return ( this.MaskedTextProvider.AssignedEditPositionCount == 0 );
return true;
} }
#endregion INTERNAL PROPERTIES #endregion INTERNAL PROPERTIES
@ -1453,7 +1471,7 @@ namespace Xceed.Wpf.Toolkit
if( m_maskIsNull ) if( m_maskIsNull )
return base.GetCurrentText(); return base.GetCurrentText();
string displayText = this.GetFormattedString( m_maskedTextProvider ); string displayText = this.GetFormattedString( m_maskedTextProvider, this.Text );
return displayText; return displayText;
} }
@ -1889,9 +1907,14 @@ namespace Xceed.Wpf.Toolkit
return MaskedTextBox.GetRawText( m_maskedTextProvider ); return MaskedTextBox.GetRawText( m_maskedTextProvider );
} }
private string GetFormattedString( MaskedTextProvider provider ) private string GetFormattedString( MaskedTextProvider provider, string text )
{ {
System.Diagnostics.Debug.Assert( provider.EditPositionCount > 0 ); if( provider.Mask.StartsWith( ">" ) )
return text.ToUpper();
if( provider.Mask.StartsWith( "<" ) )
return text.ToLower();
//System.Diagnostics.Debug.Assert( provider.EditPositionCount > 0 );
bool includePrompt = ( this.IsReadOnly ) ? false : ( !this.HidePromptOnLeave || this.IsFocused ); bool includePrompt = ( this.IsReadOnly ) ? false : ( !this.HidePromptOnLeave || this.IsFocused );

8
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/MultiLineTextEditor/Implementation/MultiLineTextEditor.cs

@ -96,9 +96,12 @@ namespace Xceed.Wpf.Toolkit
} }
protected virtual void OnIsOpenChanged( bool oldValue, bool newValue ) protected virtual void OnIsOpenChanged( bool oldValue, bool newValue )
{
if( _textBox != null )
{ {
// Focus the content of the popup, after its loaded // Focus the content of the popup, after its loaded
Dispatcher.BeginInvoke(new Action(()=>_textBox.Focus()), DispatcherPriority.Background); Dispatcher.BeginInvoke( new Action( () => _textBox.Focus() ), DispatcherPriority.Background );
}
} }
#endregion //IsOpen #endregion //IsOpen
@ -280,8 +283,11 @@ namespace Xceed.Wpf.Toolkit
IsOpen = false; IsOpen = false;
ReleaseMouseCapture(); ReleaseMouseCapture();
if( _toggleButton != null )
{
_toggleButton.Focus(); _toggleButton.Focus();
} }
}
#endregion //Methods #endregion //Methods
} }

19
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/NumericUpDown/Implementation/NumericUpDown.cs

@ -144,25 +144,6 @@ namespace Xceed.Wpf.Toolkit
#endregion #endregion
#region SelectAllOnGotFocus (Obsolete)
[Obsolete( "This property is obsolete and should no longer be used. Use NumericUpDown.AutoSelectBehavior instead." )]
public static readonly DependencyProperty SelectAllOnGotFocusProperty = DependencyProperty.Register( "SelectAllOnGotFocus", typeof( bool ), typeof( NumericUpDown<T> ), new PropertyMetadata( true ) );
[Obsolete( "This property is obsolete and should no longer be used. Use NumericUpDown.AutoSelectBehavior instead." )]
public bool SelectAllOnGotFocus
{
get
{
return ( bool )GetValue( SelectAllOnGotFocusProperty );
}
set
{
SetValue( SelectAllOnGotFocusProperty, value );
}
}
#endregion //SelectAllOnGotFocus
#endregion //Properties #endregion //Properties
#region Methods #region Methods

1
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/NumericUpDown/Themes/Aero2.NormalColor.xaml

@ -79,7 +79,6 @@
MinWidth="20" MinWidth="20"
AcceptsReturn="False" AcceptsReturn="False"
Padding="{TemplateBinding Padding}" Padding="{TemplateBinding Padding}"
SelectAllOnGotFocus="{Binding SelectAllOnGotFocus, RelativeSource={RelativeSource TemplatedParent}}"
AutoSelectBehavior="{Binding AutoSelectBehavior, RelativeSource={RelativeSource TemplatedParent}}" AutoSelectBehavior="{Binding AutoSelectBehavior, RelativeSource={RelativeSource TemplatedParent}}"
AutoMoveFocus="{Binding AutoMoveFocus, RelativeSource={RelativeSource TemplatedParent}}" AutoMoveFocus="{Binding AutoMoveFocus, RelativeSource={RelativeSource TemplatedParent}}"
TextAlignment="{Binding TextAlignment, RelativeSource={RelativeSource TemplatedParent}}" TextAlignment="{Binding TextAlignment, RelativeSource={RelativeSource TemplatedParent}}"

1
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/NumericUpDown/Themes/Generic.xaml

@ -66,7 +66,6 @@
MinWidth="20" MinWidth="20"
AcceptsReturn="False" AcceptsReturn="False"
Padding="{TemplateBinding Padding}" Padding="{TemplateBinding Padding}"
SelectAllOnGotFocus="{Binding SelectAllOnGotFocus, RelativeSource={RelativeSource TemplatedParent}}"
AutoSelectBehavior="{Binding AutoSelectBehavior, RelativeSource={RelativeSource TemplatedParent}}" AutoSelectBehavior="{Binding AutoSelectBehavior, RelativeSource={RelativeSource TemplatedParent}}"
AutoMoveFocus="{Binding AutoMoveFocus, RelativeSource={RelativeSource TemplatedParent}}" AutoMoveFocus="{Binding AutoMoveFocus, RelativeSource={RelativeSource TemplatedParent}}"
TextAlignment="{Binding TextAlignment, RelativeSource={RelativeSource TemplatedParent}}" TextAlignment="{Binding TextAlignment, RelativeSource={RelativeSource TemplatedParent}}"

15
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Primitives/DateTimeUpDownBase.cs

@ -21,6 +21,7 @@ using System.Text;
using System.Windows; using System.Windows;
using System.Windows.Data; using System.Windows.Data;
using System.Windows.Input; using System.Windows.Input;
using System.Windows.Threading;
using Xceed.Wpf.Toolkit.Primitives; using Xceed.Wpf.Toolkit.Primitives;
namespace Xceed.Wpf.Toolkit.Primitives namespace Xceed.Wpf.Toolkit.Primitives
@ -218,7 +219,19 @@ namespace Xceed.Wpf.Toolkit.Primitives
protected virtual void PerformMouseSelection() protected virtual void PerformMouseSelection()
{ {
this.Select( this.GetDateTimeInfo( TextBox.SelectionStart ) ); var dateTimeInfo = this.GetDateTimeInfo( TextBox.SelectionStart );
if( (dateTimeInfo != null) && (dateTimeInfo.Type == DateTimePart.Other) )
{
this.Dispatcher.BeginInvoke( DispatcherPriority.Background, new Action( () =>
{
// Select the next dateTime part
this.Select( this.GetDateTimeInfo( dateTimeInfo.StartPosition + dateTimeInfo.Length ) );
}
) );
return;
}
this.Select( dateTimeInfo );
} }
protected virtual bool IsLowerThan( T value1, T value2 ) protected virtual bool IsLowerThan( T value1, T value2 )

28
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Primitives/UpDownBase.cs

@ -364,9 +364,8 @@ UpDownBase<T> ), new UIPropertyMetadata( true ) );
#region UpdateValueOnEnterKey #region UpdateValueOnEnterKey
public static readonly DependencyProperty UpdateValueOnEnterKeyProperty = DependencyProperty.Register( "UpdateValueOnEnterKey", typeof( bool ), public static readonly DependencyProperty UpdateValueOnEnterKeyProperty = DependencyProperty.Register( "UpdateValueOnEnterKey", typeof( bool ), typeof( UpDownBase<T> ),
new FrameworkPropertyMetadata( false, OnUpdateValueOnEnterKeyChanged ) );
typeof( UpDownBase<T> ), new FrameworkPropertyMetadata( false ) );
public bool UpdateValueOnEnterKey public bool UpdateValueOnEnterKey
{ {
get get
@ -379,15 +378,23 @@ typeof( UpDownBase<T> ), new FrameworkPropertyMetadata( false ) );
} }
} }
#endregion //UpdateValueOnEnterKey private static void OnUpdateValueOnEnterKeyChanged( DependencyObject o, DependencyPropertyChangedEventArgs e )
{
var upDownBase = o as UpDownBase<T>;
if( upDownBase != null )
upDownBase.OnUpdateValueOnEnterKeyChanged( ( bool )e.OldValue, ( bool )e.NewValue );
}
#region Value protected virtual void OnUpdateValueOnEnterKeyChanged( bool oldValue, bool newValue )
{
}
public static readonly DependencyProperty ValueProperty = DependencyProperty.Register( "Value", typeof( T ), typeof( UpDownBase<T> ), new #endregion //UpdateValueOnEnterKey
FrameworkPropertyMetadata( default( T ), FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnValueChanged, OnCoerceValue, false, #region Value
UpdateSourceTrigger.PropertyChanged ) ); public static readonly DependencyProperty ValueProperty = DependencyProperty.Register( "Value", typeof( T ), typeof( UpDownBase<T> ),
new FrameworkPropertyMetadata( default( T ), FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnValueChanged, OnCoerceValue, false, UpdateSourceTrigger.PropertyChanged ) );
public T Value public T Value
{ {
get get
@ -583,11 +590,12 @@ true );
var activeTrigger = this.MouseWheelActiveTrigger; var activeTrigger = this.MouseWheelActiveTrigger;
bool spin = !e.UsingMouseWheel; bool spin = !e.UsingMouseWheel;
spin |= (activeTrigger == MouseWheelActiveTrigger.MouseOver); spin |= (activeTrigger == MouseWheelActiveTrigger.MouseOver);
spin |= (TextBox.IsFocused && (activeTrigger == MouseWheelActiveTrigger.FocusedMouseOver)); spin |= ( (TextBox != null) && TextBox.IsFocused && (activeTrigger == MouseWheelActiveTrigger.FocusedMouseOver));
spin |= (TextBox.IsFocused && (activeTrigger == MouseWheelActiveTrigger.Focused) && (Mouse.Captured is Spinner)); spin |= ( (TextBox != null) && TextBox.IsFocused && (activeTrigger == MouseWheelActiveTrigger.Focused) && (Mouse.Captured is Spinner));
if( spin ) if( spin )
{ {
e.Handled = true;
OnSpin( e ); OnSpin( e );
} }
} }

37
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Primitives/WindowControl.cs

@ -211,7 +211,7 @@ namespace Xceed.Wpf.Toolkit.Primitives
#region IsActive #region IsActive
public static readonly DependencyProperty IsActiveProperty = DependencyProperty.Register( "IsActive", typeof( bool ), typeof( WindowControl ), new UIPropertyMetadata( true, null, OnCoerceIsActive ) ); public static readonly DependencyProperty IsActiveProperty = DependencyProperty.Register( "IsActive", typeof( bool ), typeof( WindowControl ), new UIPropertyMetadata( true, OnIsActiveChanged, OnCoerceIsActive ) );
public bool IsActive public bool IsActive
{ {
get get
@ -233,6 +233,24 @@ namespace Xceed.Wpf.Toolkit.Primitives
return basevalue; return basevalue;
} }
private static void OnIsActiveChanged( DependencyObject obj, DependencyPropertyChangedEventArgs e )
{
var windowControl = obj as WindowControl;
if( windowControl != null )
windowControl.OnIsActiveChanged( ( bool )e.OldValue, ( bool )e.NewValue );
}
protected virtual void OnIsActiveChanged( bool oldValue, bool newValue )
{
if( newValue )
{
if( this.GetType() == typeof( WindowControl ) )
{
this.RaiseEvent( new RoutedEventArgs( ActivatedEvent, this ) );
}
}
}
internal void SetIsActiveInternal( bool isActive ) internal void SetIsActiveInternal( bool isActive )
{ {
_setIsActiveInternal = true; _setIsActiveInternal = true;
@ -631,6 +649,23 @@ namespace Xceed.Wpf.Toolkit.Primitives
#region Events #region Events
#region ActivatedEvent
public static readonly RoutedEvent ActivatedEvent = EventManager.RegisterRoutedEvent( "Activated", RoutingStrategy.Bubble, typeof( RoutedEventHandler ), typeof( WindowControl ) );
public event RoutedEventHandler Activated
{
add
{
AddHandler( ActivatedEvent, value );
}
remove
{
RemoveHandler( ActivatedEvent, value );
}
}
#endregion //ActivatedEvent
#region HeaderMouseLeftButtonClickedEvent #region HeaderMouseLeftButtonClickedEvent
public static readonly RoutedEvent HeaderMouseLeftButtonClickedEvent = EventManager.RegisterRoutedEvent( "HeaderMouseLeftButtonClicked", RoutingStrategy.Bubble, typeof( MouseButtonEventHandler ), typeof( WindowControl ) ); public static readonly RoutedEvent HeaderMouseLeftButtonClickedEvent = EventManager.RegisterRoutedEvent( "HeaderMouseLeftButtonClicked", RoutingStrategy.Bubble, typeof( MouseButtonEventHandler ), typeof( WindowControl ) );

2
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/PropertyGrid/Implementation/CategoryGroupStyleSelector.cs

@ -39,7 +39,7 @@ namespace Xceed.Wpf.Toolkit.PropertyGrid
{ {
var group = item as CollectionViewGroup; var group = item as CollectionViewGroup;
// Category is not "Misc" => use regular ItemGroupStyle // Category is not "Misc" => use regular ItemGroupStyle
if( !group.Name.Equals( CategoryAttribute.Default.Category ) ) if( (group.Name != null) && !group.Name.Equals( CategoryAttribute.Default.Category ) )
return this.ItemGroupStyle; return this.ItemGroupStyle;
// Category is "Misc" // Category is "Misc"

9
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/PropertyGrid/Implementation/ContainerHelperBase.cs

@ -76,8 +76,16 @@ namespace Xceed.Wpf.Toolkit.PropertyGrid
set; set;
} }
internal bool IsCleaning
{
get;
private set;
}
public virtual void ClearHelper() public virtual void ClearHelper()
{ {
this.IsCleaning = true;
var propChange = PropertyContainer as INotifyPropertyChanged; var propChange = PropertyContainer as INotifyPropertyChanged;
if( propChange != null ) if( propChange != null )
{ {
@ -94,6 +102,7 @@ namespace Xceed.Wpf.Toolkit.PropertyGrid
{ {
( ( IItemContainerGenerator )ChildrenItemsControl.ItemContainerGenerator ).RemoveAll(); ( ( IItemContainerGenerator )ChildrenItemsControl.ItemContainerGenerator ).RemoveAll();
} }
this.IsCleaning = false;
} }
public virtual void PrepareChildrenPropertyItem( PropertyItemBase propertyItem, object item ) public virtual void PrepareChildrenPropertyItem( PropertyItemBase propertyItem, object item )

7
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/PropertyGrid/Implementation/Converters/SelectedObjectConverter.cs

@ -76,6 +76,13 @@ namespace Xceed.Wpf.Toolkit.PropertyGrid.Converters
Type newType = value.GetType(); Type newType = value.GetType();
//ICustomTypeProvider is only available in .net 4.5 and over. Use reflection so the .net 4.0 and .net 3.5 still works.
if( newType.GetInterface( "ICustomTypeProvider", true ) != null )
{
var methodInfo = newType.GetMethod( "GetCustomType" );
newType = methodInfo.Invoke( value, null ) as Type;
}
DisplayNameAttribute displayNameAttribute = newType.GetCustomAttributes( false ).OfType<DisplayNameAttribute>().FirstOrDefault(); DisplayNameAttribute displayNameAttribute = newType.GetCustomAttributes( false ).OfType<DisplayNameAttribute>().FirstOrDefault();
return (displayNameAttribute == null) return (displayNameAttribute == null)

19
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/PropertyGrid/Implementation/CustomPropertyItem.cs

@ -38,11 +38,11 @@ namespace Xceed.Wpf.Toolkit.PropertyGrid
internal CustomPropertyItem( bool isPropertyGridCategorized, bool isSortedAlphabetically ) internal CustomPropertyItem( bool isPropertyGridCategorized, bool isSortedAlphabetically )
{ {
this.Init( isPropertyGridCategorized, isSortedAlphabetically ); _isPropertyGridCategorized = isPropertyGridCategorized;
_isSortedAlphabetically = isSortedAlphabetically;
} }
#endregion #endregion
#region Properties #region Properties
@ -166,20 +166,15 @@ namespace Xceed.Wpf.Toolkit.PropertyGrid
protected override void OnEditorChanged( FrameworkElement oldValue, FrameworkElement newValue ) protected override void OnEditorChanged( FrameworkElement oldValue, FrameworkElement newValue )
{ {
if( oldValue != null ) if( oldValue != null )
{
oldValue.DataContext = null; oldValue.DataContext = null;
if( newValue != null )
newValue.DataContext = this;
} }
#endregion //case 166547 : Do not overwrite a custom Editor's DataContext set by the user.
if( ( newValue != null ) && ( newValue.DataContext == null ) )
#region Private Methods
private void Init( bool isPropertyGridCategorized, bool isSortedAlphabetically )
{ {
_isPropertyGridCategorized = isPropertyGridCategorized; newValue.DataContext = this;
_isSortedAlphabetically = isSortedAlphabetically; }
} }
#endregion #endregion

11
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/PropertyGrid/Implementation/DescriptorPropertyDefinition.cs

@ -152,6 +152,11 @@ namespace Xceed.Wpf.Toolkit.PropertyGrid
return ( bool )this.ComputeExpandableAttributeForItem( PropertyDescriptor ); return ( bool )this.ComputeExpandableAttributeForItem( PropertyDescriptor );
} }
protected override object ComputeDefaultValueAttribute()
{
return this.ComputeDefaultValueAttributeForItem( PropertyDescriptor );
}
protected override bool ComputeIsExpandable() protected override bool ComputeIsExpandable()
{ {
return ( this.Value != null ) return ( this.Value != null )
@ -183,7 +188,11 @@ namespace Xceed.Wpf.Toolkit.PropertyGrid
var editorAttribute = GetAttribute<EditorAttribute>(); var editorAttribute = GetAttribute<EditorAttribute>();
if( editorAttribute != null ) if( editorAttribute != null )
{ {
Type type = Type.GetType( editorAttribute.EditorTypeName ); #if VS2008
var type = Type.GetType( editorAttribute.EditorTypeName );
#else
var type = Type.GetType( editorAttribute.EditorTypeName, ( name ) => { return AppDomain.CurrentDomain.GetAssemblies().Where( l => l.FullName == name.FullName ).FirstOrDefault(); }, null, true );
#endif
// If the editor does not have any public parameterless constructor, forget it. // If the editor does not have any public parameterless constructor, forget it.
if( typeof( ITypeEditor ).IsAssignableFrom( type ) if( typeof( ITypeEditor ).IsAssignableFrom( type )

33
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/PropertyGrid/Implementation/DescriptorPropertyDefinitionBase.cs

@ -44,6 +44,7 @@ namespace Xceed.Wpf.Toolkit.PropertyGrid
private string _categoryValue; private string _categoryValue;
private string _description; private string _description;
private string _displayName; private string _displayName;
private object _defaultValue;
private int _displayOrder; private int _displayOrder;
private bool _expandableAttribute; private bool _expandableAttribute;
private bool _isReadOnly; private bool _isReadOnly;
@ -95,6 +96,11 @@ namespace Xceed.Wpf.Toolkit.PropertyGrid
return false; return false;
} }
protected virtual object ComputeDefaultValueAttribute()
{
return null;
}
protected abstract bool ComputeIsExpandable(); protected abstract bool ComputeIsExpandable();
protected virtual IList<Type> ComputeNewItemTypes() protected virtual IList<Type> ComputeNewItemTypes()
@ -219,7 +225,11 @@ namespace Xceed.Wpf.Toolkit.PropertyGrid
internal void UpdateValueFromSource() internal void UpdateValueFromSource()
{ {
BindingOperations.GetBindingExpressionBase( this, DescriptorPropertyDefinitionBase.ValueProperty ).UpdateTarget(); var bindingExpr = BindingOperations.GetBindingExpressionBase( this, DescriptorPropertyDefinitionBase.ValueProperty );
if( bindingExpr != null )
{
bindingExpr.UpdateTarget();
}
} }
@ -322,6 +332,14 @@ namespace Xceed.Wpf.Toolkit.PropertyGrid
return sourceObject; return sourceObject;
} }
internal object ComputeDefaultValueAttributeForItem( object item )
{
var pd = ( PropertyDescriptor )item;
var defaultValue = PropertyGridUtilities.GetAttribute<DefaultValueAttribute>( pd );
return ( defaultValue != null ) ? defaultValue.Value : null;
}
#endregion #endregion
#region Private Methods #region Private Methods
@ -474,6 +492,18 @@ namespace Xceed.Wpf.Toolkit.PropertyGrid
} }
} }
public object DefaultValue
{
get
{
return _defaultValue;
}
set
{
_defaultValue = value;
}
}
public string Description public string Description
@ -592,6 +622,7 @@ namespace Xceed.Wpf.Toolkit.PropertyGrid
_categoryValue = ComputeCategoryValue(); _categoryValue = ComputeCategoryValue();
_description = ComputeDescription(); _description = ComputeDescription();
_displayName = ComputeDisplayName(); _displayName = ComputeDisplayName();
_defaultValue = ComputeDefaultValueAttribute();
_displayOrder = ComputeDisplayOrder( this.IsPropertyGridCategorized ); _displayOrder = ComputeDisplayOrder( this.IsPropertyGridCategorized );
_expandableAttribute = ComputeExpandableAttribute(); _expandableAttribute = ComputeExpandableAttribute();

29
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/PropertyGrid/Implementation/ObjectContainerHelperBase.cs

@ -357,7 +357,6 @@ namespace Xceed.Wpf.Toolkit.PropertyGrid
{ {
descriptorDef.Description = propertyDefinition.Description; descriptorDef.Description = propertyDefinition.Description;
} }
if( propertyDefinition.DisplayName != null ) if( propertyDefinition.DisplayName != null )
{ {
descriptorDef.DisplayName = propertyDefinition.DisplayName; descriptorDef.DisplayName = propertyDefinition.DisplayName;
@ -407,6 +406,32 @@ namespace Xceed.Wpf.Toolkit.PropertyGrid
propertyItem.CommandBindings.Add( commandBinding ); propertyItem.CommandBindings.Add( commandBinding );
} }
} }
// PropertyItem.PropertyType's defaultValue equals current PropertyItem's value => set the DefaultValue attribute
if( pd.DefaultValue != null )
{
var typeDefaultValue = this.GetTypeDefaultValue( propertyItem.PropertyType );
if( ( (propertyItem.Value != null) && propertyItem.Value.Equals( typeDefaultValue ) )
|| ( (propertyItem.Value == null) && ( typeDefaultValue == propertyItem.Value ) ) )
{
#if VS2008
propertyItem.Value = pd.DefaultValue;
#else
propertyItem.SetCurrentValue( PropertyItem.ValueProperty, pd.DefaultValue );
#endif
}
}
}
private object GetTypeDefaultValue( Type type )
{
if( type.IsGenericType && type.GetGenericTypeDefinition() == typeof( Nullable<> ) )
{
type = type.GetProperty( "Value" ).PropertyType;
}
return ( type.IsValueType ? Activator.CreateInstance( type ) : null ) ;
} }
private void SetupDefinitionBinding<T>( private void SetupDefinitionBinding<T>(
@ -441,7 +466,7 @@ namespace Xceed.Wpf.Toolkit.PropertyGrid
editorElement = editor.ResolveEditor( propertyItem ); editorElement = editor.ResolveEditor( propertyItem );
if( editorElement == null && definitionKey == null ) if( (editorElement == null) && (definitionKey == null) && ( propertyItem.PropertyDescriptor != null ) )
editorElement = this.GenerateCustomEditingElement( propertyItem.PropertyDescriptor.Name, propertyItem ); editorElement = this.GenerateCustomEditingElement( propertyItem.PropertyDescriptor.Name, propertyItem );
if( editorElement == null && definitionKeyAsType == null ) if( editorElement == null && definitionKeyAsType == null )

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

Loading…
Cancel
Save