Browse Source

Version 2.9

pull/1242/head
BoucherS_cp 10 years ago
parent
commit
fcc59e8737
  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. 16
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/DockingManager.cs
  6. 29
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/LayoutGroup.cs
  7. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Themes/generic.xaml
  8. 348
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.DataGrid/(CollectionView)/DataGridCollectionView.cs
  9. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.DataGrid/AssemblyVersionInfo.cs
  10. 35
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/DateTimeView.xaml.txt
  11. 144
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MagnifierView.xaml.txt
  12. 41
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/TimeSpanView.xaml.txt
  13. 4
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Properties/AssemblyInfo.cs
  14. 10
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Properties/Resources.resx
  15. 35
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/DateTime/Views/DateTimeView.xaml
  16. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/Magnifier/Converters/VisibilityConverter.cs
  17. 144
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/Magnifier/Views/MagnifierView.xaml
  18. 41
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/TimeSpan/Views/TimeSpanView.xaml
  19. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/AssemblyVersionInfo.cs
  20. 9
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/ButtonSpinner/Implementation/ButtonSpinner.cs
  21. 5
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Calculator/Implementation/Calculator.cs
  22. 22
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/CalculatorUpDown/Themes/Aero2.NormalColor.xaml
  23. 18
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/CalculatorUpDown/Themes/Generic.xaml
  24. 60
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/CollectionControl/Implementation/CollectionControl.cs
  25. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/CollectionControl/Implementation/CollectionControlButton.cs
  26. 43
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/CollectionControl/Implementation/CollectionControlDialog.xaml
  27. 83
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/CollectionControl/Implementation/CollectionControlDialog.xaml.cs
  28. 53
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/ColorPicker/Implementation/ColorPicker.cs
  29. 14
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/ColorPicker/Themes/Aero2.NormalColor.xaml
  30. 22
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/ColorPicker/Themes/Generic.xaml
  31. 35
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Core/Converters/NullToBoolConverter.cs
  32. 4
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Core/Utilities/CalculatorUtilities.cs
  33. 18
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/DateTimePicker/Implementation/DateTimePicker.cs
  34. 242
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/DateTimePicker/Themes/Aero2.NormalColor.xaml
  35. 24
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/DateTimePicker/Themes/Generic.xaml
  36. 28
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/DateTimeUpDown/Implementation/DateTimeUpDown.cs
  37. 1
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/DateTimeUpDown/Themes/Aero2.NormalColor.xaml
  38. 1
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/DateTimeUpDown/Themes/Generic.xaml
  39. 17
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/DropDownButton/Themes/Aero2.NormalColor.xaml
  40. 17
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/DropDownButton/Themes/Generic.xaml
  41. 52
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Magnifier/Implementation/Magnifier.cs
  42. 38
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Magnifier/Implementation/MagnifierManager.cs
  43. 17
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/MultiLineTextEditor/Themes/Aero2.NormalColor.xaml
  44. 17
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/MultiLineTextEditor/Themes/Generic.xaml
  45. 93
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Primitives/DateTimeUpDownBase.cs
  46. 4
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Primitives/Themes/Aero2/WindowControl.xaml
  47. 4
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Primitives/Themes/Generic/WindowControl.xaml
  48. 9
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Primitives/UpDownBase.cs
  49. 65
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/PropertyGrid/Implementation/CategoryGroupStyleSelector.cs
  50. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/PropertyGrid/Implementation/DescriptorPropertyDefinition.cs
  51. 24
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/PropertyGrid/Implementation/DescriptorPropertyDefinitionBase.cs
  52. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/PropertyGrid/Implementation/Editors/FontComboBoxEditor.cs
  53. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/PropertyGrid/Implementation/IPropertyContainer.cs
  54. 17
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/PropertyGrid/Implementation/ObjectContainerHelper.cs
  55. 13
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/PropertyGrid/Implementation/ObjectContainerHelperBase.cs
  56. 71
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/PropertyGrid/Implementation/PropertyGrid.cs
  57. 10
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/PropertyGrid/Implementation/PropertyItemBase.cs
  58. 1229
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/PropertyGrid/Themes/Aero2.NormalColor.xaml
  59. 32
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/PropertyGrid/Themes/Generic.xaml
  60. 6
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/StyleableWindow/Implementation/Converters/StyleableWindowClippingBorderConverter.cs
  61. 18
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/TimePicker/Themes/Aero2.NormalColor.xaml
  62. 18
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/TimePicker/Themes/Generic.xaml
  63. 15
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/TimeSpanUpDown/Implementation/TimeSpanUpDown.cs
  64. 5
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/TimeSpanUpDown/Themes/Aero2.NormalColor.xaml
  65. 3
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/TimeSpanUpDown/Themes/Generic.xaml
  66. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Xceed.Wpf.Toolkit.csproj
  67. 16
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Zoombox/Zoombox.cs
  68. 2
      ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/AssemblyVersionInfo.cs
  69. 9
      ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/ButtonSpinner/Implementation/ButtonSpinner.cs
  70. 5
      ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/Calculator/Implementation/Calculator.cs
  71. 22
      ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/CalculatorUpDown/Themes/Aero2.NormalColor.xaml
  72. 18
      ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/CalculatorUpDown/Themes/Generic.xaml
  73. 60
      ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/CollectionControl/Implementation/CollectionControl.cs
  74. 2
      ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/CollectionControl/Implementation/CollectionControlButton.cs
  75. 43
      ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/CollectionControl/Implementation/CollectionControlDialog.xaml
  76. 83
      ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/CollectionControl/Implementation/CollectionControlDialog.xaml.cs
  77. 53
      ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/ColorPicker/Implementation/ColorPicker.cs
  78. 14
      ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/ColorPicker/Themes/Aero2.NormalColor.xaml
  79. 22
      ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/ColorPicker/Themes/Generic.xaml
  80. 35
      ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/Core/Converters/NullToBoolConverter.cs
  81. 4
      ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/Core/Utilities/CalculatorUtilities.cs
  82. 18
      ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/DateTimePicker/Implementation/DateTimePicker.cs
  83. 3
      ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/DateTimePicker/Themes/Aero2.NormalColor.xaml
  84. 3
      ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/DateTimePicker/Themes/Generic.xaml
  85. 28
      ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/DateTimeUpDown/Implementation/DateTimeUpDown.cs
  86. 1
      ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/DateTimeUpDown/Themes/Aero2.NormalColor.xaml
  87. 1
      ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/DateTimeUpDown/Themes/Generic.xaml
  88. 17
      ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/DropDownButton/Themes/Aero2.NormalColor.xaml
  89. 17
      ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/DropDownButton/Themes/Generic.xaml
  90. 52
      ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/Magnifier/Implementation/Magnifier.cs
  91. 38
      ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/Magnifier/Implementation/MagnifierManager.cs
  92. 17
      ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/MultiLineTextEditor/Themes/Aero2.NormalColor.xaml
  93. 17
      ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/MultiLineTextEditor/Themes/Generic.xaml
  94. 93
      ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/Primitives/DateTimeUpDownBase.cs
  95. 4
      ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/Primitives/Themes/Aero2/WindowControl.xaml
  96. 4
      ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/Primitives/Themes/Generic/WindowControl.xaml
  97. 9
      ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/Primitives/UpDownBase.cs
  98. 65
      ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/PropertyGrid/Implementation/CategoryGroupStyleSelector.cs
  99. 2
      ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/PropertyGrid/Implementation/DescriptorPropertyDefinition.cs
  100. 24
      ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/PropertyGrid/Implementation/DescriptorPropertyDefinitionBase.cs

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

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

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

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

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

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

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

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

16
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/DockingManager.cs

@ -163,7 +163,7 @@ namespace Xceed.Wpf.AvalonDock
CommandManager.InvalidateRequerySuggested();
}
DispatcherOperation _setFocusAsyncOperation = null;
// DispatcherOperation _setFocusAsyncOperation = null;
void OnLayoutRootPropertyChanged(object sender, PropertyChangedEventArgs e)
{
@ -194,10 +194,14 @@ namespace Xceed.Wpf.AvalonDock
//}
}
if (!_insideInternalSetActiveContent)
ActiveContent = Layout.ActiveContent != null ?
Layout.ActiveContent.Content : null;
//if (!_insideInternalSetActiveContent)
// ActiveContent = Layout.ActiveContent != null ?
// Layout.ActiveContent.Content : null;
if( !_insideInternalSetActiveContent && (Layout.ActiveContent != null) )
{
this.ActiveContent = Layout.ActiveContent.Content;
}
}
}
void OnLayoutRootUpdated(object sender, EventArgs e)
@ -267,7 +271,7 @@ namespace Xceed.Wpf.AvalonDock
{
base.OnApplyTemplate();
SetupAutoHideWindow();
// SetupAutoHideWindow();
}
protected override void OnInitialized( EventArgs e )
@ -288,6 +292,8 @@ namespace Xceed.Wpf.AvalonDock
BottomSidePanel = CreateUIElementForModel( Layout.BottomSide ) as LayoutAnchorSideControl;
}
SetupAutoHideWindow();
//load windows not already loaded!
foreach (var fw in Layout.FloatingWindows.Where(fw => !_fwList.Any(fwc => fwc.Model == fw)))
_fwList.Add(CreateUIElementForModel(fw) as LayoutFloatingWindowControl);

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

@ -200,11 +200,16 @@ namespace Xceed.Wpf.AvalonDock.Layout
reader.Read();
while (true)
{
if (reader.LocalName == localName &&
reader.NodeType == System.Xml.XmlNodeType.EndElement)
if ( (reader.LocalName == localName ) &&
( reader.NodeType == System.Xml.XmlNodeType.EndElement) )
{
break;
}
if( reader.NodeType == System.Xml.XmlNodeType.Whitespace )
{
reader.Read();
continue;
}
XmlSerializer serializer = null;
if (reader.LocalName == "LayoutAnchorablePaneGroup")
@ -223,6 +228,13 @@ namespace Xceed.Wpf.AvalonDock.Layout
serializer = new XmlSerializer(typeof(LayoutAnchorGroup));
else if (reader.LocalName == "LayoutPanel")
serializer = new XmlSerializer(typeof(LayoutPanel));
else
{
Type type = this.FindType( reader.LocalName );
if( type == null )
throw new ArgumentException( "AvalonDock.LayoutGroup doesn't know how to deserialize " + reader.LocalName );
serializer = new XmlSerializer( type );
}
Children.Add((T)serializer.Deserialize(reader));
}
@ -240,5 +252,18 @@ namespace Xceed.Wpf.AvalonDock.Layout
}
}
private Type FindType( string name )
{
foreach( var a in AppDomain.CurrentDomain.GetAssemblies() )
{
foreach( var t in a.GetTypes() )
{
if( t.Name.Equals( name ) )
return t;
}
}
return null;
}
}
}

2
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Themes/generic.xaml

@ -840,7 +840,7 @@
CaptionHeight="16"
CornerRadius="3,3,3,3"
GlassFrameThickness="0"
ShowSystemMenu="True"/>
ShowSystemMenu="False"/>
</Setter.Value>
</Setter>
<Setter Property="Template">

348
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.DataGrid/(CollectionView)/DataGridCollectionView.cs

@ -22,6 +22,7 @@ using System.Collections.Specialized;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Threading;
using System.Windows.Data;
using Xceed.Utils.Collections;
@ -972,44 +973,29 @@ namespace Xceed.Wpf.DataGrid
m_lastAddCount = newSourceItemCount;
m_lastAddIndex = startIndex;
int count = items.Count;
List<RawItem> filteredItems = new List<RawItem>( count );
RawItem[] rawItems = new RawItem[ count ];
var filteredItemsChanged = false;
for( int i = 0; i < count; i++ )
for( int i = 0; i < items.Count; i++ )
{
object item = items[ i ];
RawItem rawItem = new RawItem( startIndex + i, item );
rawItems[ i ] = rawItem;
var index = startIndex + i;
var item = items[ i ];
var rawItem = new RawItem( index, item );
if( this.PassesFilter( rawItem.DataItem )
&& this.PassesAutoFilter( rawItem.DataItem, null )
&& this.PassesFilterCriterion( rawItem.DataItem ) )
if( this.PassesFilter( item ) && this.PassesAutoFilter( item, null ) && this.PassesFilterCriterion( item ) )
{
filteredItems.Add( rawItem );
}
}
bool isLast = ( startIndex == this.SourceItemCount );
this.AddRawItemInSourceList( startIndex, rawItems );
filteredItemsChanged = true;
if( filteredItems.Count != 0 )
{
this.AddRawItemInFilteredList( filteredItems, isLast );
this.AddRawItemInGroup( filteredItems );
if( m_statFunctions.Count > 0 )
this.AddRawItemInSourceList( index, rawItem );
this.AddRawItemInFilteredList( rawItem );
this.AddRawItemInGroup( rawItem );
}
else
{
DeferredOperationManager deferredOperationManager = this.DeferredOperationManager;
foreach( RawItem rawItem in filteredItems )
{
//When adding a new item, make sure all stats for the specified group are recalculated even if UpdateChangedPropertyStatsOnly is set to true
deferredOperationManager.InvalidateGroupStats( rawItem.ParentGroup, true );
}
this.AddRawItemInSourceList( index, rawItem );
}
}
this.RefreshDistinctValues( filteredItems.Count > 0 );
this.RefreshDistinctValues( filteredItemsChanged );
return true;
}
@ -1023,38 +1009,31 @@ namespace Xceed.Wpf.DataGrid
return false;
}
RawItem rawItem;
RawItem[] removedItems = new RawItem[ count ];
var filteredItemsChanged = false;
for( int i = 0; i < count; i++ )
{
rawItem = m_sourceItemList[ i + startIndex ];
var rawItem = m_sourceItemList[ startIndex ];
if( this.CurrentEditItem == rawItem.DataItem )
{
this.SetCurrentEditItem( null );
}
removedItems[ i ] = rawItem;
if( this.RemoveRawItemInFilteredList( rawItem ) )
{
filteredItemsChanged = true;
//When removing an item, make sure all stats for the specified group are recalculated even if UpdateChangedPropertyStatsOnly is set to true
if( m_statFunctions.Count > 0 )
this.RemoveRawItemInSourceList( startIndex );
this.RemoveRawItemInGroup( rawItem );
}
else
{
this.DeferredOperationManager.InvalidateGroupStats( rawItem.ParentGroup, true );
this.RemoveRawItemInSourceList( startIndex );
}
}
int filteredItemRemovedCount = this.RemoveRawItemInFilteredList( removedItems );
// We do the raw item list after cleaning up the filtered list to delay the resequencing of the RawItem.
this.RemoveRawItemInSourceList( startIndex, count );
if( filteredItemRemovedCount > 0 )
{
this.RemoveRawItemInGroup( removedItems );
}
this.RefreshDistinctValues( filteredItemRemovedCount > 0 );
this.RefreshDistinctValues( filteredItemsChanged );
return true;
}
@ -1313,17 +1292,14 @@ namespace Xceed.Wpf.DataGrid
{
Debug.Assert( rawItem.GetGlobalSortedIndex() == globalSortedIndex );
object dataItem = rawItem.DataItem;
var dataItem = rawItem.DataItem;
if( this.PassesFilter( dataItem )
&& this.PassesAutoFilter( dataItem, null )
&& this.PassesFilterCriterion( dataItem ) )
if( this.PassesFilter( dataItem ) && this.PassesAutoFilter( dataItem, null ) && this.PassesFilterCriterion( dataItem ) )
{
if( globalSortedIndex == -1 )
{
RawItem[] rawItems = new RawItem[] { rawItem };
this.AddRawItemInFilteredList( rawItems, false );
this.AddRawItemInGroup( rawItems );
this.AddRawItemInFilteredList( rawItem );
this.AddRawItemInGroup( rawItem );
this.RefreshDistinctValues( true );
return;
@ -1337,9 +1313,8 @@ namespace Xceed.Wpf.DataGrid
{
if( globalSortedIndex != -1 )
{
RawItem[] rawItems = new RawItem[] { rawItem };
this.RemoveRawItemInFilteredList( rawItems );
this.RemoveRawItemInGroup( rawItems );
this.RemoveRawItemInFilteredList( rawItem );
this.RemoveRawItemInGroup( rawItem );
}
this.RefreshDistinctValues( true );
@ -1347,8 +1322,8 @@ namespace Xceed.Wpf.DataGrid
}
// Verify the row is in the correct group.
DataGridCollectionViewGroup newGroup = this.GetRawItemNewGroup( rawItem );
DataGridCollectionViewGroup currentGroup = rawItem.ParentGroup;
var newGroup = this.GetRawItemNewGroup( rawItem );
var currentGroup = rawItem.ParentGroup;
if( currentGroup != newGroup )
{
@ -1356,14 +1331,14 @@ namespace Xceed.Wpf.DataGrid
{
if( m_statFunctions.Count > 0 )
{
DeferredOperationManager deferredOperationManager = this.DeferredOperationManager;
var deferredOperationManager = this.DeferredOperationManager;
//If an item is moved from one group to another, make sure all stats for the specified groups are recalculated even if UpdateChangedPropertyStatsOnly is set to true
deferredOperationManager.InvalidateGroupStats( currentGroup, true );
deferredOperationManager.InvalidateGroupStats( newGroup, true );
}
int newSortIndex = newGroup.BinarySearchRawItem( rawItem, this.RawItemSortComparer );
var newSortIndex = newGroup.BinarySearchRawItem( rawItem, this.RawItemSortComparer );
if( newSortIndex < 0 )
{
@ -1372,7 +1347,7 @@ namespace Xceed.Wpf.DataGrid
currentGroup.RemoveRawItemAt( rawItem.SortedIndex );
newGroup.InsertRawItem( newSortIndex, rawItem );
int newGlobalSortedIndex = rawItem.GetGlobalSortedIndex();
var newGlobalSortedIndex = rawItem.GetGlobalSortedIndex();
this.AdjustCurrencyAfterMove( globalSortedIndex, newGlobalSortedIndex, 1 );
this.OnCollectionChanged( new NotifyCollectionChangedEventArgs( NotifyCollectionChangedAction.Move, rawItem.DataItem, newGlobalSortedIndex, globalSortedIndex ) );
}
@ -1403,7 +1378,7 @@ namespace Xceed.Wpf.DataGrid
using( this.DeferCurrencyEvent() )
{
newGroup.MoveRawItem( rawItem.SortedIndex, newSortIndex );
int newGlobalSortedIndex = rawItem.GetGlobalSortedIndex();
var newGlobalSortedIndex = rawItem.GetGlobalSortedIndex();
this.AdjustCurrencyAfterMove( globalSortedIndex, newGlobalSortedIndex, 1 );
this.OnCollectionChanged( new NotifyCollectionChangedEventArgs( NotifyCollectionChangedAction.Move, rawItem.DataItem, newGlobalSortedIndex, globalSortedIndex ) );
}
@ -1680,7 +1655,7 @@ namespace Xceed.Wpf.DataGrid
private bool MoveSourceItem( int oldStartIndex, IList items, int newStartIndex )
{
int count = items.Count;
var count = items.Count;
if( ( oldStartIndex < 0 ) || ( oldStartIndex + count > m_sourceItemList.Count ) || ( newStartIndex < 0 ) || ( newStartIndex > ( m_sourceItemList.Count - count ) ) )
{
@ -1688,47 +1663,60 @@ namespace Xceed.Wpf.DataGrid
return false;
}
m_lastAddCount = -1;
RawItem[] rawItems = new RawItem[ count ];
List<RawItem> filteredRawItems = new List<RawItem>( count );
for( int i = 0; i < count; i++ )
if( oldStartIndex < newStartIndex )
{
RawItem rawItem = m_sourceItemList[ oldStartIndex + i ];
rawItems[ i ] = rawItem;
// If our parent group is null, we are filtered out.
if( rawItem.ParentGroup != null )
for( int i = count - 1; i >= 0; i-- )
{
filteredRawItems.Add( rawItem );
}
}
var oldIndex = oldStartIndex + i;
var newIndex = newStartIndex + i;
int filteredItemCount = this.RemoveRawItemInFilteredList( rawItems );
Debug.Assert( (oldIndex >= 0) && (oldIndex < m_sourceItemList.Count) );
Debug.Assert( (newIndex >= 0) && (newIndex < m_sourceItemList.Count) );
Debug.Assert( filteredItemCount == filteredRawItems.Count );
var rawItem = m_sourceItemList[ oldIndex ];
var wasFiltered = this.RemoveRawItemInFilteredList( rawItem );
m_sourceItemList.RemoveRange( oldStartIndex, count );
m_sourceItemList.InsertRange( newStartIndex, rawItems );
m_sourceItemList.RemoveAt( oldIndex );
m_sourceItemList.Insert( newIndex, rawItem );
int startIndex = Math.Min( oldStartIndex, newStartIndex );
int endIndex = Math.Max( oldStartIndex, newStartIndex ) + count;
for( int j = oldIndex; j <= newIndex; j++ )
{
m_sourceItemList[ j ].SetIndex( j );
}
for( int i = startIndex; i < endIndex; i++ )
{
m_sourceItemList[ i ].SetIndex( i );
if( wasFiltered )
{
this.AddRawItemInFilteredList( rawItem );
this.EnsurePosition( rawItem, rawItem.GetGlobalSortedIndex() );
}
}
}
else if( oldStartIndex > newStartIndex )
{
for( int i = 0; i < count; i++ )
{
var oldIndex = oldStartIndex + i;
var newIndex = newStartIndex + i;
filteredItemCount = filteredRawItems.Count;
Debug.Assert( (oldIndex >= 0) && (oldIndex < m_sourceItemList.Count) );
Debug.Assert( (newIndex >= 0) && (newIndex < m_sourceItemList.Count) );
if( filteredItemCount > 0 )
{
this.AddRawItemInFilteredList( filteredRawItems, false );
var rawItem = m_sourceItemList[ oldIndex ];
var wasFiltered = this.RemoveRawItemInFilteredList( rawItem );
for( int i = 0; i < filteredItemCount; i++ )
{
RawItem rawItem = filteredRawItems[ i ];
this.EnsurePosition( rawItem, rawItem.GetGlobalSortedIndex() );
m_sourceItemList.RemoveAt( oldIndex );
m_sourceItemList.Insert( newIndex, rawItem );
for( int j = newIndex; j <= oldIndex; j++ )
{
m_sourceItemList[ j ].SetIndex( j );
}
if( wasFiltered )
{
this.AddRawItemInFilteredList( rawItem );
this.EnsurePosition( rawItem, rawItem.GetGlobalSortedIndex() );
}
}
}
@ -1737,7 +1725,7 @@ namespace Xceed.Wpf.DataGrid
private bool ResetSourceItem( object dataItem )
{
RawItem rawItem = null;
var rawItem = default( RawItem );
//Verify if the item is in the same detail CollectionView as the previous item was found in.
if( m_currentChildCollectionView != null )
@ -1760,23 +1748,22 @@ namespace Xceed.Wpf.DataGrid
//If the item was found, refresh it.
if( rawItem != null )
{
int globalSortedIndex = rawItem.GetGlobalSortedIndex();
this.EnsurePosition( rawItem, globalSortedIndex );
this.EnsurePosition( rawItem, rawItem.GetGlobalSortedIndex() );
return true;
}
//If the item was not found, look for it in an expended detail.
foreach( DataGridContext detailContext in this.DataGridContext.GetChildContextsCore() )
foreach( var detailContext in this.DataGridContext.GetChildContextsCore() )
{
DataGridCollectionView detailCollectionView = detailContext.Items as DataGridCollectionView;
if( detailCollectionView != null )
var detailCollectionView = detailContext.Items as DataGridCollectionView;
if( detailCollectionView == null )
continue;
if( detailCollectionView.ResetSourceItem( dataItem ) )
{
if( detailCollectionView.ResetSourceItem( dataItem ) )
{
//keep a reference to the detail CollectionView the item was found in, in case following items belong to the same detail.
m_currentChildCollectionView = detailCollectionView;
return true;
}
//keep a reference to the detail CollectionView the item was found in, in case following items belong to the same detail.
m_currentChildCollectionView = detailCollectionView;
return true;
}
}
@ -1791,38 +1778,34 @@ namespace Xceed.Wpf.DataGrid
}
}
private void AddRawItemInSourceList( int startIndex, IList<RawItem> rawItems )
private void AddRawItemInSourceList( int index, RawItem rawItem )
{
m_sourceItemList.InsertRange( startIndex, rawItems );
Debug.Assert( (index >= 0) && (index <= m_sourceItemList.Count) );
Debug.Assert( rawItem != null );
foreach( RawItem rawItem in rawItems )
{
this.AddRawItemDataItemMapping( rawItem );
}
m_sourceItemList.Insert( index, rawItem );
int count = m_sourceItemList.Count;
this.AddRawItemDataItemMapping( rawItem );
for( int i = startIndex + rawItems.Count; i < count; i++ )
for( var i = m_sourceItemList.Count - 1; i > index; i-- )
{
m_sourceItemList[ i ].SetIndex( i );
}
}
private void AddRawItemInFilteredList( IList<RawItem> rawItems, bool isLast )
private void AddRawItemInFilteredList( RawItem rawItem )
{
Debug.Assert( rawItem != null );
// The function take for granted that all RawItem's index are sequential,
// or if there is gap, the index contained in the gap are not already contained in the list.
int index;
if( isLast )
if( (m_filteredItemList.Count == 0) || (m_filteredItemList.Last().Index < rawItem.Index) )
{
index = m_filteredItemList.Count;
m_filteredItemList.Add( rawItem );
}
else
{
index = m_filteredItemList.BinarySearch( rawItems[ 0 ], DataGridCollectionView.RawItemIndexComparer );
var index = m_filteredItemList.BinarySearch( rawItem, DataGridCollectionView.RawItemIndexComparer );
Debug.Assert( index < 0 );
if( index < 0 )
@ -1830,35 +1813,25 @@ namespace Xceed.Wpf.DataGrid
index = ~index;
}
Debug.Assert( index <= m_filteredItemList.Count );
}
m_filteredItemList.InsertRange( index, rawItems );
}
private void AddRawItemInGroup( IList<RawItem> rawItems )
{
int count = rawItems.Count;
for( int i = 0; i < count; i++ )
{
this.AddRawItemInGroup( rawItems[ i ] );
m_filteredItemList.Insert( index, rawItem );
}
}
private void AddRawItemInGroup( RawItem rawItem )
{
Debug.Assert( rawItem != null );
using( this.DeferCurrencyEvent() )
{
DataGridCollectionViewGroup newGroup = this.GetRawItemNewGroup( rawItem );
int index = newGroup.BinarySearchRawItem( rawItem, this.RawItemSortComparer );
var newGroup = this.GetRawItemNewGroup( rawItem );
var index = newGroup.BinarySearchRawItem( rawItem, this.RawItemSortComparer );
if( index < 0 )
{
index = ~index;
}
int globalIndex = newGroup.GetFirstRawItemGlobalSortedIndex() + index;
var globalIndex = newGroup.GetFirstRawItemGlobalSortedIndex() + index;
this.AdjustCurrencyBeforeAdd( globalIndex );
newGroup.InsertRawItem( index, rawItem );
@ -1869,89 +1842,74 @@ namespace Xceed.Wpf.DataGrid
this.OnCollectionChanged( new NotifyCollectionChangedEventArgs( NotifyCollectionChangedAction.Add, rawItem.DataItem, globalIndex ) );
}
}
private void RemoveRawItemInSourceList( int startIndex, int count )
{
int endIndex = startIndex + count - 1;
for( int i = startIndex; i <= endIndex; i++ )
//When adding an item, make sure all stats for the specified group are recalculated even if UpdateChangedPropertyStatsOnly is set to true
if( m_statFunctions.Count > 0 )
{
this.RemoveRawItemDataItemMapping( m_sourceItemList[ i ] );
this.DeferredOperationManager.InvalidateGroupStats( rawItem.ParentGroup, true );
}
}
private void RemoveRawItemInSourceList( int index )
{
Debug.Assert( (index >= 0) && (index < m_sourceItemList.Count) );
this.RemoveRawItemDataItemMapping( m_sourceItemList[ index ] );
m_sourceItemList.RemoveRange( startIndex, count );
int totalCount = m_sourceItemList.Count;
m_sourceItemList.RemoveAt( index );
for( int i = startIndex; i < totalCount; i++ )
for( int i = m_sourceItemList.Count - 1; i >= index; i-- )
{
m_sourceItemList[ i ].SetIndex( i );
}
}
private int RemoveRawItemInFilteredList( IList<RawItem> rawItems )
private bool RemoveRawItemInFilteredList( RawItem rawItem )
{
Debug.Assert( rawItem != null );
// The function take for granted that all RawItem's index are sequential,
// There should not be any gap in the index sequence.
int index = m_filteredItemList.BinarySearch( rawItems[ 0 ], DataGridCollectionView.RawItemIndexComparer );
var index = m_filteredItemList.BinarySearch( rawItem, DataGridCollectionView.RawItemIndexComparer );
if( index < 0 )
{
index = ~index;
}
if( index > m_filteredItemList.Count )
return 0;
int lastRawItemIndex = rawItems[ rawItems.Count - 1 ].Index;
int count = m_filteredItemList.Count;
int countToRemove = 0;
return false;
for( int i = index; i < count; i++ )
{
if( m_filteredItemList[ i ].Index <= lastRawItemIndex )
{
countToRemove++;
}
}
Debug.Assert( (index >= 0) && (index < m_filteredItemList.Count) );
if( countToRemove > 0 )
{
m_filteredItemList.RemoveRange( index, countToRemove );
}
m_filteredItemList.RemoveAt( index );
return countToRemove;
return true;
}
private void RemoveRawItemInGroup( IList<RawItem> rawItems )
private void RemoveRawItemInGroup( RawItem rawItem )
{
int count = rawItems.Count;
Debug.Assert( rawItem != null );
for( int i = 0; i < count; i++ )
var parentGroup = rawItem.ParentGroup;
if( parentGroup == null )
return;
var globalSortedIndex = rawItem.GetGlobalSortedIndex();
using( this.DeferCurrencyEvent() )
{
RawItem oldRawItem = rawItems[ i ];
DataGridCollectionViewGroup parentGroup = oldRawItem.ParentGroup;
this.AdjustCurrencyBeforeRemove( globalSortedIndex );
parentGroup.RemoveRawItemAt( rawItem.SortedIndex );
if( parentGroup != null )
unchecked
{
int globalSortedIndex = oldRawItem.GetGlobalSortedIndex();
using( this.DeferCurrencyEvent() )
{
this.AdjustCurrencyBeforeRemove( globalSortedIndex );
parentGroup.RemoveRawItemAt( oldRawItem.SortedIndex );
m_sortedItemVersion++;
}
}
unchecked
{
m_sortedItemVersion++;
}
}
// In the case of a remove, the CollectionChanged must be after the CurrentChanged since when the DataGridCollectionView is used with a Selector having the
// IsSynchronizedWithCurrent set, the Selector will set the current position to -1 if the selected item is removed.
this.OnCollectionChanged( new NotifyCollectionChangedEventArgs( NotifyCollectionChangedAction.Remove, rawItem.DataItem, globalSortedIndex ) );
// In the case of a remove, the CollectionChanged must be after the CurrentChanged since when the DataGridCollectionView is used with a Selector having the
// IsSynchronizedWithCurrent set, the Selector will set the current position to -1 if the selected item is removed.
this.OnCollectionChanged( new NotifyCollectionChangedEventArgs( NotifyCollectionChangedAction.Remove, oldRawItem.DataItem, globalSortedIndex ) );
}
//When removing an item, make sure all stats for the specified group are recalculated even if UpdateChangedPropertyStatsOnly is set to true
if( m_statFunctions.Count > 0 )
{
this.DeferredOperationManager.InvalidateGroupStats( parentGroup, true );
}
}

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

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

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

@ -47,7 +47,19 @@
<x:Type TypeName="sys:DateTimeKind" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
</local:DemoView.Resources>
<ObjectDataProvider x:Key="enumCalendarDisplayMode"
MethodName="GetValues"
ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="CalendarMode" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<ObjectDataProvider x:Key="enumDateTimePart" MethodName="GetValues" ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="xctk:DateTimePart"/>
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
</local:DemoView.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
@ -70,6 +82,7 @@
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
@ -90,12 +103,14 @@
<CheckBox x:Name="_clipValueToMinMax" Grid.Row="4" Grid.Column="1" IsChecked="False" VerticalAlignment="Center" Margin="5,5,25,5"/>
<TextBlock Text="Kind:" Grid.Row="5" Grid.Column="0" VerticalAlignment="Center"/>
<ComboBox x:Name="_kind" Grid.Row="5" Grid.Column="1" SelectedIndex="2" ItemsSource="{Binding Source={StaticResource enumKind}}" Width="190" Margin="5,5,25,5"/>
<TextBlock Text="ShowDropDownButton:" Grid.Row="6" Grid.Column="0" VerticalAlignment="Center"/>
<CheckBox x:Name="_showDropDownButton" Grid.Row="6" Grid.Column="1" IsChecked="True" VerticalAlignment="Center" Margin="5,5,25,5"/>
<TextBlock Text="TimePickerVisibility:" Grid.Row="7" Grid.Column="0" VerticalAlignment="Center"/>
<ComboBox x:Name="_timePickerVisibility" Grid.Row="7" Grid.Column="1" SelectedIndex="0" ItemsSource="{Binding Source={StaticResource enumVisibility}}" Width="190" Margin="5,5,25,5"/>
<TextBlock Text="TimePickerShowButtonSpinner:" Grid.Row="8" Grid.Column="0" VerticalAlignment="Center"/>
<CheckBox x:Name="_timePickerShowButtonSpinner" Grid.Row="8" Grid.Column="1" IsChecked="True" VerticalAlignment="Center" Margin="5,5,25,5"/>
<TextBlock Text="CalendarDisplayMode:" Grid.Row="6" Grid.Column="0" VerticalAlignment="Center"/>
<ComboBox x:Name="_calendarDisplayMode" Grid.Row="6" Grid.Column="1" SelectedIndex="0" ItemsSource="{Binding Source={StaticResource enumCalendarDisplayMode}}" Width="190" Margin="5,5,25,5"/>
<TextBlock Text="ShowDropDownButton:" Grid.Row="7" Grid.Column="0" VerticalAlignment="Center"/>
<CheckBox x:Name="_showDropDownButton" Grid.Row="7" Grid.Column="1" IsChecked="True" VerticalAlignment="Center" Margin="5,5,25,5"/>
<TextBlock Text="TimePickerVisibility:" Grid.Row="8" Grid.Column="0" VerticalAlignment="Center"/>
<ComboBox x:Name="_timePickerVisibility" Grid.Row="8" Grid.Column="1" SelectedIndex="0" ItemsSource="{Binding Source={StaticResource enumVisibility}}" Width="190" Margin="5,5,25,5"/>
<TextBlock Text="TimePickerShowButtonSpinner:" Grid.Row="9" Grid.Column="0" VerticalAlignment="Center"/>
<CheckBox x:Name="_timePickerShowButtonSpinner" Grid.Row="9" Grid.Column="1" IsChecked="True" VerticalAlignment="Center" Margin="5,5,25,5"/>
<TextBlock Text="TimeFormat:" Grid.Row="0" Grid.Column="2" VerticalAlignment="Center" />
<ComboBox x:Name="_timeFormat" Grid.Row="0" Grid.Column="3" SelectedIndex="7" ItemsSource="{Binding Source={StaticResource enumDateFormatData}}" Width="190" Margin="5"/>
@ -107,6 +122,8 @@
<xctk:DateTimeUpDown x:Name="_minimum" Grid.Row="3" Grid.Column="3" Format="Custom" FormatString="yyyy/MM/dd HH:mm" Value="2010/01/01T12:00" Width="190" VerticalAlignment="Center" Margin="5"/>
<TextBlock Text="Maximum:" Grid.Row="4" Grid.Column="2" VerticalAlignment="Center"/>
<xctk:DateTimeUpDown x:Name="_maximum" Grid.Row="4" Grid.Column="3" Format="Custom" FormatString="yyyy/MM/dd HH:mm" Value="2015/12/31T12:00" Width="190" VerticalAlignment="Center" Margin="5"/>
<TextBlock Text="CurrentDateTimePart:" Grid.Row="5" Grid.Column="2" VerticalAlignment="Center"/>
<ComboBox x:Name="_currentDateTimePart" Grid.Row="5" Grid.Column="3" SelectedIndex="0" ItemsSource="{Binding Source={StaticResource enumDateTimePart}}" Width="190" Margin="5" ToolTip="Must match a DateTimePart of the DateTimePicker Format."/>
</Grid>
</GroupBox>
@ -129,7 +146,9 @@
Minimum="{Binding Value, ElementName=_minimum}"
Maximum="{Binding Value, ElementName=_maximum}"
Kind="{Binding SelectedItem, ElementName=_kind}"
ShowDropDownButton="{Binding IsChecked, ElementName=_showDropDownButton}" />
CalendarDisplayMode="{Binding SelectedItem, ElementName=_calendarDisplayMode}"
ShowDropDownButton="{Binding IsChecked, ElementName=_showDropDownButton}"
CurrentDateTimePart="{Binding SelectedItem, ElementName=_currentDateTimePart, Mode=TwoWay}"/>
</StackPanel>
<StackPanel Grid.Row="1" Grid.Column="1" HorizontalAlignment="Stretch">

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

@ -22,78 +22,90 @@
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:conv="clr-namespace:Xceed.Wpf.Toolkit.LiveExplorer.Samples.Magnifier.Converters"
Title="Magnifier">
<local:DemoView.Description>
<Paragraph FontSize="14" FontFamily="Segoe">
The Magnifier control allows the user to magnify parts of an application.
</Paragraph>
</local:DemoView.Description>
<local:DemoView.Description>
<Paragraph FontSize="14" FontFamily="Segoe">
The Magnifier control allows the user to magnify parts of an application.
</Paragraph>
</local:DemoView.Description>
<local:DemoView.Resources>
<conv:ColorConverter x:Key="colorConverter" />
<conv:VisibilityConverter x:Key="visibilityConverter" />
<xctk:RtfFormatter x:Key="rtfFormatter" />
<local:DemoView.Resources>
<xctk:SolidColorBrushToColorConverter x:Key="SolidColorBrushToColorConverter" />
<conv:VisibilityConverter x:Key="visibilityConverter" />
<xctk:RtfFormatter x:Key="rtfFormatter" />
<xctk:BorderThicknessToStrokeThicknessConverter x:Key="BorderThicknessToStrokeThicknessConverter"/>
<ObjectDataProvider x:Key="enumData" MethodName="GetValues" ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="xctk:FrameType"/>
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
</local:DemoView.Resources>
<ObjectDataProvider x:Key="enumData" MethodName="GetValues" ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="xctk:FrameType"/>
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
</local:DemoView.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<GroupBox Header="Features" Grid.Row="0" Margin="5">
<Grid Margin="5" HorizontalAlignment="Left">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock Text="Zoom Factor:" VerticalAlignment="Center" Margin="5" />
<xctk:DoubleUpDown x:Name="_zoomFactor" Grid.Column="1" Value="0.4" Minimum="0" Increment="0.1" Maximum="3" FormatString="N1" Width="150" Margin="5" />
<TextBlock Text="Border Thickness:" Grid.Row="1" VerticalAlignment="Center" Margin="5" />
<xctk:IntegerUpDown x:Name="_borderThickness" Grid.Row="1" Grid.Column="1" Value="2" Minimum="0" Maximum="20" Width="150" Margin="5" />
<TextBlock Text="Border Brush:" Grid.Row="2" VerticalAlignment="Center" Margin="5"/>
<xctk:ColorPicker x:Name="_colorPicker" Grid.Row="2" Grid.Column="1" Width="150" Margin="5" SelectedColor="#FFEFAC27"/>
<TextBlock Grid.Column="2" Text="Frame Type:" VerticalAlignment="Center" Margin="10,0,0,0"/>
<ComboBox x:Name="_frameType" SelectedIndex="0" ItemsSource="{Binding Source={StaticResource enumData}}" Grid.Column="3" Width="150" Margin="5" />
<TextBlock Text="Radius:" Grid.Row="1" Grid.Column="2" Visibility="{Binding ElementName=_frameType, Path=SelectedItem, Converter={StaticResource visibilityConverter}, ConverterParameter=0}" VerticalAlignment="Center" Margin="10,0,0,0"/>
<xctk:DoubleUpDown x:Name="_radius" Visibility="{Binding ElementName=_frameType, Path=SelectedItem, Converter={StaticResource visibilityConverter}, ConverterParameter=0}" Grid.Row="1" Grid.Column="3" Value="80" Minimum="0" Maximum="150" Width="150" Margin="5" />
<TextBlock Text="RectangleWidth:" Grid.Row="1" Grid.Column="2" Visibility="{Binding ElementName=_frameType, Path=SelectedItem, Converter={StaticResource visibilityConverter}, ConverterParameter=1}" VerticalAlignment="Center" Margin="10,0,0,0"/>
<xctk:DoubleUpDown x:Name="_width" Grid.Row="1" Grid.Column="3" Value="160" Minimum="0" Maximum="300" Visibility="{Binding ElementName=_frameType, Path=SelectedItem, Converter={StaticResource visibilityConverter}, ConverterParameter=1}" Width="150" Margin="5" />
<TextBlock Text="RectangleHeight:" Grid.Row="2" Grid.Column="2" Visibility="{Binding ElementName=_frameType, Path=SelectedItem, Converter={StaticResource visibilityConverter}, ConverterParameter=1}" VerticalAlignment="Center" Margin="10,0,0,0"/>
<xctk:DoubleUpDown x:Name="_height" Grid.Row="2" Grid.Column="3" Value="160" Minimum="0" Maximum="300" Visibility="{Binding ElementName=_frameType, Path=SelectedItem, Converter={StaticResource visibilityConverter}, ConverterParameter=1}" Width="150" Margin="5" />
</Grid>
</GroupBox>
<GroupBox Header="Features" Grid.Row="0" Margin="5">
<Grid Margin="5" HorizontalAlignment="Left">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="100" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="100" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="100" />
</Grid.ColumnDefinitions>
<!-- First Column-->
<TextBlock Text="Zoom Factor:" VerticalAlignment="Center" Margin="5" />
<xctk:DoubleUpDown x:Name="_zoomFactor" Grid.Column="1" Value="{Binding ZoomFactor, ElementName=_magnifier}" Minimum="0" Increment="0.1" Maximum="3" FormatString="N1" Margin="5" />
<TextBlock Text="IsUsingZoomOnMouseWheel:" Grid.Row="1" VerticalAlignment="Center" Margin="5" />
<CheckBox x:Name="_isUsingZoomOnMouseWheel" Grid.Row="1" Grid.Column="1" IsChecked="{Binding IsUsingZoomOnMouseWheel, ElementName=_magnifier}" Margin="5" />
<TextBlock Text="ZoomFactorOnMouseWheel:" Grid.Row="2" VerticalAlignment="Center" Margin="5" />
<xctk:DoubleUpDown x:Name="_zoomFactorOnMouseWheel" Grid.Row="2" Grid.Column="1" Value="{Binding ZoomFactorOnMouseWheel, ElementName=_magnifier}" Minimum="0" Increment="0.05" Maximum="1" FormatString="N2" Margin="5" />
<!-- Second Column-->
<TextBlock Grid.Column="2" Text="Frame Type:" VerticalAlignment="Center" Margin="10,0,0,0"/>
<ComboBox x:Name="_frameType" SelectedItem="{Binding FrameType, ElementName=_magnifier}" ItemsSource="{Binding Source={StaticResource enumData}}" Grid.Column="3" Margin="5" />
<TextBlock Text="Radius:" Grid.Row="1" Grid.Column="2" Visibility="{Binding ElementName=_frameType, Path=SelectedItem, Converter={StaticResource visibilityConverter}, ConverterParameter=0}" VerticalAlignment="Center" Margin="10,0,0,0"/>
<xctk:DoubleUpDown x:Name="_radius" Visibility="{Binding ElementName=_frameType, Path=SelectedItem, Converter={StaticResource visibilityConverter}, ConverterParameter=0}" Grid.Row="1" Grid.Column="3" Value="{Binding Radius, ElementName=_magnifier}" Minimum="0" Maximum="150" Margin="5" />
<TextBlock Text="RectangleWidth:" Grid.Row="1" Grid.Column="2" Visibility="{Binding ElementName=_frameType, Path=SelectedItem, Converter={StaticResource visibilityConverter}, ConverterParameter=1}" VerticalAlignment="Center" Margin="10,0,0,0"/>
<xctk:DoubleUpDown x:Name="_width" Grid.Row="1" Grid.Column="3" Value="{Binding Width, ElementName=_magnifier}" Minimum="0" Maximum="300" Visibility="{Binding ElementName=_frameType, Path=SelectedItem, Converter={StaticResource visibilityConverter}, ConverterParameter=1}" Margin="5" />
<TextBlock Text="RectangleHeight:" Grid.Row="2" Grid.Column="2" Visibility="{Binding ElementName=_frameType, Path=SelectedItem, Converter={StaticResource visibilityConverter}, ConverterParameter=1}" VerticalAlignment="Center" Margin="10,0,0,0"/>
<xctk:DoubleUpDown x:Name="_height" Grid.Row="2" Grid.Column="3" Value="{Binding Height, ElementName=_magnifier}" Minimum="0" Maximum="300" Visibility="{Binding ElementName=_frameType, Path=SelectedItem, Converter={StaticResource visibilityConverter}, ConverterParameter=1}" Margin="5" />
<!-- Third Column -->
<TextBlock Text="Border Thickness:" Grid.Column="4" VerticalAlignment="Center" Margin="5" />
<xctk:IntegerUpDown x:Name="_borderThickness" Grid.Column="5" Value="{Binding BorderThickness, ElementName=_magnifier, Converter={StaticResource BorderThicknessToStrokeThicknessConverter}}" Minimum="0" Maximum="20" Margin="5" />
<TextBlock Text="Border Brush:" Grid.Row="1" Grid.Column="4" VerticalAlignment="Center" Margin="5"/>
<xctk:ColorPicker x:Name="_colorPicker" Grid.Row="1" Grid.Column="5" Margin="5" SelectedColor="{Binding BorderBrush, ElementName=_magnifier, Converter={StaticResource SolidColorBrushToColorConverter}}"/>
</Grid>
</GroupBox>
<StackPanel Grid.Row="1" Margin="10" HorizontalAlignment="Left" >
<TextBlock Text="Usage:" Style="{StaticResource Header}"/>
<xctk:RichTextBox x:Name="_txtContent"
<StackPanel Grid.Row="1" Margin="10" HorizontalAlignment="Left" >
<TextBlock Text="Usage:" Style="{StaticResource Header}"/>
<xctk:RichTextBox x:Name="_txtContent"
IsReadOnly="True"
TextFormatter="{StaticResource rtfFormatter}"
FontSize="10" >
<xctk:MagnifierManager.Magnifier>
<xctk:Magnifier x:Name="_magnifier"
Background="White"
Radius="{Binding Source={x:Reference _radius}, Path=Value}"
ZoomFactor="{Binding Source={x:Reference _zoomFactor}, Path=Value}"
FrameType="{Binding Source={x:Reference _frameType}, Path=SelectedItem}"
BorderBrush="{Binding Source={x:Reference _colorPicker}, Path=SelectedColor, Converter={StaticResource colorConverter}}"
BorderThickness="{Binding Source={x:Reference _borderThickness}, Path=Value}"
Width="{Binding Source={x:Reference _width}, Path=Value, Mode=TwoWay}"
Height="{Binding Source={x:Reference _height}, Path=Value, Mode=TwoWay}" />
</xctk:MagnifierManager.Magnifier>
</xctk:RichTextBox>
</StackPanel>
</Grid>
<xctk:MagnifierManager.Magnifier>
<xctk:Magnifier x:Name="_magnifier"
Background="White"
Radius="80"
ZoomFactor="0.4"
FrameType="Circle"
BorderBrush="#FFEFAC27"
BorderThickness="2"
Width="160"
Height="160"
IsUsingZoomOnMouseWheel="True"
ZoomFactorOnMouseWheel="0.1"/>
</xctk:MagnifierManager.Magnifier>
</xctk:RichTextBox>
</StackPanel>
</Grid>
</local:DemoView>

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

@ -19,6 +19,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:local="clr-namespace:Xceed.Wpf.Toolkit.LiveExplorer"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
Title="TimeSpanUpDown">
<local:DemoView.Description>
<Paragraph FontSize="14"
@ -27,6 +28,14 @@
</Paragraph>
</local:DemoView.Description>
<local:DemoView.Resources>
<ObjectDataProvider x:Key="enumDateTimePart" MethodName="GetValues" ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="xctk:DateTimePart"/>
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
</local:DemoView.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
@ -40,6 +49,7 @@
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
@ -48,6 +58,7 @@
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<!-- 1st column-->
<TextBlock Text="Watermark:"
VerticalAlignment="Center" />
<TextBox x:Name="_watermark"
@ -77,7 +88,18 @@
Minimum="0"
HorizontalAlignment="Left"
Margin="5,5,25,5" />
<TextBlock Grid.Row="3"
Text="CurrentDateTimePart:"
VerticalAlignment="Center"/>
<ComboBox x:Name="_currentDateTimePart"
Grid.Row="3"
Grid.Column="1"
ItemsSource="{Binding Source={StaticResource enumDateTimePart}}"
SelectedItem="{Binding CurrentDateTimePart, ElementName=_timeSpanUpDown}"
Margin="5,5,25,5"
ToolTip="Must match a DateTimePart of the TimeSpanUpDown"/>
<!-- 2nd column-->
<TextBlock Grid.Column="2"
Text="DefaultValue:"
VerticalAlignment="Center"
@ -115,6 +137,21 @@
HorizontalAlignment="Left"
VerticalAlignment="Center"
Margin="5,5,25,5" />
<TextBlock Grid.Row="3"
Grid.Column="2"
Text="Step:"
VerticalAlignment="Center"
Margin="5" />
<xctk:IntegerUpDown x:Name="_step"
Grid.Row="3"
Grid.Column="3"
Value="{Binding Step, ElementName=_timeSpanUpDown}"
Maximum="10"
Minimum="1"
Width="100"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Margin="5,5,25,5" />
</Grid>
</GroupBox>
@ -132,7 +169,9 @@
Maximum="5.00:00:00"
Minimum="-5.00:00:00"
ClipValueToMinMax="False"
FractionalSecondsDigitsCount="0"/>
FractionalSecondsDigitsCount="0"
CurrentDateTimePart="Hour24"
Step="1"/>
</StackPanel>
</Grid>
</local:DemoView>

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
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion( "2.8.*" )]
[assembly: AssemblyFileVersion( "2.8.0.0" )]
[assembly: AssemblyVersion( "2.9.*" )]
[assembly: AssemblyFileVersion( "2.9.0.0" )]
#pragma warning disable 1699
[assembly: AssemblyDelaySign( false )]

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

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

35
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/DateTime/Views/DateTimeView.xaml

@ -47,7 +47,19 @@
<x:Type TypeName="sys:DateTimeKind" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
</local:DemoView.Resources>
<ObjectDataProvider x:Key="enumCalendarDisplayMode"
MethodName="GetValues"
ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="CalendarMode" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<ObjectDataProvider x:Key="enumDateTimePart" MethodName="GetValues" ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="xctk:DateTimePart"/>
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
</local:DemoView.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
@ -70,6 +82,7 @@
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
@ -90,12 +103,14 @@
<CheckBox x:Name="_clipValueToMinMax" Grid.Row="4" Grid.Column="1" IsChecked="False" VerticalAlignment="Center" Margin="5,5,25,5"/>
<TextBlock Text="Kind:" Grid.Row="5" Grid.Column="0" VerticalAlignment="Center"/>
<ComboBox x:Name="_kind" Grid.Row="5" Grid.Column="1" SelectedIndex="2" ItemsSource="{Binding Source={StaticResource enumKind}}" Width="190" Margin="5,5,25,5"/>
<TextBlock Text="ShowDropDownButton:" Grid.Row="6" Grid.Column="0" VerticalAlignment="Center"/>
<CheckBox x:Name="_showDropDownButton" Grid.Row="6" Grid.Column="1" IsChecked="True" VerticalAlignment="Center" Margin="5,5,25,5"/>
<TextBlock Text="TimePickerVisibility:" Grid.Row="7" Grid.Column="0" VerticalAlignment="Center"/>
<ComboBox x:Name="_timePickerVisibility" Grid.Row="7" Grid.Column="1" SelectedIndex="0" ItemsSource="{Binding Source={StaticResource enumVisibility}}" Width="190" Margin="5,5,25,5"/>
<TextBlock Text="TimePickerShowButtonSpinner:" Grid.Row="8" Grid.Column="0" VerticalAlignment="Center"/>
<CheckBox x:Name="_timePickerShowButtonSpinner" Grid.Row="8" Grid.Column="1" IsChecked="True" VerticalAlignment="Center" Margin="5,5,25,5"/>
<TextBlock Text="CalendarDisplayMode:" Grid.Row="6" Grid.Column="0" VerticalAlignment="Center"/>
<ComboBox x:Name="_calendarDisplayMode" Grid.Row="6" Grid.Column="1" SelectedIndex="0" ItemsSource="{Binding Source={StaticResource enumCalendarDisplayMode}}" Width="190" Margin="5,5,25,5"/>
<TextBlock Text="ShowDropDownButton:" Grid.Row="7" Grid.Column="0" VerticalAlignment="Center"/>
<CheckBox x:Name="_showDropDownButton" Grid.Row="7" Grid.Column="1" IsChecked="True" VerticalAlignment="Center" Margin="5,5,25,5"/>
<TextBlock Text="TimePickerVisibility:" Grid.Row="8" Grid.Column="0" VerticalAlignment="Center"/>
<ComboBox x:Name="_timePickerVisibility" Grid.Row="8" Grid.Column="1" SelectedIndex="0" ItemsSource="{Binding Source={StaticResource enumVisibility}}" Width="190" Margin="5,5,25,5"/>
<TextBlock Text="TimePickerShowButtonSpinner:" Grid.Row="9" Grid.Column="0" VerticalAlignment="Center"/>
<CheckBox x:Name="_timePickerShowButtonSpinner" Grid.Row="9" Grid.Column="1" IsChecked="True" VerticalAlignment="Center" Margin="5,5,25,5"/>
<TextBlock Text="TimeFormat:" Grid.Row="0" Grid.Column="2" VerticalAlignment="Center" />
<ComboBox x:Name="_timeFormat" Grid.Row="0" Grid.Column="3" SelectedIndex="7" ItemsSource="{Binding Source={StaticResource enumDateFormatData}}" Width="190" Margin="5"/>
@ -107,6 +122,8 @@
<xctk:DateTimeUpDown x:Name="_minimum" Grid.Row="3" Grid.Column="3" Format="Custom" FormatString="yyyy/MM/dd HH:mm" Value="2010/01/01T12:00" Width="190" VerticalAlignment="Center" Margin="5"/>
<TextBlock Text="Maximum:" Grid.Row="4" Grid.Column="2" VerticalAlignment="Center"/>
<xctk:DateTimeUpDown x:Name="_maximum" Grid.Row="4" Grid.Column="3" Format="Custom" FormatString="yyyy/MM/dd HH:mm" Value="2015/12/31T12:00" Width="190" VerticalAlignment="Center" Margin="5"/>
<TextBlock Text="CurrentDateTimePart:" Grid.Row="5" Grid.Column="2" VerticalAlignment="Center"/>
<ComboBox x:Name="_currentDateTimePart" Grid.Row="5" Grid.Column="3" SelectedIndex="0" ItemsSource="{Binding Source={StaticResource enumDateTimePart}}" Width="190" Margin="5" ToolTip="Must match a DateTimePart of the DateTimePicker Format."/>
</Grid>
</GroupBox>
@ -129,7 +146,9 @@
Minimum="{Binding Value, ElementName=_minimum}"
Maximum="{Binding Value, ElementName=_maximum}"
Kind="{Binding SelectedItem, ElementName=_kind}"
ShowDropDownButton="{Binding IsChecked, ElementName=_showDropDownButton}" />
CalendarDisplayMode="{Binding SelectedItem, ElementName=_calendarDisplayMode}"
ShowDropDownButton="{Binding IsChecked, ElementName=_showDropDownButton}"
CurrentDateTimePart="{Binding SelectedItem, ElementName=_currentDateTimePart, Mode=TwoWay}"/>
</StackPanel>
<StackPanel Grid.Row="1" Grid.Column="1" HorizontalAlignment="Stretch">

2
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/Magnifier/Converters/VisibilityConverter.cs

@ -60,7 +60,7 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Magnifier.Converters
}
}
return value;
return Visibility.Collapsed;
}
public object ConvertBack( object value, Type targetType, object parameter, System.Globalization.CultureInfo culture )

144
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/Magnifier/Views/MagnifierView.xaml

@ -22,78 +22,90 @@
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:conv="clr-namespace:Xceed.Wpf.Toolkit.LiveExplorer.Samples.Magnifier.Converters"
Title="Magnifier">
<local:DemoView.Description>
<Paragraph FontSize="14" FontFamily="Segoe">
The Magnifier control allows the user to magnify parts of an application.
</Paragraph>
</local:DemoView.Description>
<local:DemoView.Description>
<Paragraph FontSize="14" FontFamily="Segoe">
The Magnifier control allows the user to magnify parts of an application.
</Paragraph>
</local:DemoView.Description>
<local:DemoView.Resources>
<conv:ColorConverter x:Key="colorConverter" />
<conv:VisibilityConverter x:Key="visibilityConverter" />
<xctk:RtfFormatter x:Key="rtfFormatter" />
<local:DemoView.Resources>
<xctk:SolidColorBrushToColorConverter x:Key="SolidColorBrushToColorConverter" />
<conv:VisibilityConverter x:Key="visibilityConverter" />
<xctk:RtfFormatter x:Key="rtfFormatter" />
<xctk:BorderThicknessToStrokeThicknessConverter x:Key="BorderThicknessToStrokeThicknessConverter"/>
<ObjectDataProvider x:Key="enumData" MethodName="GetValues" ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="xctk:FrameType"/>
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
</local:DemoView.Resources>
<ObjectDataProvider x:Key="enumData" MethodName="GetValues" ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="xctk:FrameType"/>
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
</local:DemoView.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<GroupBox Header="Features" Grid.Row="0" Margin="5">
<Grid Margin="5" HorizontalAlignment="Left">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock Text="Zoom Factor:" VerticalAlignment="Center" Margin="5" />
<xctk:DoubleUpDown x:Name="_zoomFactor" Grid.Column="1" Value="0.4" Minimum="0" Increment="0.1" Maximum="3" FormatString="N1" Width="150" Margin="5" />
<TextBlock Text="Border Thickness:" Grid.Row="1" VerticalAlignment="Center" Margin="5" />
<xctk:IntegerUpDown x:Name="_borderThickness" Grid.Row="1" Grid.Column="1" Value="2" Minimum="0" Maximum="20" Width="150" Margin="5" />
<TextBlock Text="Border Brush:" Grid.Row="2" VerticalAlignment="Center" Margin="5"/>
<xctk:ColorPicker x:Name="_colorPicker" Grid.Row="2" Grid.Column="1" Width="150" Margin="5" SelectedColor="#FFEFAC27"/>
<TextBlock Grid.Column="2" Text="Frame Type:" VerticalAlignment="Center" Margin="10,0,0,0"/>
<ComboBox x:Name="_frameType" SelectedIndex="0" ItemsSource="{Binding Source={StaticResource enumData}}" Grid.Column="3" Width="150" Margin="5" />
<TextBlock Text="Radius:" Grid.Row="1" Grid.Column="2" Visibility="{Binding ElementName=_frameType, Path=SelectedItem, Converter={StaticResource visibilityConverter}, ConverterParameter=0}" VerticalAlignment="Center" Margin="10,0,0,0"/>
<xctk:DoubleUpDown x:Name="_radius" Visibility="{Binding ElementName=_frameType, Path=SelectedItem, Converter={StaticResource visibilityConverter}, ConverterParameter=0}" Grid.Row="1" Grid.Column="3" Value="80" Minimum="0" Maximum="150" Width="150" Margin="5" />
<TextBlock Text="RectangleWidth:" Grid.Row="1" Grid.Column="2" Visibility="{Binding ElementName=_frameType, Path=SelectedItem, Converter={StaticResource visibilityConverter}, ConverterParameter=1}" VerticalAlignment="Center" Margin="10,0,0,0"/>
<xctk:DoubleUpDown x:Name="_width" Grid.Row="1" Grid.Column="3" Value="160" Minimum="0" Maximum="300" Visibility="{Binding ElementName=_frameType, Path=SelectedItem, Converter={StaticResource visibilityConverter}, ConverterParameter=1}" Width="150" Margin="5" />
<TextBlock Text="RectangleHeight:" Grid.Row="2" Grid.Column="2" Visibility="{Binding ElementName=_frameType, Path=SelectedItem, Converter={StaticResource visibilityConverter}, ConverterParameter=1}" VerticalAlignment="Center" Margin="10,0,0,0"/>
<xctk:DoubleUpDown x:Name="_height" Grid.Row="2" Grid.Column="3" Value="160" Minimum="0" Maximum="300" Visibility="{Binding ElementName=_frameType, Path=SelectedItem, Converter={StaticResource visibilityConverter}, ConverterParameter=1}" Width="150" Margin="5" />
</Grid>
</GroupBox>
<GroupBox Header="Features" Grid.Row="0" Margin="5">
<Grid Margin="5" HorizontalAlignment="Left">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="100" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="100" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="100" />
</Grid.ColumnDefinitions>
<!-- First Column-->
<TextBlock Text="Zoom Factor:" VerticalAlignment="Center" Margin="5" />
<xctk:DoubleUpDown x:Name="_zoomFactor" Grid.Column="1" Value="{Binding ZoomFactor, ElementName=_magnifier}" Minimum="0" Increment="0.1" Maximum="3" FormatString="N1" Margin="5" />
<TextBlock Text="IsUsingZoomOnMouseWheel:" Grid.Row="1" VerticalAlignment="Center" Margin="5" />
<CheckBox x:Name="_isUsingZoomOnMouseWheel" Grid.Row="1" Grid.Column="1" IsChecked="{Binding IsUsingZoomOnMouseWheel, ElementName=_magnifier}" Margin="5" />
<TextBlock Text="ZoomFactorOnMouseWheel:" Grid.Row="2" VerticalAlignment="Center" Margin="5" />
<xctk:DoubleUpDown x:Name="_zoomFactorOnMouseWheel" Grid.Row="2" Grid.Column="1" Value="{Binding ZoomFactorOnMouseWheel, ElementName=_magnifier}" Minimum="0" Increment="0.05" Maximum="1" FormatString="N2" Margin="5" />
<!-- Second Column-->
<TextBlock Grid.Column="2" Text="Frame Type:" VerticalAlignment="Center" Margin="10,0,0,0"/>
<ComboBox x:Name="_frameType" SelectedItem="{Binding FrameType, ElementName=_magnifier}" ItemsSource="{Binding Source={StaticResource enumData}}" Grid.Column="3" Margin="5" />
<TextBlock Text="Radius:" Grid.Row="1" Grid.Column="2" Visibility="{Binding ElementName=_frameType, Path=SelectedItem, Converter={StaticResource visibilityConverter}, ConverterParameter=0}" VerticalAlignment="Center" Margin="10,0,0,0"/>
<xctk:DoubleUpDown x:Name="_radius" Visibility="{Binding ElementName=_frameType, Path=SelectedItem, Converter={StaticResource visibilityConverter}, ConverterParameter=0}" Grid.Row="1" Grid.Column="3" Value="{Binding Radius, ElementName=_magnifier}" Minimum="0" Maximum="150" Margin="5" />
<TextBlock Text="RectangleWidth:" Grid.Row="1" Grid.Column="2" Visibility="{Binding ElementName=_frameType, Path=SelectedItem, Converter={StaticResource visibilityConverter}, ConverterParameter=1}" VerticalAlignment="Center" Margin="10,0,0,0"/>
<xctk:DoubleUpDown x:Name="_width" Grid.Row="1" Grid.Column="3" Value="{Binding Width, ElementName=_magnifier}" Minimum="0" Maximum="300" Visibility="{Binding ElementName=_frameType, Path=SelectedItem, Converter={StaticResource visibilityConverter}, ConverterParameter=1}" Margin="5" />
<TextBlock Text="RectangleHeight:" Grid.Row="2" Grid.Column="2" Visibility="{Binding ElementName=_frameType, Path=SelectedItem, Converter={StaticResource visibilityConverter}, ConverterParameter=1}" VerticalAlignment="Center" Margin="10,0,0,0"/>
<xctk:DoubleUpDown x:Name="_height" Grid.Row="2" Grid.Column="3" Value="{Binding Height, ElementName=_magnifier}" Minimum="0" Maximum="300" Visibility="{Binding ElementName=_frameType, Path=SelectedItem, Converter={StaticResource visibilityConverter}, ConverterParameter=1}" Margin="5" />
<!-- Third Column -->
<TextBlock Text="Border Thickness:" Grid.Column="4" VerticalAlignment="Center" Margin="5" />
<xctk:IntegerUpDown x:Name="_borderThickness" Grid.Column="5" Value="{Binding BorderThickness, ElementName=_magnifier, Converter={StaticResource BorderThicknessToStrokeThicknessConverter}}" Minimum="0" Maximum="20" Margin="5" />
<TextBlock Text="Border Brush:" Grid.Row="1" Grid.Column="4" VerticalAlignment="Center" Margin="5"/>
<xctk:ColorPicker x:Name="_colorPicker" Grid.Row="1" Grid.Column="5" Margin="5" SelectedColor="{Binding BorderBrush, ElementName=_magnifier, Converter={StaticResource SolidColorBrushToColorConverter}}"/>
</Grid>
</GroupBox>
<StackPanel Grid.Row="1" Margin="10" HorizontalAlignment="Left" >
<TextBlock Text="Usage:" Style="{StaticResource Header}"/>
<xctk:RichTextBox x:Name="_txtContent"
<StackPanel Grid.Row="1" Margin="10" HorizontalAlignment="Left" >
<TextBlock Text="Usage:" Style="{StaticResource Header}"/>
<xctk:RichTextBox x:Name="_txtContent"
IsReadOnly="True"
TextFormatter="{StaticResource rtfFormatter}"
FontSize="10" >
<xctk:MagnifierManager.Magnifier>
<xctk:Magnifier x:Name="_magnifier"
Background="White"
Radius="{Binding Source={x:Reference _radius}, Path=Value}"
ZoomFactor="{Binding Source={x:Reference _zoomFactor}, Path=Value}"
FrameType="{Binding Source={x:Reference _frameType}, Path=SelectedItem}"
BorderBrush="{Binding Source={x:Reference _colorPicker}, Path=SelectedColor, Converter={StaticResource colorConverter}}"
BorderThickness="{Binding Source={x:Reference _borderThickness}, Path=Value}"
Width="{Binding Source={x:Reference _width}, Path=Value, Mode=TwoWay}"
Height="{Binding Source={x:Reference _height}, Path=Value, Mode=TwoWay}" />
</xctk:MagnifierManager.Magnifier>
</xctk:RichTextBox>
</StackPanel>
</Grid>
<xctk:MagnifierManager.Magnifier>
<xctk:Magnifier x:Name="_magnifier"
Background="White"
Radius="80"
ZoomFactor="0.4"
FrameType="Circle"
BorderBrush="#FFEFAC27"
BorderThickness="2"
Width="160"
Height="160"
IsUsingZoomOnMouseWheel="True"
ZoomFactorOnMouseWheel="0.1"/>
</xctk:MagnifierManager.Magnifier>
</xctk:RichTextBox>
</StackPanel>
</Grid>
</local:DemoView>

41
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/TimeSpan/Views/TimeSpanView.xaml

@ -19,6 +19,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:local="clr-namespace:Xceed.Wpf.Toolkit.LiveExplorer"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
Title="TimeSpanUpDown">
<local:DemoView.Description>
<Paragraph FontSize="14"
@ -27,6 +28,14 @@
</Paragraph>
</local:DemoView.Description>
<local:DemoView.Resources>
<ObjectDataProvider x:Key="enumDateTimePart" MethodName="GetValues" ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="xctk:DateTimePart"/>
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
</local:DemoView.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
@ -40,6 +49,7 @@
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
@ -48,6 +58,7 @@
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<!-- 1st column-->
<TextBlock Text="Watermark:"
VerticalAlignment="Center" />
<TextBox x:Name="_watermark"
@ -77,7 +88,18 @@
Minimum="0"
HorizontalAlignment="Left"
Margin="5,5,25,5" />
<TextBlock Grid.Row="3"
Text="CurrentDateTimePart:"
VerticalAlignment="Center"/>
<ComboBox x:Name="_currentDateTimePart"
Grid.Row="3"
Grid.Column="1"
ItemsSource="{Binding Source={StaticResource enumDateTimePart}}"
SelectedItem="{Binding CurrentDateTimePart, ElementName=_timeSpanUpDown}"
Margin="5,5,25,5"
ToolTip="Must match a DateTimePart of the TimeSpanUpDown"/>
<!-- 2nd column-->
<TextBlock Grid.Column="2"
Text="DefaultValue:"
VerticalAlignment="Center"
@ -115,6 +137,21 @@
HorizontalAlignment="Left"
VerticalAlignment="Center"
Margin="5,5,25,5" />
<TextBlock Grid.Row="3"
Grid.Column="2"
Text="Step:"
VerticalAlignment="Center"
Margin="5" />
<xctk:IntegerUpDown x:Name="_step"
Grid.Row="3"
Grid.Column="3"
Value="{Binding Step, ElementName=_timeSpanUpDown}"
Maximum="10"
Minimum="1"
Width="100"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Margin="5,5,25,5" />
</Grid>
</GroupBox>
@ -132,7 +169,9 @@
Maximum="5.00:00:00"
Minimum="-5.00:00:00"
ClipValueToMinMax="False"
FractionalSecondsDigitsCount="0"/>
FractionalSecondsDigitsCount="0"
CurrentDateTimePart="Hour24"
Step="1"/>
</StackPanel>
</Grid>
</local:DemoView>

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

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

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

@ -266,6 +266,15 @@ namespace Xceed.Wpf.Toolkit
break;
}
case Key.Enter:
{
//Do not Spin on enter Key when spinners have focus
if( this.IncreaseButton.IsFocused || this.DecreaseButton.IsFocused )
{
e.Handled = true;
}
break;
}
}
}

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

@ -436,6 +436,8 @@ namespace Xceed.Wpf.Toolkit
{
decimal currentValue = CalculatorUtilities.ParseDecimal( DisplayText );
_showNewNumber = true;
switch( buttonType )
{
case Calculator.CalculatorButtonType.MAdd:
@ -446,6 +448,7 @@ namespace Xceed.Wpf.Toolkit
break;
case Calculator.CalculatorButtonType.MR:
DisplayText = Memory.ToString();
_showNewNumber = false;
break;
case Calculator.CalculatorButtonType.MS:
Memory = currentValue;
@ -456,8 +459,6 @@ namespace Xceed.Wpf.Toolkit
default:
break;
}
_showNewNumber = true;
}
private void ProcessOperationKey( CalculatorButtonType buttonType )

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

@ -19,7 +19,8 @@
xmlns:local="clr-namespace:Xceed.Wpf.Toolkit"
xmlns:chrome="clr-namespace:Xceed.Wpf.Toolkit.Chromes"
xmlns:themes="clr-namespace:Xceed.Wpf.Toolkit.Themes"
xmlns:conv="clr-namespace:Xceed.Wpf.Toolkit.Core.Converters">
xmlns:conv="clr-namespace:Xceed.Wpf.Toolkit.Core.Converters"
xmlns:sys="clr-namespace:System;assembly=mscorlib">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../../Themes/Aero2/Common.xaml" />
@ -112,6 +113,7 @@
Foreground="{TemplateBinding Foreground}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
IsReadOnly="{Binding IsReadOnly, RelativeSource={RelativeSource TemplatedParent}}"
IsTabStop="{TemplateBinding IsTabStop}"
MinWidth="20"
AcceptsReturn="False"
Padding="{TemplateBinding Padding}"
@ -133,9 +135,21 @@
IsHitTestVisible="{Binding IsOpen, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource InverseBoolConverter}}" />
</Grid>
<Popup x:Name="PART_CalculatorPopup"
IsOpen="{Binding IsChecked, ElementName=_calculatorToggleButton}"
StaysOpen="False">
<Border BorderThickness="1" Background="{StaticResource PanelBackgroundBrush}" BorderBrush="{StaticResource PopupDarkBorderBrush}" Padding="3">
IsOpen="{Binding IsChecked, ElementName=_calculatorToggleButton}"
StaysOpen="False"
ToolTip="{x:Static sys:String.Empty}">
<Popup.Resources>
<Style TargetType="ToolTip">
<Style.Triggers>
<Trigger Property="Content"
Value="{x:Static sys:String.Empty}">
<Setter Property="Visibility"
Value="Collapsed" />
</Trigger>
</Style.Triggers>
</Style>
</Popup.Resources>
<Border BorderThickness="1" Background="{StaticResource PanelBackgroundBrush}" BorderBrush="{StaticResource PopupDarkBorderBrush}" Padding="3">
<StackPanel>
<local:Calculator x:Name="PART_Calculator"
Background="Transparent"

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

@ -19,7 +19,8 @@
xmlns:local="clr-namespace:Xceed.Wpf.Toolkit"
xmlns:themes="clr-namespace:Xceed.Wpf.Toolkit.Themes"
xmlns:chrome="clr-namespace:Xceed.Wpf.Toolkit.Chromes"
xmlns:conv="clr-namespace:Xceed.Wpf.Toolkit.Core.Converters">
xmlns:conv="clr-namespace:Xceed.Wpf.Toolkit.Core.Converters"
xmlns:sys="clr-namespace:System;assembly=mscorlib">
<conv:InverseBoolConverter x:Key="InverseBoolConverter" />
@ -123,6 +124,7 @@
Foreground="{TemplateBinding Foreground}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
IsReadOnly="{Binding IsReadOnly, RelativeSource={RelativeSource TemplatedParent}}"
IsTabStop="{TemplateBinding IsTabStop}"
MinWidth="20"
AcceptsReturn="False"
Padding="{TemplateBinding Padding}"
@ -144,7 +146,19 @@
IsHitTestVisible="{Binding IsOpen, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource InverseBoolConverter}}" />
<Popup x:Name="PART_CalculatorPopup"
IsOpen="{Binding IsChecked, ElementName=_calculatorToggleButton}"
StaysOpen="False">
StaysOpen="False"
ToolTip="{x:Static sys:String.Empty}">
<Popup.Resources>
<Style TargetType="ToolTip">
<Style.Triggers>
<Trigger Property="Content"
Value="{x:Static sys:String.Empty}">
<Setter Property="Visibility"
Value="Collapsed" />
</Trigger>
</Style.Triggers>
</Style>
</Popup.Resources>
<Border BorderThickness="1" Background="{StaticResource PopupBackgroundBrush}" BorderBrush="{StaticResource PopupDarkBorderBrush}" Padding="3">
<StackPanel>
<local:Calculator x:Name="PART_Calculator"

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

@ -367,8 +367,15 @@ namespace Xceed.Wpf.Toolkit
private void CanAddNew( object sender, CanExecuteRoutedEventArgs e )
{
Type t = e.Parameter as Type;
if( t != null && t.GetConstructor( Type.EmptyTypes ) != null && !IsReadOnly)
e.CanExecute = true;
if( (t != null) && !this.IsReadOnly )
{
bool isComplexStruct = t.IsValueType && !t.IsEnum && !t.IsPrimitive;
if( isComplexStruct || (t.GetConstructor( Type.EmptyTypes ) != null) )
{
e.CanExecute = true;
}
}
}
private void Delete( object sender, ExecutedRoutedEventArgs e )
@ -428,28 +435,12 @@ namespace Xceed.Wpf.Toolkit
#region Methods
private IList CreateItemsSource()
public void PersistChanges()
{
IList list = null;
if( ItemsSourceType != null )
{
ConstructorInfo constructor = ItemsSourceType.GetConstructor( Type.EmptyTypes );
if( constructor != null )
{
list = ( IList )constructor.Invoke( null );
}
}
return list;
this.PersistChanges( this.Items );
}
private object CreateNewItem( Type type )
{
return Activator.CreateInstance( type );
}
public void PersistChanges()
internal void PersistChanges( IList sourceList )
{
IList list = ComputeItemsSource();
if( list == null )
@ -460,18 +451,39 @@ namespace Xceed.Wpf.Toolkit
if( list.IsFixedSize )
{
for( int i = 0; i < Items.Count; ++i )
list[ i ] = Items[ i ];
for( int i = 0; i < sourceList.Count; ++i )
list[ i ] = sourceList[ i ];
}
else
{
foreach( var item in Items )
foreach( var item in sourceList )
{
list.Add( item );
}
}
}
private IList CreateItemsSource()
{
IList list = null;
if( ItemsSourceType != null )
{
ConstructorInfo constructor = ItemsSourceType.GetConstructor( Type.EmptyTypes );
if( constructor != null )
{
list = ( IList )constructor.Invoke( null );
}
}
return list;
}
private object CreateNewItem( Type type )
{
return Activator.CreateInstance( type );
}
private IList ComputeItemsSource()
{
if( ItemsSource == null )

2
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/CollectionControl/Implementation/CollectionControlButton.cs

@ -116,7 +116,7 @@ namespace Xceed.Wpf.Toolkit
private void CollectionControlButton_Click( object sender, RoutedEventArgs e )
{
CollectionControlDialog collectionControlDialog = new CollectionControlDialog();
var collectionControlDialog = new CollectionControlDialog();
collectionControlDialog.ItemsSource = this.ItemsSource;
collectionControlDialog.NewItemTypes = this.NewItemTypes;
collectionControlDialog.ItemsSourceType = this.ItemsSourceType;

43
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/CollectionControl/Implementation/CollectionControlDialog.xaml

@ -14,14 +14,14 @@
**********************************************************************************-->
<Window x:Class="Xceed.Wpf.Toolkit.CollectionControlDialog"
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"
Title="Collection Control"
Height="400"
Width="600"
WindowStartupLocation="CenterScreen">
<local:CollectionControlDialogBase x:Class="Xceed.Wpf.Toolkit.CollectionControlDialog"
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"
Title="Collection Control"
Height="400"
Width="600"
WindowStartupLocation="CenterScreen">
<Grid Margin="10">
<Grid.RowDefinitions>
@ -30,15 +30,24 @@
</Grid.RowDefinitions>
<local:CollectionControl x:Name="_collectionControl"
ItemsSourceType="{Binding ItemsSourceType, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}"
ItemsSource="{Binding ItemsSource, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}, Mode=TwoWay}"
NewItemTypes="{Binding NewItemTypes, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}"
IsReadOnly="{Binding IsReadOnly, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}"/>
<StackPanel Orientation="Horizontal" Grid.Row="1" HorizontalAlignment="Right" Margin="5">
<Button Width="75" Margin="2" Click="OkButton_Click" IsDefault="True">OK</Button>
<Button Width="75" Margin="2" Click="CancelButton_Click" IsCancel="True">Cancel</Button>
ItemsSourceType="{Binding ItemsSourceType, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}"
ItemsSource="{Binding ItemsSource, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}, Mode=TwoWay}"
NewItemTypes="{Binding NewItemTypes, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}"
IsReadOnly="{Binding IsReadOnly, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}" />
<StackPanel Orientation="Horizontal"
Grid.Row="1"
HorizontalAlignment="Right"
Margin="5">
<Button Width="75"
Margin="2"
Click="OkButton_Click"
IsDefault="True">OK</Button>
<Button Width="75"
Margin="2"
Click="CancelButton_Click"
IsCancel="True">Cancel</Button>
</StackPanel>
</Grid>
</Window>
</local:CollectionControlDialogBase>

83
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/CollectionControl/Implementation/CollectionControlDialog.xaml.cs

@ -18,15 +18,27 @@ using System;
using System.Collections;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Media;
namespace Xceed.Wpf.Toolkit
{
public partial class CollectionControlDialogBase :
Window
{
}
/// <summary>
/// Interaction logic for CollectionControlDialog.xaml
/// </summary>
public partial class CollectionControlDialog : Window
public partial class CollectionControlDialog : CollectionControlDialogBase
{
#region Properties
#region Private Members
private IList originalData = new List<object>();
#endregion
#region Properties
public static readonly DependencyProperty ItemsSourceProperty = DependencyProperty.Register( "ItemsSource", typeof( IList ), typeof( CollectionControlDialog ), new UIPropertyMetadata( null ) );
public IList ItemsSource
@ -88,9 +100,9 @@ namespace Xceed.Wpf.Toolkit
}
}
#endregion //Properties
#endregion //Properties
#region Constructors
#region Constructors
public CollectionControlDialog()
{
@ -109,23 +121,76 @@ namespace Xceed.Wpf.Toolkit
NewItemTypes = newItemTypes;
}
#endregion //Constructors
#endregion //Constructors
#region Event Handlers
#region Overrides
protected override void OnSourceInitialized( EventArgs e )
{
base.OnSourceInitialized( e );
//Backup data in case "Cancel" is clicked.
if( this.ItemsSource != null )
{
foreach( var item in this.ItemsSource )
{
originalData.Add( this.Clone( item ) );
}
}
}
#endregion
#region Event Handlers
private void OkButton_Click( object sender, RoutedEventArgs e )
{
_collectionControl.PersistChanges();
this.DialogResult = true;
Close();
this.Close();
}
private void CancelButton_Click( object sender, RoutedEventArgs e )
{
_collectionControl.PersistChanges( originalData );
this.DialogResult = false;
Close();
this.Close();
}
#endregion //Event Hanlders
#region Private Methods
private object Clone( object source )
{
var sourceType = source.GetType();
//Get default constructor
var result = sourceType.GetConstructor( new Type[] { } ).Invoke( null );
var properties = sourceType.GetProperties();
foreach( var propertyInfo in properties )
{
var propertyInfoValue = propertyInfo.GetValue( source, null );
if( propertyInfo.CanWrite )
{
//Look for nested object
if( propertyInfo.PropertyType.IsClass && (propertyInfo.PropertyType != typeof(Transform)) && !propertyInfo.PropertyType.Equals( typeof( string ) ) )
{
var nestedObject = this.Clone( propertyInfoValue );
propertyInfo.SetValue( result, nestedObject, null );
}
else
{
// copy object
propertyInfo.SetValue( result, propertyInfoValue, null );
}
}
}
return result;
}
#endregion //Event Hanlders
#endregion
}
}

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

@ -208,7 +208,7 @@ namespace Xceed.Wpf.Toolkit
#region IsOpen
public static readonly DependencyProperty IsOpenProperty = DependencyProperty.Register( "IsOpen", typeof( bool ), typeof( ColorPicker ), new UIPropertyMetadata( false ) );
public static readonly DependencyProperty IsOpenProperty = DependencyProperty.Register( "IsOpen", typeof( bool ), typeof( ColorPicker ), new UIPropertyMetadata( false, OnIsOpenChanged ) );
public bool IsOpen
{
get
@ -221,6 +221,19 @@ namespace Xceed.Wpf.Toolkit
}
}
private static void OnIsOpenChanged( DependencyObject d, DependencyPropertyChangedEventArgs e )
{
ColorPicker colorPicker = (ColorPicker)d;
if( colorPicker != null )
colorPicker.OnIsOpenChanged( (bool)e.OldValue, (bool)e.NewValue );
}
private void OnIsOpenChanged( bool oldValue, bool newValue )
{
RoutedEventArgs args = new RoutedEventArgs( newValue ? OpenedEvent : ClosedEvent, this );
this.RaiseEvent( args );
}
#endregion //IsOpen
#region RecentColors
@ -629,6 +642,8 @@ namespace Xceed.Wpf.Toolkit
#region Events
#region SelectedColorChangedEvent
public static readonly RoutedEvent SelectedColorChangedEvent = EventManager.RegisterRoutedEvent( "SelectedColorChanged", RoutingStrategy.Bubble, typeof( RoutedPropertyChangedEventHandler<Color?> ), typeof( ColorPicker ) );
public event RoutedPropertyChangedEventHandler<Color?> SelectedColorChanged
{
@ -642,6 +657,42 @@ namespace Xceed.Wpf.Toolkit
}
}
#endregion
#region OpenedEvent
public static readonly RoutedEvent OpenedEvent = EventManager.RegisterRoutedEvent( "OpenedEvent", RoutingStrategy.Bubble, typeof( RoutedEventHandler ), typeof( ColorPicker ) );
public event RoutedEventHandler Opened
{
add
{
AddHandler( OpenedEvent, value );
}
remove
{
RemoveHandler( OpenedEvent, value );
}
}
#endregion //OpenedEvent
#region ClosedEvent
public static readonly RoutedEvent ClosedEvent = EventManager.RegisterRoutedEvent( "ClosedEvent", RoutingStrategy.Bubble, typeof( RoutedEventHandler ), typeof( ColorPicker ) );
public event RoutedEventHandler Closed
{
add
{
AddHandler( ClosedEvent, value );
}
remove
{
RemoveHandler( ClosedEvent, value );
}
}
#endregion //ClosedEvent
#endregion //Events
#region Methods

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

@ -286,7 +286,19 @@
Focusable="False"
HorizontalOffset="1"
VerticalOffset="1"
PopupAnimation="Slide">
PopupAnimation="Slide"
ToolTip="{x:Static sys:String.Empty}">
<Popup.Resources>
<Style TargetType="ToolTip">
<Style.Triggers>
<Trigger Property="Content"
Value="{x:Static sys:String.Empty}">
<Setter Property="Visibility"
Value="Collapsed" />
</Trigger>
</Style.Triggers>
</Style>
</Popup.Resources>
<Border BorderThickness="1"
Background="{StaticResource PanelBackgroundBrush}"
BorderBrush="{StaticResource PopupDarkBorderBrush}"

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

@ -231,7 +231,27 @@
</Grid>
</ToggleButton>
<Popup x:Name="PART_ColorPickerPalettePopup" VerticalAlignment="Bottom" IsOpen="{Binding ElementName=PART_ColorPickerToggleButton, Path=IsChecked}" StaysOpen="False" AllowsTransparency="True" Focusable="False" HorizontalOffset="1" VerticalOffset="1" PopupAnimation="Slide">
<Popup x:Name="PART_ColorPickerPalettePopup"
VerticalAlignment="Bottom"
IsOpen="{Binding ElementName=PART_ColorPickerToggleButton, Path=IsChecked}"
StaysOpen="False"
AllowsTransparency="True"
Focusable="False"
HorizontalOffset="1"
VerticalOffset="1"
PopupAnimation="Slide"
ToolTip="{x:Static sys:String.Empty}">
<Popup.Resources>
<Style TargetType="ToolTip">
<Style.Triggers>
<Trigger Property="Content"
Value="{x:Static sys:String.Empty}">
<Setter Property="Visibility"
Value="Collapsed" />
</Trigger>
</Style.Triggers>
</Style>
</Popup.Resources>
<Border BorderThickness="1" Background="{StaticResource PopupBackgroundBrush}" BorderBrush="{StaticResource ColorPickerDarkBorderBrush}" Padding="3">
<Grid>
<Grid.RowDefinitions>

35
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Core/Converters/NullToBoolConverter.cs

@ -0,0 +1,35 @@
/*************************************************************************************
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 NullToBoolConverter : IValueConverter
{
public object Convert( object value, Type targetType, object parameter, CultureInfo culture )
{
return (value == null);
}
public object ConvertBack( object value, Type targetType, object parameter, CultureInfo culture )
{
throw new NotImplementedException();
}
}
}

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

@ -234,7 +234,9 @@ namespace Xceed.Wpf.Toolkit.Core.Utilities
public static decimal ParseDecimal( string text )
{
return Decimal.Parse( text, CultureInfo.CurrentCulture );
decimal result;
var success = Decimal.TryParse( text, NumberStyles.Any, CultureInfo.CurrentCulture, out result );
return success ? result : decimal.Zero;
}
public static decimal Add( decimal firstNumber, decimal secondNumber )

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

@ -63,6 +63,24 @@ namespace Xceed.Wpf.Toolkit
#endregion //AutoCloseCalendar
#region CalendarDisplayMode
public static readonly DependencyProperty CalendarDisplayModeProperty = DependencyProperty.Register( "CalendarDisplayMode", typeof( CalendarMode )
, typeof( DateTimePicker ), new UIPropertyMetadata( CalendarMode.Month ) );
public CalendarMode CalendarDisplayMode
{
get
{
return (CalendarMode)GetValue( CalendarDisplayModeProperty );
}
set
{
SetValue( CalendarDisplayModeProperty, value );
}
}
#endregion //CalendarDisplayMode
#region TimeFormat
public static readonly DependencyProperty TimeFormatProperty = DependencyProperty.Register( "TimeFormat", typeof( DateTimeFormat ), typeof( DateTimePicker ), new UIPropertyMetadata( DateTimeFormat.ShortTime ) );

242
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/DateTimePicker/Themes/Aero2.NormalColor.xaml

@ -19,82 +19,83 @@
xmlns:local="clr-namespace:Xceed.Wpf.Toolkit"
xmlns:themes="clr-namespace:Xceed.Wpf.Toolkit.Themes"
xmlns:chrome="clr-namespace:Xceed.Wpf.Toolkit.Chromes"
xmlns:conv="clr-namespace:Xceed.Wpf.Toolkit.Core.Converters">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../../Themes/Aero2/Common.xaml" />
</ResourceDictionary.MergedDictionaries>
<conv:InverseBoolConverter x:Key="InverseBoolConverter" />
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
<DataTemplate x:Key="DefaultWatermarkTemplate">
<ContentControl Content="{Binding}" Foreground="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" Focusable="False" Margin="0,0,3,0" />
</DataTemplate>
<Style x:Key="DateTimePickerToggleButtonStyle" TargetType="ToggleButton">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ToggleButton">
<Grid SnapsToDevicePixels="True">
<chrome:ButtonChrome x:Name="ToggleButtonChrome"
xmlns:conv="clr-namespace:Xceed.Wpf.Toolkit.Core.Converters"
xmlns:sys="clr-namespace:System;assembly=mscorlib">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../../Themes/Aero2/Common.xaml" />
</ResourceDictionary.MergedDictionaries>
<conv:InverseBoolConverter x:Key="InverseBoolConverter" />
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
<DataTemplate x:Key="DefaultWatermarkTemplate">
<ContentControl Content="{Binding}" Foreground="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" Focusable="False" Margin="0,0,3,0" />
</DataTemplate>
<Style x:Key="DateTimePickerToggleButtonStyle" TargetType="ToggleButton">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ToggleButton">
<Grid SnapsToDevicePixels="True">
<chrome:ButtonChrome x:Name="ToggleButtonChrome"
CornerRadius="0"
RenderChecked="{Binding IsOpen, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:DateTimePicker}}"
RenderEnabled="{Binding IsEnabled, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:DateTimePicker}}"
RenderMouseOver="{TemplateBinding IsMouseOver}"
RenderPressed="{TemplateBinding IsPressed}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<ContentPresenter HorizontalAlignment="Stretch" VerticalAlignment="Stretch" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
<Grid x:Name="arrowGlyph" IsHitTestVisible="False" Grid.Column="1" Margin="5">
<Path x:Name="Arrow" Width="7" Height="4" Data="M 0,1 C0,1 0,0 0,0 0,0 3,0 3,0 3,0 3,1 3,1 3,1 4,1 4,1 4,1 4,0 4,0 4,0 7,0 7,0 7,0 7,1 7,1 7,1 6,1 6,1 6,1 6,2 6,2 6,2 5,2 5,2 5,2 5,3 5,3 5,3 4,3 4,3 4,3 4,4 4,4 4,4 3,4 3,4 3,4 3,3 3,3 3,3 2,3 2,3 2,3 2,2 2,2 2,2 1,2 1,2 1,2 1,1 1,1 1,1 0,1 0,1 z" Fill="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
</Grid>
</Grid>
</chrome:ButtonChrome>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Fill" TargetName="Arrow" Value="#AFAFAF" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- =============================================================================== -->
<!-- DateTimePicker -->
<!-- =============================================================================== -->
<Style TargetType="{x:Type local:DateTimePicker}">
<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" />
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}" />
<Setter Property="BorderBrush" Value="{DynamicResource {x:Static themes:ResourceKeys.ControlNormalBorderKey}}" />
<Setter Property="BorderThickness" Value="1,1,0,1" />
<Setter Property="Focusable" Value="False" />
<Setter Property="HorizontalContentAlignment" Value="Right" />
<Setter Property="TextAlignment" Value="Right" />
<Setter Property="TimeWatermarkTemplate" Value="{StaticResource DefaultWatermarkTemplate}" />
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="WatermarkTemplate" Value="{StaticResource DefaultWatermarkTemplate}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type local:DateTimePicker}">
<Border>
<Grid>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<local:ButtonSpinner x:Name="PART_Spinner"
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<ContentPresenter HorizontalAlignment="Stretch" VerticalAlignment="Stretch" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
<Grid x:Name="arrowGlyph" IsHitTestVisible="False" Grid.Column="1" Margin="5">
<Path x:Name="Arrow" Width="7" Height="4" Data="M 0,1 C0,1 0,0 0,0 0,0 3,0 3,0 3,0 3,1 3,1 3,1 4,1 4,1 4,1 4,0 4,0 4,0 7,0 7,0 7,0 7,1 7,1 7,1 6,1 6,1 6,1 6,2 6,2 6,2 5,2 5,2 5,2 5,3 5,3 5,3 4,3 4,3 4,3 4,4 4,4 4,4 3,4 3,4 3,4 3,3 3,3 3,3 2,3 2,3 2,3 2,2 2,2 2,2 1,2 1,2 1,2 1,1 1,1 1,1 0,1 0,1 z" Fill="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
</Grid>
</Grid>
</chrome:ButtonChrome>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Fill" TargetName="Arrow" Value="#AFAFAF" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- =============================================================================== -->
<!-- DateTimePicker -->
<!-- =============================================================================== -->
<Style TargetType="{x:Type local:DateTimePicker}">
<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" />
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}" />
<Setter Property="BorderBrush" Value="{DynamicResource {x:Static themes:ResourceKeys.ControlNormalBorderKey}}" />
<Setter Property="BorderThickness" Value="1,1,0,1" />
<Setter Property="Focusable" Value="False" />
<Setter Property="HorizontalContentAlignment" Value="Right" />
<Setter Property="TextAlignment" Value="Right" />
<Setter Property="TimeWatermarkTemplate" Value="{StaticResource DefaultWatermarkTemplate}" />
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="WatermarkTemplate" Value="{StaticResource DefaultWatermarkTemplate}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type local:DateTimePicker}">
<Border>
<Grid>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<local:ButtonSpinner x:Name="PART_Spinner"
IsTabStop="False"
Background="{TemplateBinding Background}"
BorderThickness="{TemplateBinding BorderThickness}"
@ -104,7 +105,7 @@
VerticalContentAlignment="Stretch"
AllowSpin="{TemplateBinding AllowSpin}"
ShowButtonSpinner="{TemplateBinding ShowButtonSpinner}">
<local:WatermarkTextBox x:Name="PART_TextBox"
<local:WatermarkTextBox x:Name="PART_TextBox"
BorderThickness="0"
Background="Transparent"
FontFamily="{TemplateBinding FontFamily}"
@ -116,6 +117,7 @@
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
IsUndoEnabled="{Binding IsUndoEnabled, RelativeSource={RelativeSource TemplatedParent}}"
IsTabStop="{TemplateBinding IsTabStop}"
MinWidth="20"
AcceptsReturn="False"
Padding="{TemplateBinding Padding}"
@ -125,8 +127,8 @@
TabIndex="{TemplateBinding TabIndex}"
Watermark="{TemplateBinding Watermark}"
WatermarkTemplate="{TemplateBinding WatermarkTemplate}" />
</local:ButtonSpinner>
<ToggleButton x:Name="_calendarToggleButton"
</local:ButtonSpinner>
<ToggleButton x:Name="_calendarToggleButton"
Grid.Column="1"
Background="White"
Focusable="False"
@ -135,12 +137,28 @@
IsHitTestVisible="{Binding IsOpen, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource InverseBoolConverter}}"
IsEnabled="{Binding IsReadOnly, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource InverseBoolConverter}}"
Visibility="{TemplateBinding ShowDropDownButton, Converter={StaticResource BooleanToVisibilityConverter}}" />
</Grid>
<Popup x:Name="PART_Popup" IsOpen="{Binding IsChecked, ElementName=_calendarToggleButton}" StaysOpen="False">
<Border BorderThickness="1" Background="{StaticResource PanelBackgroundBrush}" BorderBrush="{StaticResource PopupDarkBorderBrush}" Padding="3">
<StackPanel>
<Calendar x:Name="PART_Calendar" BorderThickness="0" />
<local:TimePicker x:Name="PART_TimeUpDown"
</Grid>
<Popup x:Name="PART_Popup"
IsOpen="{Binding IsChecked, ElementName=_calendarToggleButton}"
StaysOpen="False"
ToolTip="{x:Static sys:String.Empty}">
<Popup.Resources>
<Style TargetType="ToolTip">
<Style.Triggers>
<Trigger Property="Content"
Value="{x:Static sys:String.Empty}">
<Setter Property="Visibility"
Value="Collapsed" />
</Trigger>
</Style.Triggers>
</Style>
</Popup.Resources>
<Border BorderThickness="1" Background="{StaticResource PanelBackgroundBrush}" BorderBrush="{StaticResource PopupDarkBorderBrush}" Padding="3">
<StackPanel>
<Calendar x:Name="PART_Calendar"
BorderThickness="0"
DisplayMode="{Binding CalendarDisplayMode, RelativeSource={RelativeSource TemplatedParent}}"/>
<local:TimePicker x:Name="PART_TimeUpDown"
Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"
Foreground="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}"
Format="{TemplateBinding TimeFormat}"
@ -156,45 +174,45 @@
Watermark="{TemplateBinding TimeWatermark}"
WatermarkTemplate="{TemplateBinding TimeWatermarkTemplate}"
Visibility="{TemplateBinding TimePickerVisibility}"/>
</StackPanel>
</Border>
</Popup>
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="BorderBrush" Value="{DynamicResource {x:Static themes:ResourceKeys.ControlMouseOverBorderKey}}" />
</Trigger>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding IsReadOnly, RelativeSource={RelativeSource Self}}"
</StackPanel>
</Border>
</Popup>
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="BorderBrush" Value="{DynamicResource {x:Static themes:ResourceKeys.ControlMouseOverBorderKey}}" />
</Trigger>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding IsReadOnly, RelativeSource={RelativeSource Self}}"
Value="False" />
<Condition Binding="{Binding AllowTextInput, RelativeSource={RelativeSource Self}}"
<Condition Binding="{Binding AllowTextInput, RelativeSource={RelativeSource Self}}"
Value="False" />
</MultiDataTrigger.Conditions>
<Setter Property="IsReadOnly"
</MultiDataTrigger.Conditions>
<Setter Property="IsReadOnly"
Value="True"
TargetName="PART_TextBox" />
</MultiDataTrigger>
<DataTrigger Binding="{Binding IsReadOnly, RelativeSource={RelativeSource Self}}"
</MultiDataTrigger>
<DataTrigger Binding="{Binding IsReadOnly, RelativeSource={RelativeSource Self}}"
Value="True">
<Setter Property="IsReadOnly"
<Setter Property="IsReadOnly"
Value="True"
TargetName="PART_TextBox" />
</DataTrigger>
<Trigger Property="IsKeyboardFocusWithin" Value="True">
<Setter Property="BorderBrush" Value="{DynamicResource {x:Static themes:ResourceKeys.ControlSelectedBorderKey}}" />
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
</Trigger>
<Trigger Property="IsFocused" Value="True">
<Setter TargetName="PART_TextBox" Property="FocusManager.FocusedElement" Value="{Binding ElementName=PART_TextBox}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</DataTrigger>
<Trigger Property="IsKeyboardFocusWithin" Value="True">
<Setter Property="BorderBrush" Value="{DynamicResource {x:Static themes:ResourceKeys.ControlSelectedBorderKey}}" />
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
</Trigger>
<Trigger Property="IsFocused" Value="True">
<Setter TargetName="PART_TextBox" Property="FocusManager.FocusedElement" Value="{Binding ElementName=PART_TextBox}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>

24
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/DateTimePicker/Themes/Generic.xaml

@ -19,7 +19,8 @@
xmlns:local="clr-namespace:Xceed.Wpf.Toolkit"
xmlns:themes="clr-namespace:Xceed.Wpf.Toolkit.Themes"
xmlns:chrome="clr-namespace:Xceed.Wpf.Toolkit.Chromes"
xmlns:conv="clr-namespace:Xceed.Wpf.Toolkit.Core.Converters">
xmlns:conv="clr-namespace:Xceed.Wpf.Toolkit.Core.Converters"
xmlns:sys="clr-namespace:System;assembly=mscorlib">
<conv:InverseBoolConverter x:Key="InverseBoolConverter" />
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
@ -127,6 +128,7 @@
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
IsUndoEnabled="{Binding IsUndoEnabled, RelativeSource={RelativeSource TemplatedParent}}"
IsTabStop="{TemplateBinding IsTabStop}"
MinWidth="20"
AcceptsReturn="False"
Padding="{TemplateBinding Padding}"
@ -147,10 +149,26 @@
IsEnabled="{Binding IsReadOnly, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource InverseBoolConverter}}"
Visibility="{TemplateBinding ShowDropDownButton, Converter={StaticResource BooleanToVisibilityConverter}}"/>
</Grid>
<Popup x:Name="PART_Popup" IsOpen="{Binding IsChecked, ElementName=_calendarToggleButton}" StaysOpen="False">
<Popup x:Name="PART_Popup"
IsOpen="{Binding IsChecked, ElementName=_calendarToggleButton}"
StaysOpen="False"
ToolTip="{x:Static sys:String.Empty}">
<Popup.Resources>
<Style TargetType="ToolTip">
<Style.Triggers>
<Trigger Property="Content"
Value="{x:Static sys:String.Empty}">
<Setter Property="Visibility"
Value="Collapsed" />
</Trigger>
</Style.Triggers>
</Style>
</Popup.Resources>
<Border BorderThickness="1" Background="{StaticResource PopupBackgroundBrush}" BorderBrush="{StaticResource PopupDarkBorderBrush}" Padding="3">
<StackPanel>
<Calendar x:Name="PART_Calendar" BorderThickness="0" />
<Calendar x:Name="PART_Calendar"
BorderThickness="0"
DisplayMode="{Binding CalendarDisplayMode, RelativeSource={RelativeSource TemplatedParent}}" />
<local:TimePicker x:Name="PART_TimeUpDown"
Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"
Foreground="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}"

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

@ -216,7 +216,7 @@ namespace Xceed.Wpf.Toolkit
if( this.IsCurrentValueValid() )
{
if( Value.HasValue )
UpdateDateTime( 1 );
UpdateDateTime( this.Step );
else
Value = DefaultValue ?? this.ContextNow;
}
@ -227,7 +227,7 @@ namespace Xceed.Wpf.Toolkit
if( this.IsCurrentValueValid() )
{
if( Value.HasValue )
UpdateDateTime( -1 );
UpdateDateTime( -this.Step );
else
Value = DefaultValue ?? this.ContextNow;
}
@ -319,6 +319,13 @@ namespace Xceed.Wpf.Toolkit
protected override void OnValueChanged( DateTime? oldValue, DateTime? newValue )
{
_fireSelectionChangedEvent = false;
DateTimeInfo info = _selectedDateTimeInfo;
//this only occurs when the user manually type in a value for the Value Property
if( info == null )
info = (this.CurrentDateTimePart != DateTimePart.Other) ? this.GetDateTimeInfo( this.CurrentDateTimePart ) : _dateTimeInfoList[ 0 ];
//whenever the value changes we need to parse out the value into out DateTimeInfo segments so we can keep track of the individual pieces
//but only if it is not null
if( newValue != null )
@ -330,12 +337,18 @@ namespace Xceed.Wpf.Toolkit
{
_lastValidDate = newValue;
}
if( TextBox != null )
{
//we loose our selection when the Value is set so we need to reselect it without firing the selection changed event
TextBox.Select( info.StartPosition, info.Length );
}
_fireSelectionChangedEvent = true;
}
protected override void RaiseValueChangedEvent( DateTime? oldValue, DateTime? newValue )
{
if( ( this.TemplatedParent is TimePicker )
&& ( ( TimePicker )this.TemplatedParent ).TemplatedParent is DateTimePicker )
if( ( this is TimePicker ) && ( this.TemplatedParent is DateTimePicker ) )
return;
base.RaiseValueChangedEvent( oldValue, newValue );
@ -756,12 +769,11 @@ namespace Xceed.Wpf.Toolkit
private void UpdateDateTime( int value )
{
_fireSelectionChangedEvent = false;
DateTimeInfo info = _selectedDateTimeInfo;
//this only occurs when the user manually type in a value for the Value Property
if( info == null )
info = _dateTimeInfoList[ 0 ];
info = (this.CurrentDateTimePart != DateTimePart.Other) ? this.GetDateTimeInfo( this.CurrentDateTimePart ) : _dateTimeInfoList[ 0 ];
DateTime? result = null;
@ -826,10 +838,6 @@ namespace Xceed.Wpf.Toolkit
}
this.Value = this.CoerceValueMinMax( result );
//we loose our selection when the Value is set so we need to reselect it without firing the selection changed event
TextBox.Select( info.StartPosition, info.Length );
_fireSelectionChangedEvent = true;
}
private bool TryParseDateTime( string text, out DateTime result )

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

@ -65,6 +65,7 @@
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
IsUndoEnabled="{Binding IsUndoEnabled, RelativeSource={RelativeSource TemplatedParent}}"
IsTabStop="{TemplateBinding IsTabStop}"
MinWidth="20"
AcceptsReturn="False"
Padding="{TemplateBinding Padding}"

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

@ -78,6 +78,7 @@
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
IsUndoEnabled="{Binding IsUndoEnabled, RelativeSource={RelativeSource TemplatedParent}}"
IsTabStop="{TemplateBinding IsTabStop}"
MinWidth="20"
AcceptsReturn="False"
Padding="{TemplateBinding Padding}"

17
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/DropDownButton/Themes/Aero2.NormalColor.xaml

@ -19,7 +19,8 @@
xmlns:chrome="clr-namespace:Xceed.Wpf.Toolkit.Chromes"
xmlns:conv="clr-namespace:Xceed.Wpf.Toolkit.Core.Converters"
xmlns:themes="clr-namespace:Xceed.Wpf.Toolkit.Themes"
xmlns:local="clr-namespace:Xceed.Wpf.Toolkit">
xmlns:local="clr-namespace:Xceed.Wpf.Toolkit"
xmlns:sys="clr-namespace:System;assembly=mscorlib">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../../Themes/Aero2/Common.xaml" />
@ -104,7 +105,19 @@
StaysOpen="False"
Placement="Bottom"
Focusable="False"
IsOpen="{Binding IsChecked, ElementName=PART_DropDownButton}">
IsOpen="{Binding IsChecked, ElementName=PART_DropDownButton}"
ToolTip="{x:Static sys:String.Empty}">
<Popup.Resources>
<Style TargetType="ToolTip">
<Style.Triggers>
<Trigger Property="Content"
Value="{x:Static sys:String.Empty}">
<Setter Property="Visibility"
Value="Collapsed" />
</Trigger>
</Style.Triggers>
</Style>
</Popup.Resources>
<Border BorderThickness="1"
Background="{StaticResource PanelBackgroundBrush}"
BorderBrush="{StaticResource PopupDarkBorderBrush}"

17
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/DropDownButton/Themes/Generic.xaml

@ -19,7 +19,8 @@
xmlns:chrome="clr-namespace:Xceed.Wpf.Toolkit.Chromes"
xmlns:conv="clr-namespace:Xceed.Wpf.Toolkit.Core.Converters"
xmlns:themes="clr-namespace:Xceed.Wpf.Toolkit.Themes"
xmlns:local="clr-namespace:Xceed.Wpf.Toolkit">
xmlns:local="clr-namespace:Xceed.Wpf.Toolkit"
xmlns:sys="clr-namespace:System;assembly=mscorlib">
<conv:InverseBoolConverter x:Key="InverseBoolConverter" />
@ -122,7 +123,19 @@
StaysOpen="False"
Placement="Bottom"
Focusable="False"
IsOpen="{Binding IsChecked, ElementName=PART_DropDownButton}">
IsOpen="{Binding IsChecked, ElementName=PART_DropDownButton}"
ToolTip="{x:Static sys:String.Empty}">
<Popup.Resources>
<Style TargetType="ToolTip">
<Style.Triggers>
<Trigger Property="Content"
Value="{x:Static sys:String.Empty}">
<Setter Property="Visibility"
Value="Collapsed" />
</Trigger>
</Style.Triggers>
</Style>
</Popup.Resources>
<Border BorderThickness="1"
Background="{StaticResource PopupBackgroundBrush}"
BorderBrush="{StaticResource PopupDarkBorderBrush}"

52
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Magnifier/Implementation/Magnifier.cs

@ -63,6 +63,24 @@ namespace Xceed.Wpf.Toolkit
#endregion //FrameType
#region IsUsingZoomOnMouseWheel
public static readonly DependencyProperty IsUsingZoomOnMouseWheelProperty = DependencyProperty.Register( "IsUsingZoomOnMouseWheel", typeof( bool )
, typeof( Magnifier ), new UIPropertyMetadata( true ) );
public bool IsUsingZoomOnMouseWheel
{
get
{
return (bool)GetValue( IsUsingZoomOnMouseWheelProperty );
}
set
{
SetValue( IsUsingZoomOnMouseWheelProperty, value );
}
}
#endregion //IsUsingZoomOnMouseWheel
#region Radius
public static readonly DependencyProperty RadiusProperty = DependencyProperty.Register( "Radius", typeof( double ), typeof( Magnifier ), new FrameworkPropertyMetadata( ( Magnifier.DEFAULT_SIZE / 2 ), new PropertyChangedCallback( OnRadiusPropertyChanged ) ) );
@ -158,6 +176,40 @@ namespace Xceed.Wpf.Toolkit
#endregion //ZoomFactor
#region ZoomFactorOnMouseWheel
public static readonly DependencyProperty ZoomFactorOnMouseWheelProperty = DependencyProperty.Register( "ZoomFactorOnMouseWheel", typeof( double )
, typeof( Magnifier ), new FrameworkPropertyMetadata( 0.1d, OnZoomFactorOnMouseWheelPropertyChanged ), OnZoomFactorOnMouseWheelValidationCallback );
public double ZoomFactorOnMouseWheel
{
get
{
return (double)GetValue( ZoomFactorOnMouseWheelProperty );
}
set
{
SetValue( ZoomFactorOnMouseWheelProperty, value );
}
}
private static bool OnZoomFactorOnMouseWheelValidationCallback( object baseValue )
{
double zoomFactorOnMouseWheel = (double)baseValue;
return (zoomFactorOnMouseWheel >= 0);
}
private static void OnZoomFactorOnMouseWheelPropertyChanged( DependencyObject d, DependencyPropertyChangedEventArgs e )
{
Magnifier m = (Magnifier)d;
m.OnZoomFactorOnMouseWheelChanged( e );
}
protected virtual void OnZoomFactorOnMouseWheelChanged( DependencyPropertyChangedEventArgs e )
{
}
#endregion //ZoomFactorOnMouseWheel
#endregion //Properties
#region Constructors

38
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Magnifier/Implementation/MagnifierManager.cs

@ -57,25 +57,53 @@ namespace Xceed.Wpf.Toolkit
#region Event Handlers
void Element_MouseLeave( object sender, MouseEventArgs e )
private void Element_MouseLeave( object sender, MouseEventArgs e )
{
HideAdorner();
}
void Element_MouseEnter( object sender, MouseEventArgs e )
private void Element_MouseEnter( object sender, MouseEventArgs e )
{
ShowAdorner();
}
#endregion //Event Handlers
private void Element_MouseWheel( object sender, MouseWheelEventArgs e )
{
var magnifier = MagnifierManager.GetMagnifier( _element ) as Magnifier;
if( (magnifier != null) && magnifier.IsUsingZoomOnMouseWheel )
{
if( e.Delta < 0 )
{
var newValue = magnifier.ZoomFactor + magnifier.ZoomFactorOnMouseWheel;
#if VS2008
magnifier.ZoomFactor = newValue;
#else
magnifier.SetCurrentValue( Magnifier.ZoomFactorProperty, newValue );
#endif
}
else if ( e.Delta > 0 )
{
var newValue = (magnifier.ZoomFactor >= magnifier.ZoomFactorOnMouseWheel) ? magnifier.ZoomFactor - magnifier.ZoomFactorOnMouseWheel : 0d;
#if VS2008
magnifier.ZoomFactor = newValue;
#else
magnifier.SetCurrentValue( Magnifier.ZoomFactorProperty, newValue );
#endif
}
_adorner.UpdateViewBox();
}
}
#endregion //Event Handlers
#region Methods
#region Methods
private void AttachToMagnifier( UIElement element, Magnifier magnifier )
{
_element = element;
_element.MouseEnter += Element_MouseEnter;
_element.MouseLeave += Element_MouseLeave;
_element.MouseWheel += Element_MouseWheel;
magnifier.Target = _element;
@ -109,6 +137,6 @@ namespace Xceed.Wpf.Toolkit
}
}
#endregion //Methods
#endregion //Methods
}
}

17
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/MultiLineTextEditor/Themes/Aero2.NormalColor.xaml

@ -19,7 +19,8 @@
xmlns:local="clr-namespace:Xceed.Wpf.Toolkit"
xmlns:chrome="clr-namespace:Xceed.Wpf.Toolkit.Chromes"
xmlns:themes="clr-namespace:Xceed.Wpf.Toolkit.Themes"
xmlns:conv="clr-namespace:Xceed.Wpf.Toolkit.Core.Converters">
xmlns:conv="clr-namespace:Xceed.Wpf.Toolkit.Core.Converters"
xmlns:sys="clr-namespace:System;assembly=mscorlib">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../../Themes/Aero2/Common.xaml" />
@ -145,7 +146,19 @@
Focusable="False"
PopupAnimation="Slide"
Width="{TemplateBinding DropDownWidth}"
Height="{TemplateBinding DropDownHeight}">
Height="{TemplateBinding DropDownHeight}"
ToolTip="{x:Static sys:String.Empty}">
<Popup.Resources>
<Style TargetType="ToolTip">
<Style.Triggers>
<Trigger Property="Content"
Value="{x:Static sys:String.Empty}">
<Setter Property="Visibility"
Value="Collapsed" />
</Trigger>
</Style.Triggers>
</Style>
</Popup.Resources>
<Border BorderThickness="1"
Background="White"
BorderBrush="{StaticResource PopupDarkBorderBrush}">

17
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/MultiLineTextEditor/Themes/Generic.xaml

@ -18,7 +18,8 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Xceed.Wpf.Toolkit"
xmlns:chrome="clr-namespace:Xceed.Wpf.Toolkit.Chromes"
xmlns:conv="clr-namespace:Xceed.Wpf.Toolkit.Core.Converters">
xmlns:conv="clr-namespace:Xceed.Wpf.Toolkit.Core.Converters"
xmlns:sys="clr-namespace:System;assembly=mscorlib">
<conv:InverseBoolConverter x:Key="InverseBoolConverter" />
@ -132,7 +133,19 @@
Focusable="False"
PopupAnimation="Slide"
Width="{TemplateBinding DropDownWidth}"
Height="{TemplateBinding DropDownHeight}">
Height="{TemplateBinding DropDownHeight}"
ToolTip="{x:Static sys:String.Empty}">
<Popup.Resources>
<Style TargetType="ToolTip">
<Style.Triggers>
<Trigger Property="Content"
Value="{x:Static sys:String.Empty}">
<Setter Property="Visibility"
Value="Collapsed" />
</Trigger>
</Style.Triggers>
</Style>
</Popup.Resources>
<Border BorderThickness="1" Background="{StaticResource PopupBackgroundBrush}" BorderBrush="{StaticResource PopupDarkBorderBrush}">
<Grid>
<TextBox x:Name="PART_TextBox"

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

@ -36,11 +36,75 @@ namespace Xceed.Wpf.Toolkit.Primitives
#endregion //Members
#region Properties
#region CurrentDateTimePart
public static readonly DependencyProperty CurrentDateTimePartProperty = DependencyProperty.Register( "CurrentDateTimePart", typeof( DateTimePart )
, typeof( DateTimeUpDownBase<T> ), new UIPropertyMetadata( DateTimePart.Other, OnCurrentDateTimePartChanged ) );
public DateTimePart CurrentDateTimePart
{
get
{
return (DateTimePart)GetValue( CurrentDateTimePartProperty );
}
set
{
SetValue( CurrentDateTimePartProperty, value );
}
}
private static void OnCurrentDateTimePartChanged( DependencyObject o, DependencyPropertyChangedEventArgs e )
{
DateTimeUpDownBase<T> dateTimeUpDownBase = o as DateTimeUpDownBase<T>;
if( dateTimeUpDownBase != null )
dateTimeUpDownBase.OnCurrentDateTimePartChanged( (DateTimePart)e.OldValue, (DateTimePart)e.NewValue );
}
protected virtual void OnCurrentDateTimePartChanged( DateTimePart oldValue, DateTimePart newValue )
{
this.Select( this.GetDateTimeInfo( newValue ) );
}
#endregion //CurrentDateTimePart
#region Step
public static readonly DependencyProperty StepProperty = DependencyProperty.Register( "Step", typeof( int )
, typeof( DateTimeUpDownBase<T> ), new UIPropertyMetadata( 1, OnStepChanged ) );
public int Step
{
get
{
return (int)GetValue( StepProperty );
}
set
{
SetValue( StepProperty, value );
}
}
private static void OnStepChanged( DependencyObject o, DependencyPropertyChangedEventArgs e )
{
var dateTimeUpDownBase = o as DateTimeUpDownBase<T>;
if( dateTimeUpDownBase != null )
dateTimeUpDownBase.OnStepChanged( (int)e.OldValue, (int)e.NewValue );
}
protected virtual void OnStepChanged( int oldValue, int newValue )
{
}
#endregion //Step
#endregion
#region Constructors
internal DateTimeUpDownBase()
{
this.InitializeDateTimeInfoList();
this.Loaded += this.DateTimeUpDownBase_Loaded;
}
#endregion
@ -51,7 +115,6 @@ namespace Xceed.Wpf.Toolkit.Primitives
{
if( this.TextBox != null )
{
this.TextBox.GotFocus -= new RoutedEventHandler( this.TextBox_GotFocus );
this.TextBox.SelectionChanged -= this.TextBox_SelectionChanged;
}
@ -59,7 +122,6 @@ namespace Xceed.Wpf.Toolkit.Primitives
if( this.TextBox != null )
{
this.TextBox.GotFocus += new RoutedEventHandler( this.TextBox_GotFocus );
this.TextBox.SelectionChanged += this.TextBox_SelectionChanged;
}
}
@ -150,12 +212,9 @@ namespace Xceed.Wpf.Toolkit.Primitives
_fireSelectionChangedEvent = true;
}
private void TextBox_GotFocus( object sender, RoutedEventArgs e )
private void DateTimeUpDownBase_Loaded( object sender, RoutedEventArgs e )
{
if( _selectedDateTimeInfo == null )
{
this.Select( this.GetDateTimeInfo( 0 ) );
}
this.InitSelection();
}
#endregion
@ -192,14 +251,24 @@ namespace Xceed.Wpf.Toolkit.Primitives
( info.StartPosition <= selectionStart ) && ( selectionStart < ( info.StartPosition + info.Length ) ) );
}
internal DateTimeInfo GetDateTimeInfo( DateTimePart part )
{
return _dateTimeInfoList.FirstOrDefault( ( info ) =>info.Type == part );
}
internal void Select( DateTimeInfo info )
{
if( info != null )
if( (info != null) && !info.Equals( _selectedDateTimeInfo ) && ( this.TextBox != null) && !string.IsNullOrEmpty( this.TextBox.Text ) )
{
_fireSelectionChangedEvent = false;
this.TextBox.Select( info.StartPosition, info.Length );
_fireSelectionChangedEvent = true;
_selectedDateTimeInfo = info;
#if VS2008
this.CurrentDateTimePart = info.Type;
#else
this.SetCurrentValue( DateTimeUpDownBase<T>.CurrentDateTimePartProperty, info.Type );
#endif
}
}
@ -301,6 +370,14 @@ namespace Xceed.Wpf.Toolkit.Primitives
return previousDateTimeInfo;
}
private void InitSelection()
{
if( _selectedDateTimeInfo == null )
{
this.Select( (this.CurrentDateTimePart != DateTimePart.Other) ? this.GetDateTimeInfo( this.CurrentDateTimePart ) : this.GetDateTimeInfo( 0 ) );
}
}
#endregion
}
}

4
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Primitives/Themes/Aero2/WindowControl.xaml

@ -25,7 +25,7 @@
<ResourceDictionary Source="../../../Themes/Aero2/Common.xaml" />
</ResourceDictionary.MergedDictionaries>
<sys:Double x:Key="TopBorderThumbHeight">8</sys:Double>
<sys:Double x:Key="TopBorderThumbHeight">5</sys:Double>
<conv:WindowContentBorderMarginConverter x:Key="WindowContentBorderMarginConverter" />
<conv:WindowControlBackgroundConverter x:Key="WindowControlBackgroundConverter" />
@ -65,7 +65,7 @@
<ColumnDefinition x:Name="HeaderButtonsColumn" Width="Auto"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition x:Name="HeaderRow" Height="22" />
<RowDefinition x:Name="HeaderRow" Height="28" />
<RowDefinition Height="{Binding WindowThickness.Top, RelativeSource={RelativeSource TemplatedParent}}" />
</Grid.RowDefinitions>

4
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Primitives/Themes/Generic/WindowControl.xaml

@ -25,7 +25,7 @@
<ResourceDictionary Source="../../../Themes/Generic/Common.xaml" />
</ResourceDictionary.MergedDictionaries>
<sys:Double x:Key="TopBorderThumbHeight">8</sys:Double>
<sys:Double x:Key="TopBorderThumbHeight">5</sys:Double>
<conv:WindowContentBorderMarginConverter x:Key="WindowContentBorderMarginConverter" />
<conv:WindowControlBackgroundConverter x:Key="WindowControlBackgroundConverter" />
@ -67,7 +67,7 @@
<ColumnDefinition x:Name="HeaderButtonsColumn" Width="Auto"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition x:Name="HeaderRow" Height="22" />
<RowDefinition x:Name="HeaderRow" Height="28" />
<RowDefinition Height="{Binding WindowThickness.Top, RelativeSource={RelativeSource TemplatedParent}}" />
</Grid.RowDefinitions>

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

@ -566,6 +566,8 @@ namespace Xceed.Wpf.Toolkit.Primitives
public event InputValidationErrorEventHandler InputValidationError;
public event EventHandler<SpinEventArgs> Spinned;
#region ValueChanged Event
//Due to a bug in Visual Studio, you cannot create event handlers for generic T args in XAML, so I have to use object instead.
@ -593,6 +595,13 @@ namespace Xceed.Wpf.Toolkit.Primitives
if( e == null )
throw new ArgumentNullException( "e" );
// Raise the Spinned event to user
EventHandler<SpinEventArgs> handler = this.Spinned;
if( handler != null )
{
handler( this, e );
}
if( e.Direction == SpinDirection.Increase )
DoIncrement();
else

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

@ -0,0 +1,65 @@
/*************************************************************************************
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.ComponentModel;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Media;
namespace Xceed.Wpf.Toolkit.PropertyGrid
{
public class CategoryGroupStyleSelector : StyleSelector
{
public Style SingleDefaultCategoryItemGroupStyle
{
get;
set;
}
public Style ItemGroupStyle
{
get;
set;
}
public override Style SelectStyle( object item, DependencyObject container )
{
var group = item as CollectionViewGroup;
// Category is not "Misc" => use regular ItemGroupStyle
if( !group.Name.Equals( CategoryAttribute.Default.Category ) )
return this.ItemGroupStyle;
// Category is "Misc"
while( container != null )
{
container = VisualTreeHelper.GetParent( container );
if( container is ItemsControl )
break;
}
var itemsControl = container as ItemsControl;
if( itemsControl != null )
{
// Category is "Misc" and this is the only category => use SingleDefaultCategoryItemGroupContainerStyle
if( (itemsControl.Items.Count > 0) && (itemsControl.Items.Groups.Count == 1) )
return this.SingleDefaultCategoryItemGroupStyle;
}
// Category is "Misc" and this is NOT the only category => use regular ItemGroupStyle
return this.ItemGroupStyle;
}
}
}

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

@ -101,7 +101,7 @@ namespace Xceed.Wpf.Toolkit.PropertyGrid
//Bind the value property with the source object.
var binding = new Binding( PropertyDescriptor.Name )
{
Source = SelectedObject,
Source = this.GetValueInstance( SelectedObject ),
Mode = PropertyDescriptor.IsReadOnly ? BindingMode.OneWay : BindingMode.TwoWay,
ValidatesOnDataErrors = true,
ValidatesOnExceptions = true,

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

@ -152,15 +152,12 @@ namespace Xceed.Wpf.Toolkit.PropertyGrid
bool isResource = false;
bool isDynamicResource = false;
var markupProperty = markupObject.Properties.Where( p => p.Name == PropertyName ).FirstOrDefault();
if( ( markupProperty != null )
&& ( markupProperty.PropertyType != typeof( object ) )
&& !markupProperty.PropertyType.IsEnum
&& !markupProperty.PropertyType.IsArray )
{
//TODO: need to find a better way to determine if a StaticResource has been applied to any property not just a style
isResource = ( markupProperty.Value is Style );
isDynamicResource = ( markupProperty.Value is DynamicResourceExtension );
var markupProperty = markupObject.Properties.FirstOrDefault( p => p.Name == PropertyName );
if( markupProperty != null )
{
//TODO: need to find a better way to determine if a StaticResource has been applied to any property not just a style(maybe with StaticResourceExtension)
isResource = typeof( Style ).IsAssignableFrom( markupProperty.PropertyType );
isDynamicResource = typeof( DynamicResourceExtension ).IsAssignableFrom( markupProperty.PropertyType );
}
if( isResource || isDynamicResource )
@ -293,6 +290,15 @@ namespace Xceed.Wpf.Toolkit.PropertyGrid
return this.ComputeDisplayOrder( isPropertyGridCategorized );
}
internal object GetValueInstance( object sourceObject )
{
ICustomTypeDescriptor customTypeDescriptor = sourceObject as ICustomTypeDescriptor;
if( customTypeDescriptor != null )
sourceObject = customTypeDescriptor.GetPropertyOwner( PropertyDescriptor );
return sourceObject;
}
#endregion
#region Private Methods

2
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/PropertyGrid/Implementation/Editors/FontComboBoxEditor.cs

@ -28,7 +28,7 @@ namespace Xceed.Wpf.Toolkit.PropertyGrid.Editors
protected override IEnumerable CreateItemsSource( PropertyItem propertyItem )
{
if( propertyItem.PropertyType == typeof( FontFamily ) )
return FontUtilities.Families;
return FontUtilities.Families.OrderBy( x => x.Source);
else if( propertyItem.PropertyType == typeof( FontWeight ) )
return FontUtilities.Weights;
else if( propertyItem.PropertyType == typeof( FontStyle ) )

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

@ -49,5 +49,7 @@ namespace Xceed.Wpf.Toolkit.PropertyGrid
bool HideInheritedProperties { get; }
FilterInfo FilterInfo { get; }
bool? IsPropertyVisible( PropertyDescriptor pd );
}
}

17
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/PropertyGrid/Implementation/ObjectContainerHelper.cs

@ -59,11 +59,22 @@ namespace Xceed.Wpf.Toolkit.PropertyGrid
foreach( var descriptor in descriptors )
{
var propertyDef = this.GetPropertyDefinition( descriptor );
bool isBrowsable = descriptor.IsBrowsable && this.PropertyContainer.AutoGenerateProperties;
if( propertyDef != null )
bool isBrowsable = false;
var isPropertyBrowsable = this.PropertyContainer.IsPropertyVisible( descriptor );
if( isPropertyBrowsable.HasValue )
{
isBrowsable = isPropertyBrowsable.Value;
}
else
{
isBrowsable = propertyDef.IsBrowsable.GetValueOrDefault( isBrowsable );
isBrowsable = descriptor.IsBrowsable && this.PropertyContainer.AutoGenerateProperties;
if( propertyDef != null )
{
isBrowsable = propertyDef.IsBrowsable.GetValueOrDefault( isBrowsable );
}
}
if( isBrowsable )
{
var prop = this.CreatePropertyItem( descriptor, propertyDef );

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

@ -258,9 +258,20 @@ namespace Xceed.Wpf.Toolkit.PropertyGrid
if( tc == null || !tc.GetPropertiesSupported() )
{
if( instance is ICustomTypeDescriptor )
descriptors = ( ( ICustomTypeDescriptor )instance ).GetProperties();
{
descriptors = ((ICustomTypeDescriptor)instance).GetProperties();
}
//ICustomTypeProvider is only available in .net 4.5 and over. Use reflection so the .net 4.0 and .net 3.5 still works.
else if( instance.GetType().GetInterface( "ICustomTypeProvider", true ) != null )
{
var methodInfo = instance.GetType().GetMethod( "GetCustomType" );
var result = methodInfo.Invoke( instance, null ) as Type;
descriptors = TypeDescriptor.GetProperties( result );
}
else
{
descriptors = TypeDescriptor.GetProperties( instance.GetType() );
}
}
else
{

71
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/PropertyGrid/Implementation/PropertyGrid.cs

@ -1071,6 +1071,12 @@ namespace Xceed.Wpf.Toolkit.PropertyGrid
#endregion
#region IsPropertyBrowsable Event
public event IsPropertyBrowsableHandler IsPropertyBrowsable;
#endregion
#region PreparePropertyItemEvent Attached Routed Event
/// <summary>
@ -1234,6 +1240,21 @@ namespace Xceed.Wpf.Toolkit.PropertyGrid
}
bool? IPropertyContainer.IsPropertyVisible( PropertyDescriptor pd )
{
var handler = this.IsPropertyBrowsable;
//If anyone is registered to PropertyGrid.IsPropertyBrowsable event
if( handler != null )
{
var isBrowsableArgs = new IsPropertyBrowsableArgs( pd );
handler( this, isBrowsableArgs );
return isBrowsableArgs.IsBrowsable;
}
return null;
}
#endregion
@ -1290,4 +1311,54 @@ namespace Xceed.Wpf.Toolkit.PropertyGrid
}
#endregion
#region isPropertyBrowsableEvent Handler/Args
public delegate void IsPropertyBrowsableHandler( object sender, IsPropertyBrowsableArgs e );
public class IsPropertyBrowsableArgs : RoutedEventArgs
{
#region Constructors
public IsPropertyBrowsableArgs( PropertyDescriptor pd )
{
this.PropertyDescriptor = pd;
}
#endregion
#region Properties
#region IsBrowsable Property
public bool IsBrowsable
{
get
{
return _isBrowsable;
}
set
{
_isBrowsable = value;
}
}
private bool _isBrowsable = true;
#endregion
#region PropertyDescriptor Property
public PropertyDescriptor PropertyDescriptor
{
get;
private set;
}
#endregion
#endregion
}
#endregion
}

10
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/PropertyGrid/Implementation/PropertyItemBase.cs

@ -498,6 +498,16 @@ namespace Xceed.Wpf.Toolkit.PropertyGrid
get { return new FilterInfo(); }
}
bool? IPropertyContainer.IsPropertyVisible( PropertyDescriptor pd )
{
if( _parentNode != null )
{
return _parentNode.IsPropertyVisible( pd );
}
return null;
}
#endregion
}

1229
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/PropertyGrid/Themes/Aero2.NormalColor.xaml

File diff suppressed because it is too large

32
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/PropertyGrid/Themes/Generic.xaml

@ -41,10 +41,12 @@
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
<conv:InverseBoolConverter x:Key="InverseBoolConverter" />
<conv:HalfConverter x:Key="HalfConverter" />
<conv:NullToBoolConverter x:Key="NullToBoolConverter" />
<pgconv:ObjectToUIElementConverter x:Key="ObjectToUIElementConverter" />
<pgconv:IsStringEmptyConverter x:Key="IsStringEmptyConverter" />
<pgconv:ExpandableObjectMarginConverter x:Key="ExpandableObjectMarginConverter" />
<pgconv:IsDefaultCategoryConverter x:Key="IsDefaultCategoryConverter" />
<pgconv:SelectedObjectConverter x:Key="objectConverter" />
<x:Static x:Key="EmptyString"
Member="sys:String.Empty" />
@ -880,7 +882,7 @@
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GroupItem}">
<!-- No Expander for the Misc Category -->
<!-- No Expander for the Misc Category if IsMiscCategoryLabelHidden == true-->
<ItemsPresenter />
</ControlTemplate>
</Setter.Value>
@ -889,6 +891,18 @@
</Style.Triggers>
</Style>
<Style x:Key="SingleDefaultCategoryItemGroupContainerStyle"
TargetType="{x:Type GroupItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<!-- No Expander for the Misc Category if Misc category is the only category-->
<ItemsPresenter />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<ContextMenu x:Key="{ComponentResourceKey
TypeInTargetAssembly={x:Type pg:PropertyGrid},
ResourceId=SelectedObjectAdvancedOptionsMenu}">
@ -896,6 +910,11 @@
Command="commands:PropertyItemCommands.ResetValue" />
</ContextMenu>
<pg:CategoryGroupStyleSelector x:Key="categoryGroupStyleSelector"
SingleDefaultCategoryItemGroupStyle="{StaticResource SingleDefaultCategoryItemGroupContainerStyle}"
ItemGroupStyle="{StaticResource PropertyItemGroupContainerStyle}" />
<Style TargetType="{x:Type pg:PropertyItemBase}">
<Setter Property="Background"
@ -1015,7 +1034,7 @@
</ItemsControl.ItemsPanel>
<ItemsControl.GroupStyle>
<GroupStyle ContainerStyle="{StaticResource PropertyItemGroupContainerStyle}" />
<GroupStyle ContainerStyleSelector="{StaticResource categoryGroupStyleSelector}" />
</ItemsControl.GroupStyle>
</pg:PropertyItemsControl>
@ -1113,9 +1132,6 @@
</Style>
<Style TargetType="{x:Type pg:PropertyGrid}">
<Style.Resources>
<pgconv:SelectedObjectConverter x:Key="objectConverter" />
</Style.Resources>
<Setter Property="AdvancedOptionsMenu"
Value="{StaticResource {ComponentResourceKey TypeInTargetAssembly={x:Type pg:PropertyGrid}, ResourceId=SelectedObjectAdvancedOptionsMenu}}" />
<Setter Property="Background"
@ -1145,7 +1161,8 @@
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal">
<StackPanel x:Name="selectObjectNamePanel"
Orientation="Horizontal">
<Border Background="White"
BorderBrush="Black"
Visibility="{Binding ShowPreview, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BooleanToVisibilityConverter}}"
@ -1178,6 +1195,7 @@
</StackPanel>
</StackPanel>
<Grid x:Name="toolsContainer"
Grid.Row="1"
Margin="4,0,4,4">
@ -1270,7 +1288,7 @@
</ItemsControl.ItemsPanel>
<ItemsControl.GroupStyle>
<GroupStyle ContainerStyle="{StaticResource PropertyItemGroupContainerStyle}" />
<GroupStyle ContainerStyleSelector="{StaticResource categoryGroupStyleSelector}" />
</ItemsControl.GroupStyle>
</pg:PropertyItemsControl>

6
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/StyleableWindow/Implementation/Converters/StyleableWindowClippingBorderConverter.cs

@ -28,10 +28,8 @@ namespace Xceed.Wpf.Toolkit.Converters
{
public object Convert( object value, Type targetType, object parameter, CultureInfo culture )
{
Type aa = value.GetType();
Type b = parameter.GetType();
double borderThickness = ( double )value - double.Parse( (string)parameter );
return new Thickness( borderThickness, borderThickness, borderThickness, borderThickness );
double borderThickness = (double)value;
return new Thickness( borderThickness, borderThickness, borderThickness, borderThickness * 2);
}
public object ConvertBack( object value, Type targetType, object parameter, CultureInfo culture )

18
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/TimePicker/Themes/Aero2.NormalColor.xaml

@ -19,7 +19,8 @@
xmlns:local="clr-namespace:Xceed.Wpf.Toolkit"
xmlns:chrome="clr-namespace:Xceed.Wpf.Toolkit.Chromes"
xmlns:themes="clr-namespace:Xceed.Wpf.Toolkit.Themes"
xmlns:conv="clr-namespace:Xceed.Wpf.Toolkit.Core.Converters">
xmlns:conv="clr-namespace:Xceed.Wpf.Toolkit.Core.Converters"
xmlns:sys="clr-namespace:System;assembly=mscorlib">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../../Themes/Aero2/Common.xaml" />
@ -163,6 +164,7 @@
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
IsUndoEnabled="{Binding IsUndoEnabled, RelativeSource={RelativeSource TemplatedParent}}"
IsTabStop="{TemplateBinding IsTabStop}"
MinWidth="20"
AcceptsReturn="False"
Padding="{TemplateBinding Padding}"
@ -185,7 +187,19 @@
<Popup x:Name="PART_Popup"
IsOpen="{Binding IsChecked, ElementName=_timePickerToggleButton}"
AllowsTransparency="True"
StaysOpen="False">
StaysOpen="False"
ToolTip="{x:Static sys:String.Empty}">
<Popup.Resources>
<Style TargetType="ToolTip">
<Style.Triggers>
<Trigger Property="Content"
Value="{x:Static sys:String.Empty}">
<Setter Property="Visibility"
Value="Collapsed" />
</Trigger>
</Style.Triggers>
</Style>
</Popup.Resources>
<Border BorderThickness="1"
MinWidth="{Binding ActualWidth, ElementName=root}"
MaxHeight="{TemplateBinding MaxDropDownHeight}"

18
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/TimePicker/Themes/Generic.xaml

@ -19,7 +19,8 @@
xmlns:local="clr-namespace:Xceed.Wpf.Toolkit"
xmlns:themes="clr-namespace:Xceed.Wpf.Toolkit.Themes"
xmlns:chrome="clr-namespace:Xceed.Wpf.Toolkit.Chromes"
xmlns:conv="clr-namespace:Xceed.Wpf.Toolkit.Core.Converters">
xmlns:conv="clr-namespace:Xceed.Wpf.Toolkit.Core.Converters"
xmlns:sys="clr-namespace:System;assembly=mscorlib">
<!-- =============================================================================== -->
<!-- ResourceDictionary for TimePicker and related controls -->
@ -144,6 +145,7 @@
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
IsUndoEnabled="{Binding IsUndoEnabled, RelativeSource={RelativeSource TemplatedParent}}"
IsTabStop="{TemplateBinding IsTabStop}"
MinWidth="20"
AcceptsReturn="False"
Padding="{TemplateBinding Padding}"
@ -166,7 +168,19 @@
<Popup x:Name="PART_Popup"
IsOpen="{Binding IsChecked, ElementName=_timePickerToggleButton}"
AllowsTransparency="True"
StaysOpen="False">
StaysOpen="False"
ToolTip="{x:Static sys:String.Empty}">
<Popup.Resources>
<Style TargetType="ToolTip">
<Style.Triggers>
<Trigger Property="Content"
Value="{x:Static sys:String.Empty}">
<Setter Property="Visibility"
Value="Collapsed" />
</Trigger>
</Style.Triggers>
</Style>
</Popup.Resources>
<Border BorderThickness="1"
MinWidth="{Binding ActualWidth, ElementName=root}"
MaxHeight="{TemplateBinding MaxDropDownHeight}"

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

@ -119,7 +119,7 @@ namespace Xceed.Wpf.Toolkit
{
if( this.Value.HasValue )
{
this.UpdateTimeSpan( 1 );
this.UpdateTimeSpan( this.Step );
}
else
{
@ -131,7 +131,7 @@ namespace Xceed.Wpf.Toolkit
{
if( this.Value.HasValue )
{
this.UpdateTimeSpan( -1 );
this.UpdateTimeSpan( -this.Step );
}
else
{
@ -353,8 +353,9 @@ namespace Xceed.Wpf.Toolkit
//this only occurs when the user manually type in a value for the Value Property
if( info == null )
{
//Skip negative sign
info = (_dateTimeInfoList[ 0 ].Content != "-") ? _dateTimeInfoList[ 0 ] : _dateTimeInfoList[ 1 ];
info = (this.CurrentDateTimePart != DateTimePart.Other)
? this.GetDateTimeInfo( this.CurrentDateTimePart )
: (_dateTimeInfoList[ 0 ].Content != "-") ? _dateTimeInfoList[ 0 ] : _dateTimeInfoList[ 1 ]; //Skip negative sign
}
TimeSpan? result = null;
@ -411,7 +412,11 @@ namespace Xceed.Wpf.Toolkit
//we loose our selection when the Value is set so we need to reselect it without firing the selection changed event.
//For a negative value, add 1 for the minus sign.
int startPos = ( result.HasValue && ( result.Value.TotalMilliseconds < 0 ) && oldValue.HasValue && ( oldValue.Value.TotalMilliseconds >= 0 ) ) ? info.StartPosition + 1 : info.StartPosition;
int startPos = (this.GetDateTimeInfo( info.Type ) != null) ? this.GetDateTimeInfo( info.Type ).StartPosition : info.StartPosition;
if( result.HasValue && (result.Value.TotalMilliseconds < 0) && oldValue.HasValue && (oldValue.Value.TotalMilliseconds >= 0) )
{
startPos += 1;
}
this.TextBox.Select( startPos, info.Length );
_fireSelectionChangedEvent = true;
}

5
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/TimeSpanUpDown/Themes/Aero2.NormalColor.xaml

@ -47,7 +47,9 @@
Value="Center" />
<Setter Property="TextAlignment"
Value="Right" />
<Setter Property="WatermarkTemplate"
<Setter Property="Focusable"
Value="False" />
<Setter Property="WatermarkTemplate"
Value="{StaticResource DefaultWatermarkTemplate}" />
<Setter Property="IsTabStop"
Value="False" />
@ -77,6 +79,7 @@
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
IsUndoEnabled="{Binding IsUndoEnabled, RelativeSource={RelativeSource TemplatedParent}}"
IsTabStop="{TemplateBinding IsTabStop}"
MinWidth="20"
AcceptsReturn="False"
Padding="{TemplateBinding Padding}"

3
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/TimeSpanUpDown/Themes/Generic.xaml

@ -50,6 +50,8 @@
Value="{StaticResource DefaultWatermarkTemplate}" />
<Setter Property="IsTabStop"
Value="False" />
<Setter Property="Focusable"
Value="False" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type local:TimeSpanUpDown}">
@ -76,6 +78,7 @@
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
IsUndoEnabled="{Binding IsUndoEnabled, RelativeSource={RelativeSource TemplatedParent}}"
IsTabStop="{TemplateBinding IsTabStop}"
MinWidth="20"
AcceptsReturn="False"
Padding="{TemplateBinding Padding}"

2
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Xceed.Wpf.Toolkit.csproj

@ -413,9 +413,11 @@
<Compile Include="Core\Converters\CornerRadiusToDoubleConverter.cs" />
<Compile Include="Core\Converters\HalfConverter.cs" />
<Compile Include="Core\Converters\IntToThicknessConverter.cs" />
<Compile Include="Core\Converters\NullToBoolConverter.cs" />
<Compile Include="Core\Converters\ThicknessToDoubleConverter.cs" />
<Compile Include="Primitives\DateTimePickerBase.cs" />
<Compile Include="Core\Utilities\DateTimeUtilities.cs" />
<Compile Include="PropertyGrid\Implementation\CategoryGroupStyleSelector.cs" />
<Compile Include="PropertyGrid\Implementation\Converters\IsDefaultCategoryConverter.cs" />
<Compile Include="PropertyGrid\Implementation\Converters\IsStringEmptyConverter.cs" />
<Compile Include="PropertyGrid\Implementation\Editors\CollectionEditor.cs" />

16
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Zoombox/Zoombox.cs

@ -1600,6 +1600,8 @@ namespace Xceed.Wpf.Toolkit.Zoombox
#endregion
public event EventHandler<ScrollEventArgs> Scroll;
#region ViewStackIndexChanged Event
public static readonly RoutedEvent ViewStackIndexChangedEvent = EventManager.RegisterRoutedEvent( "ViewStackIndexChanged", RoutingStrategy.Bubble, typeof( IndexChangedEventHandler ), typeof( Zoombox ) );
@ -2275,12 +2277,26 @@ namespace Xceed.Wpf.Toolkit.Zoombox
{
double diff = e.NewValue + _relativePosition.Y;
this.OnDrag( new DragDeltaEventArgs( 0d, -diff / this.Scale ), false );
// Raise the Scroll event to user
EventHandler<ScrollEventArgs> handler = this.Scroll;
if( handler != null )
{
handler( this, e );
}
}
private void HorizontalScrollBar_Scroll( object sender, ScrollEventArgs e )
{
double diff = e.NewValue + _relativePosition.X;
this.OnDrag( new DragDeltaEventArgs( -diff / this.Scale, 0d ), false );
// Raise the Scroll event to user
EventHandler<ScrollEventArgs> handler = this.Scroll;
if( handler != null )
{
handler( this, e );
}
}
private void DragDisplayViewport( DragDeltaEventArgs e, bool end )

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

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

9
ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/ButtonSpinner/Implementation/ButtonSpinner.cs

@ -266,6 +266,15 @@ namespace Xceed.Wpf.Toolkit
break;
}
case Key.Enter:
{
//Do not Spin on enter Key when spinners have focus
if( this.IncreaseButton.IsFocused || this.DecreaseButton.IsFocused )
{
e.Handled = true;
}
break;
}
}
}

5
ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/Calculator/Implementation/Calculator.cs

@ -436,6 +436,8 @@ namespace Xceed.Wpf.Toolkit
{
decimal currentValue = CalculatorUtilities.ParseDecimal( DisplayText );
_showNewNumber = true;
switch( buttonType )
{
case Calculator.CalculatorButtonType.MAdd:
@ -446,6 +448,7 @@ namespace Xceed.Wpf.Toolkit
break;
case Calculator.CalculatorButtonType.MR:
DisplayText = Memory.ToString();
_showNewNumber = false;
break;
case Calculator.CalculatorButtonType.MS:
Memory = currentValue;
@ -456,8 +459,6 @@ namespace Xceed.Wpf.Toolkit
default:
break;
}
_showNewNumber = true;
}
private void ProcessOperationKey( CalculatorButtonType buttonType )

22
ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/CalculatorUpDown/Themes/Aero2.NormalColor.xaml

@ -19,7 +19,8 @@
xmlns:local="clr-namespace:Xceed.Wpf.Toolkit"
xmlns:chrome="clr-namespace:Xceed.Wpf.Toolkit.Chromes"
xmlns:themes="clr-namespace:Xceed.Wpf.Toolkit.Themes"
xmlns:conv="clr-namespace:Xceed.Wpf.Toolkit.Core.Converters">
xmlns:conv="clr-namespace:Xceed.Wpf.Toolkit.Core.Converters"
xmlns:sys="clr-namespace:System;assembly=mscorlib">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../../Themes/Aero2/Common.xaml" />
@ -112,6 +113,7 @@
Foreground="{TemplateBinding Foreground}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
IsReadOnly="{Binding IsReadOnly, RelativeSource={RelativeSource TemplatedParent}}"
IsTabStop="{TemplateBinding IsTabStop}"
MinWidth="20"
AcceptsReturn="False"
Padding="{TemplateBinding Padding}"
@ -133,9 +135,21 @@
IsHitTestVisible="{Binding IsOpen, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource InverseBoolConverter}}" />
</Grid>
<Popup x:Name="PART_CalculatorPopup"
IsOpen="{Binding IsChecked, ElementName=_calculatorToggleButton}"
StaysOpen="False">
<Border BorderThickness="1" Background="{StaticResource PanelBackgroundBrush}" BorderBrush="{StaticResource PopupDarkBorderBrush}" Padding="3">
IsOpen="{Binding IsChecked, ElementName=_calculatorToggleButton}"
StaysOpen="False"
ToolTip="{x:Static sys:String.Empty}">
<Popup.Resources>
<Style TargetType="ToolTip">
<Style.Triggers>
<Trigger Property="Content"
Value="{x:Static sys:String.Empty}">
<Setter Property="Visibility"
Value="Collapsed" />
</Trigger>
</Style.Triggers>
</Style>
</Popup.Resources>
<Border BorderThickness="1" Background="{StaticResource PanelBackgroundBrush}" BorderBrush="{StaticResource PopupDarkBorderBrush}" Padding="3">
<StackPanel>
<local:Calculator x:Name="PART_Calculator"
Background="Transparent"

18
ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/CalculatorUpDown/Themes/Generic.xaml

@ -19,7 +19,8 @@
xmlns:local="clr-namespace:Xceed.Wpf.Toolkit"
xmlns:themes="clr-namespace:Xceed.Wpf.Toolkit.Themes"
xmlns:chrome="clr-namespace:Xceed.Wpf.Toolkit.Chromes"
xmlns:conv="clr-namespace:Xceed.Wpf.Toolkit.Core.Converters">
xmlns:conv="clr-namespace:Xceed.Wpf.Toolkit.Core.Converters"
xmlns:sys="clr-namespace:System;assembly=mscorlib">
<conv:InverseBoolConverter x:Key="InverseBoolConverter" />
@ -123,6 +124,7 @@
Foreground="{TemplateBinding Foreground}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
IsReadOnly="{Binding IsReadOnly, RelativeSource={RelativeSource TemplatedParent}}"
IsTabStop="{TemplateBinding IsTabStop}"
MinWidth="20"
AcceptsReturn="False"
Padding="{TemplateBinding Padding}"
@ -144,7 +146,19 @@
IsHitTestVisible="{Binding IsOpen, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource InverseBoolConverter}}" />
<Popup x:Name="PART_CalculatorPopup"
IsOpen="{Binding IsChecked, ElementName=_calculatorToggleButton}"
StaysOpen="False">
StaysOpen="False"
ToolTip="{x:Static sys:String.Empty}">
<Popup.Resources>
<Style TargetType="ToolTip">
<Style.Triggers>
<Trigger Property="Content"
Value="{x:Static sys:String.Empty}">
<Setter Property="Visibility"
Value="Collapsed" />
</Trigger>
</Style.Triggers>
</Style>
</Popup.Resources>
<Border BorderThickness="1" Background="{StaticResource PopupBackgroundBrush}" BorderBrush="{StaticResource PopupDarkBorderBrush}" Padding="3">
<StackPanel>
<local:Calculator x:Name="PART_Calculator"

60
ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/CollectionControl/Implementation/CollectionControl.cs

@ -367,8 +367,15 @@ namespace Xceed.Wpf.Toolkit
private void CanAddNew( object sender, CanExecuteRoutedEventArgs e )
{
Type t = e.Parameter as Type;
if( t != null && t.GetConstructor( Type.EmptyTypes ) != null && !IsReadOnly)
e.CanExecute = true;
if( (t != null) && !this.IsReadOnly )
{
bool isComplexStruct = t.IsValueType && !t.IsEnum && !t.IsPrimitive;
if( isComplexStruct || (t.GetConstructor( Type.EmptyTypes ) != null) )
{
e.CanExecute = true;
}
}
}
private void Delete( object sender, ExecutedRoutedEventArgs e )
@ -428,28 +435,12 @@ namespace Xceed.Wpf.Toolkit
#region Methods
private IList CreateItemsSource()
public void PersistChanges()
{
IList list = null;
if( ItemsSourceType != null )
{
ConstructorInfo constructor = ItemsSourceType.GetConstructor( Type.EmptyTypes );
if( constructor != null )
{
list = ( IList )constructor.Invoke( null );
}
}
return list;
this.PersistChanges( this.Items );
}
private object CreateNewItem( Type type )
{
return Activator.CreateInstance( type );
}
public void PersistChanges()
internal void PersistChanges( IList sourceList )
{
IList list = ComputeItemsSource();
if( list == null )
@ -460,18 +451,39 @@ namespace Xceed.Wpf.Toolkit
if( list.IsFixedSize )
{
for( int i = 0; i < Items.Count; ++i )
list[ i ] = Items[ i ];
for( int i = 0; i < sourceList.Count; ++i )
list[ i ] = sourceList[ i ];
}
else
{
foreach( var item in Items )
foreach( var item in sourceList )
{
list.Add( item );
}
}
}
private IList CreateItemsSource()
{
IList list = null;
if( ItemsSourceType != null )
{
ConstructorInfo constructor = ItemsSourceType.GetConstructor( Type.EmptyTypes );
if( constructor != null )
{
list = ( IList )constructor.Invoke( null );
}
}
return list;
}
private object CreateNewItem( Type type )
{
return Activator.CreateInstance( type );
}
private IList ComputeItemsSource()
{
if( ItemsSource == null )

2
ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/CollectionControl/Implementation/CollectionControlButton.cs

@ -116,7 +116,7 @@ namespace Xceed.Wpf.Toolkit
private void CollectionControlButton_Click( object sender, RoutedEventArgs e )
{
CollectionControlDialog collectionControlDialog = new CollectionControlDialog();
var collectionControlDialog = new CollectionControlDialog();
collectionControlDialog.ItemsSource = this.ItemsSource;
collectionControlDialog.NewItemTypes = this.NewItemTypes;
collectionControlDialog.ItemsSourceType = this.ItemsSourceType;

43
ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/CollectionControl/Implementation/CollectionControlDialog.xaml

@ -14,14 +14,14 @@
**********************************************************************************-->
<Window x:Class="Xceed.Wpf.Toolkit.CollectionControlDialog"
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"
Title="Collection Control"
Height="400"
Width="600"
WindowStartupLocation="CenterScreen">
<local:CollectionControlDialogBase x:Class="Xceed.Wpf.Toolkit.CollectionControlDialog"
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"
Title="Collection Control"
Height="400"
Width="600"
WindowStartupLocation="CenterScreen">
<Grid Margin="10">
<Grid.RowDefinitions>
@ -30,15 +30,24 @@
</Grid.RowDefinitions>
<local:CollectionControl x:Name="_collectionControl"
ItemsSourceType="{Binding ItemsSourceType, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}"
ItemsSource="{Binding ItemsSource, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}, Mode=TwoWay}"
NewItemTypes="{Binding NewItemTypes, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}"
IsReadOnly="{Binding IsReadOnly, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}"/>
<StackPanel Orientation="Horizontal" Grid.Row="1" HorizontalAlignment="Right" Margin="5">
<Button Width="75" Margin="2" Click="OkButton_Click" IsDefault="True">OK</Button>
<Button Width="75" Margin="2" Click="CancelButton_Click" IsCancel="True">Cancel</Button>
ItemsSourceType="{Binding ItemsSourceType, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}"
ItemsSource="{Binding ItemsSource, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}, Mode=TwoWay}"
NewItemTypes="{Binding NewItemTypes, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}"
IsReadOnly="{Binding IsReadOnly, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}" />
<StackPanel Orientation="Horizontal"
Grid.Row="1"
HorizontalAlignment="Right"
Margin="5">
<Button Width="75"
Margin="2"
Click="OkButton_Click"
IsDefault="True">OK</Button>
<Button Width="75"
Margin="2"
Click="CancelButton_Click"
IsCancel="True">Cancel</Button>
</StackPanel>
</Grid>
</Window>
</local:CollectionControlDialogBase>

83
ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/CollectionControl/Implementation/CollectionControlDialog.xaml.cs

@ -18,15 +18,27 @@ using System;
using System.Collections;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Media;
namespace Xceed.Wpf.Toolkit
{
public partial class CollectionControlDialogBase :
Window
{
}
/// <summary>
/// Interaction logic for CollectionControlDialog.xaml
/// </summary>
public partial class CollectionControlDialog : Window
public partial class CollectionControlDialog : CollectionControlDialogBase
{
#region Properties
#region Private Members
private IList originalData = new List<object>();
#endregion
#region Properties
public static readonly DependencyProperty ItemsSourceProperty = DependencyProperty.Register( "ItemsSource", typeof( IList ), typeof( CollectionControlDialog ), new UIPropertyMetadata( null ) );
public IList ItemsSource
@ -88,9 +100,9 @@ namespace Xceed.Wpf.Toolkit
}
}
#endregion //Properties
#endregion //Properties
#region Constructors
#region Constructors
public CollectionControlDialog()
{
@ -109,23 +121,76 @@ namespace Xceed.Wpf.Toolkit
NewItemTypes = newItemTypes;
}
#endregion //Constructors
#endregion //Constructors
#region Event Handlers
#region Overrides
protected override void OnSourceInitialized( EventArgs e )
{
base.OnSourceInitialized( e );
//Backup data in case "Cancel" is clicked.
if( this.ItemsSource != null )
{
foreach( var item in this.ItemsSource )
{
originalData.Add( this.Clone( item ) );
}
}
}
#endregion
#region Event Handlers
private void OkButton_Click( object sender, RoutedEventArgs e )
{
_collectionControl.PersistChanges();
this.DialogResult = true;
Close();
this.Close();
}
private void CancelButton_Click( object sender, RoutedEventArgs e )
{
_collectionControl.PersistChanges( originalData );
this.DialogResult = false;
Close();
this.Close();
}
#endregion //Event Hanlders
#region Private Methods
private object Clone( object source )
{
var sourceType = source.GetType();
//Get default constructor
var result = sourceType.GetConstructor( new Type[] { } ).Invoke( null );
var properties = sourceType.GetProperties();
foreach( var propertyInfo in properties )
{
var propertyInfoValue = propertyInfo.GetValue( source, null );
if( propertyInfo.CanWrite )
{
//Look for nested object
if( propertyInfo.PropertyType.IsClass && (propertyInfo.PropertyType != typeof(Transform)) && !propertyInfo.PropertyType.Equals( typeof( string ) ) )
{
var nestedObject = this.Clone( propertyInfoValue );
propertyInfo.SetValue( result, nestedObject, null );
}
else
{
// copy object
propertyInfo.SetValue( result, propertyInfoValue, null );
}
}
}
return result;
}
#endregion //Event Hanlders
#endregion
}
}

53
ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/ColorPicker/Implementation/ColorPicker.cs

@ -208,7 +208,7 @@ namespace Xceed.Wpf.Toolkit
#region IsOpen
public static readonly DependencyProperty IsOpenProperty = DependencyProperty.Register( "IsOpen", typeof( bool ), typeof( ColorPicker ), new UIPropertyMetadata( false ) );
public static readonly DependencyProperty IsOpenProperty = DependencyProperty.Register( "IsOpen", typeof( bool ), typeof( ColorPicker ), new UIPropertyMetadata( false, OnIsOpenChanged ) );
public bool IsOpen
{
get
@ -221,6 +221,19 @@ namespace Xceed.Wpf.Toolkit
}
}
private static void OnIsOpenChanged( DependencyObject d, DependencyPropertyChangedEventArgs e )
{
ColorPicker colorPicker = (ColorPicker)d;
if( colorPicker != null )
colorPicker.OnIsOpenChanged( (bool)e.OldValue, (bool)e.NewValue );
}
private void OnIsOpenChanged( bool oldValue, bool newValue )
{
RoutedEventArgs args = new RoutedEventArgs( newValue ? OpenedEvent : ClosedEvent, this );
this.RaiseEvent( args );
}
#endregion //IsOpen
#region RecentColors
@ -629,6 +642,8 @@ namespace Xceed.Wpf.Toolkit
#region Events
#region SelectedColorChangedEvent
public static readonly RoutedEvent SelectedColorChangedEvent = EventManager.RegisterRoutedEvent( "SelectedColorChanged", RoutingStrategy.Bubble, typeof( RoutedPropertyChangedEventHandler<Color?> ), typeof( ColorPicker ) );
public event RoutedPropertyChangedEventHandler<Color?> SelectedColorChanged
{
@ -642,6 +657,42 @@ namespace Xceed.Wpf.Toolkit
}
}
#endregion
#region OpenedEvent
public static readonly RoutedEvent OpenedEvent = EventManager.RegisterRoutedEvent( "OpenedEvent", RoutingStrategy.Bubble, typeof( RoutedEventHandler ), typeof( ColorPicker ) );
public event RoutedEventHandler Opened
{
add
{
AddHandler( OpenedEvent, value );
}
remove
{
RemoveHandler( OpenedEvent, value );
}
}
#endregion //OpenedEvent
#region ClosedEvent
public static readonly RoutedEvent ClosedEvent = EventManager.RegisterRoutedEvent( "ClosedEvent", RoutingStrategy.Bubble, typeof( RoutedEventHandler ), typeof( ColorPicker ) );
public event RoutedEventHandler Closed
{
add
{
AddHandler( ClosedEvent, value );
}
remove
{
RemoveHandler( ClosedEvent, value );
}
}
#endregion //ClosedEvent
#endregion //Events
#region Methods

14
ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/ColorPicker/Themes/Aero2.NormalColor.xaml

@ -286,7 +286,19 @@
Focusable="False"
HorizontalOffset="1"
VerticalOffset="1"
PopupAnimation="Slide">
PopupAnimation="Slide"
ToolTip="{x:Static sys:String.Empty}">
<Popup.Resources>
<Style TargetType="ToolTip">
<Style.Triggers>
<Trigger Property="Content"
Value="{x:Static sys:String.Empty}">
<Setter Property="Visibility"
Value="Collapsed" />
</Trigger>
</Style.Triggers>
</Style>
</Popup.Resources>
<Border BorderThickness="1"
Background="{StaticResource PanelBackgroundBrush}"
BorderBrush="{StaticResource PopupDarkBorderBrush}"

22
ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/ColorPicker/Themes/Generic.xaml

@ -231,7 +231,27 @@
</Grid>
</ToggleButton>
<Popup x:Name="PART_ColorPickerPalettePopup" VerticalAlignment="Bottom" IsOpen="{Binding ElementName=PART_ColorPickerToggleButton, Path=IsChecked}" StaysOpen="False" AllowsTransparency="True" Focusable="False" HorizontalOffset="1" VerticalOffset="1" PopupAnimation="Slide">
<Popup x:Name="PART_ColorPickerPalettePopup"
VerticalAlignment="Bottom"
IsOpen="{Binding ElementName=PART_ColorPickerToggleButton, Path=IsChecked}"
StaysOpen="False"
AllowsTransparency="True"
Focusable="False"
HorizontalOffset="1"
VerticalOffset="1"
PopupAnimation="Slide"
ToolTip="{x:Static sys:String.Empty}">
<Popup.Resources>
<Style TargetType="ToolTip">
<Style.Triggers>
<Trigger Property="Content"
Value="{x:Static sys:String.Empty}">
<Setter Property="Visibility"
Value="Collapsed" />
</Trigger>
</Style.Triggers>
</Style>
</Popup.Resources>
<Border BorderThickness="1" Background="{StaticResource PopupBackgroundBrush}" BorderBrush="{StaticResource ColorPickerDarkBorderBrush}" Padding="3">
<Grid>
<Grid.RowDefinitions>

35
ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/Core/Converters/NullToBoolConverter.cs

@ -0,0 +1,35 @@
/*************************************************************************************
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 NullToBoolConverter : IValueConverter
{
public object Convert( object value, Type targetType, object parameter, CultureInfo culture )
{
return (value == null);
}
public object ConvertBack( object value, Type targetType, object parameter, CultureInfo culture )
{
throw new NotImplementedException();
}
}
}

4
ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/Core/Utilities/CalculatorUtilities.cs

@ -234,7 +234,9 @@ namespace Xceed.Wpf.Toolkit.Core.Utilities
public static decimal ParseDecimal( string text )
{
return Decimal.Parse( text, CultureInfo.CurrentCulture );
decimal result;
var success = Decimal.TryParse( text, NumberStyles.Any, CultureInfo.CurrentCulture, out result );
return success ? result : decimal.Zero;
}
public static decimal Add( decimal firstNumber, decimal secondNumber )

18
ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/DateTimePicker/Implementation/DateTimePicker.cs

@ -63,6 +63,24 @@ namespace Xceed.Wpf.Toolkit
#endregion //AutoCloseCalendar
#region CalendarDisplayMode
public static readonly DependencyProperty CalendarDisplayModeProperty = DependencyProperty.Register( "CalendarDisplayMode", typeof( CalendarMode )
, typeof( DateTimePicker ), new UIPropertyMetadata( CalendarMode.Month ) );
public CalendarMode CalendarDisplayMode
{
get
{
return (CalendarMode)GetValue( CalendarDisplayModeProperty );
}
set
{
SetValue( CalendarDisplayModeProperty, value );
}
}
#endregion //CalendarDisplayMode
#region TimeFormat
public static readonly DependencyProperty TimeFormatProperty = DependencyProperty.Register( "TimeFormat", typeof( DateTimeFormat ), typeof( DateTimePicker ), new UIPropertyMetadata( DateTimeFormat.ShortTime ) );

3
ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/DateTimePicker/Themes/Aero2.NormalColor.xaml

@ -114,6 +114,7 @@
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
IsUndoEnabled="{Binding IsUndoEnabled, RelativeSource={RelativeSource TemplatedParent}}"
IsTabStop="{TemplateBinding IsTabStop}"
MinWidth="20"
AcceptsReturn="False"
Padding="{TemplateBinding Padding}"
@ -137,7 +138,7 @@
<Popup x:Name="PART_Popup" IsOpen="{Binding IsChecked, ElementName=_calendarToggleButton}" StaysOpen="False">
<Border BorderThickness="1" Background="{StaticResource PanelBackgroundBrush}" BorderBrush="{StaticResource PopupDarkBorderBrush}" Padding="3">
<StackPanel>
<toolkit:Calendar x:Name="PART_Calendar" BorderThickness="0" />
<toolkit:Calendar x:Name="PART_Calendar" BorderThickness="0" DisplayMode="{Binding CalendarDisplayMode, RelativeSource={RelativeSource TemplatedParent}}"/>
<local:TimePicker x:Name="PART_TimeUpDown"
Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"
Foreground="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}"

3
ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/DateTimePicker/Themes/Generic.xaml

@ -124,6 +124,7 @@
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
IsUndoEnabled="{Binding IsUndoEnabled, RelativeSource={RelativeSource TemplatedParent}}"
IsTabStop="{TemplateBinding IsTabStop}"
MinWidth="20"
AcceptsReturn="False"
Padding="{TemplateBinding Padding}"
@ -147,7 +148,7 @@
<Popup x:Name="PART_Popup" IsOpen="{Binding IsChecked, ElementName=_calendarToggleButton}" StaysOpen="False">
<Border BorderThickness="1" Background="{StaticResource PopupBackgroundBrush}" BorderBrush="{StaticResource PopupDarkBorderBrush}" Padding="3">
<StackPanel>
<toolkit:Calendar x:Name="PART_Calendar" BorderThickness="0" />
<toolkit:Calendar x:Name="PART_Calendar" BorderThickness="0" DisplayMode="{Binding CalendarDisplayMode, RelativeSource={RelativeSource TemplatedParent}}"/>
<local:TimePicker x:Name="PART_TimeUpDown"
Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"
Foreground="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}"

28
ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/DateTimeUpDown/Implementation/DateTimeUpDown.cs

@ -216,7 +216,7 @@ namespace Xceed.Wpf.Toolkit
if( this.IsCurrentValueValid() )
{
if( Value.HasValue )
UpdateDateTime( 1 );
UpdateDateTime( this.Step );
else
Value = DefaultValue ?? this.ContextNow;
}
@ -227,7 +227,7 @@ namespace Xceed.Wpf.Toolkit
if( this.IsCurrentValueValid() )
{
if( Value.HasValue )
UpdateDateTime( -1 );
UpdateDateTime( -this.Step );
else
Value = DefaultValue ?? this.ContextNow;
}
@ -319,6 +319,13 @@ namespace Xceed.Wpf.Toolkit
protected override void OnValueChanged( DateTime? oldValue, DateTime? newValue )
{
_fireSelectionChangedEvent = false;
DateTimeInfo info = _selectedDateTimeInfo;
//this only occurs when the user manually type in a value for the Value Property
if( info == null )
info = (this.CurrentDateTimePart != DateTimePart.Other) ? this.GetDateTimeInfo( this.CurrentDateTimePart ) : _dateTimeInfoList[ 0 ];
//whenever the value changes we need to parse out the value into out DateTimeInfo segments so we can keep track of the individual pieces
//but only if it is not null
if( newValue != null )
@ -330,12 +337,18 @@ namespace Xceed.Wpf.Toolkit
{
_lastValidDate = newValue;
}
if( TextBox != null )
{
//we loose our selection when the Value is set so we need to reselect it without firing the selection changed event
TextBox.Select( info.StartPosition, info.Length );
}
_fireSelectionChangedEvent = true;
}
protected override void RaiseValueChangedEvent( DateTime? oldValue, DateTime? newValue )
{
if( ( this.TemplatedParent is TimePicker )
&& ( ( TimePicker )this.TemplatedParent ).TemplatedParent is DateTimePicker )
if( ( this is TimePicker ) && ( this.TemplatedParent is DateTimePicker ) )
return;
base.RaiseValueChangedEvent( oldValue, newValue );
@ -756,12 +769,11 @@ namespace Xceed.Wpf.Toolkit
private void UpdateDateTime( int value )
{
_fireSelectionChangedEvent = false;
DateTimeInfo info = _selectedDateTimeInfo;
//this only occurs when the user manually type in a value for the Value Property
if( info == null )
info = _dateTimeInfoList[ 0 ];
info = (this.CurrentDateTimePart != DateTimePart.Other) ? this.GetDateTimeInfo( this.CurrentDateTimePart ) : _dateTimeInfoList[ 0 ];
DateTime? result = null;
@ -826,10 +838,6 @@ namespace Xceed.Wpf.Toolkit
}
this.Value = this.CoerceValueMinMax( result );
//we loose our selection when the Value is set so we need to reselect it without firing the selection changed event
TextBox.Select( info.StartPosition, info.Length );
_fireSelectionChangedEvent = true;
}
private bool TryParseDateTime( string text, out DateTime result )

1
ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/DateTimeUpDown/Themes/Aero2.NormalColor.xaml

@ -65,6 +65,7 @@
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
IsUndoEnabled="{Binding IsUndoEnabled, RelativeSource={RelativeSource TemplatedParent}}"
IsTabStop="{TemplateBinding IsTabStop}"
MinWidth="20"
AcceptsReturn="False"
Padding="{TemplateBinding Padding}"

1
ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/DateTimeUpDown/Themes/Generic.xaml

@ -78,6 +78,7 @@
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
IsUndoEnabled="{Binding IsUndoEnabled, RelativeSource={RelativeSource TemplatedParent}}"
IsTabStop="{TemplateBinding IsTabStop}"
MinWidth="20"
AcceptsReturn="False"
Padding="{TemplateBinding Padding}"

17
ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/DropDownButton/Themes/Aero2.NormalColor.xaml

@ -19,7 +19,8 @@
xmlns:chrome="clr-namespace:Xceed.Wpf.Toolkit.Chromes"
xmlns:conv="clr-namespace:Xceed.Wpf.Toolkit.Core.Converters"
xmlns:themes="clr-namespace:Xceed.Wpf.Toolkit.Themes"
xmlns:local="clr-namespace:Xceed.Wpf.Toolkit">
xmlns:local="clr-namespace:Xceed.Wpf.Toolkit"
xmlns:sys="clr-namespace:System;assembly=mscorlib">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../../Themes/Aero2/Common.xaml" />
@ -104,7 +105,19 @@
StaysOpen="False"
Placement="Bottom"
Focusable="False"
IsOpen="{Binding IsChecked, ElementName=PART_DropDownButton}">
IsOpen="{Binding IsChecked, ElementName=PART_DropDownButton}"
ToolTip="{x:Static sys:String.Empty}">
<Popup.Resources>
<Style TargetType="ToolTip">
<Style.Triggers>
<Trigger Property="Content"
Value="{x:Static sys:String.Empty}">
<Setter Property="Visibility"
Value="Collapsed" />
</Trigger>
</Style.Triggers>
</Style>
</Popup.Resources>
<Border BorderThickness="1"
Background="{StaticResource PanelBackgroundBrush}"
BorderBrush="{StaticResource PopupDarkBorderBrush}"

17
ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/DropDownButton/Themes/Generic.xaml

@ -19,7 +19,8 @@
xmlns:chrome="clr-namespace:Xceed.Wpf.Toolkit.Chromes"
xmlns:conv="clr-namespace:Xceed.Wpf.Toolkit.Core.Converters"
xmlns:themes="clr-namespace:Xceed.Wpf.Toolkit.Themes"
xmlns:local="clr-namespace:Xceed.Wpf.Toolkit">
xmlns:local="clr-namespace:Xceed.Wpf.Toolkit"
xmlns:sys="clr-namespace:System;assembly=mscorlib">
<conv:InverseBoolConverter x:Key="InverseBoolConverter" />
@ -122,7 +123,19 @@
StaysOpen="False"
Placement="Bottom"
Focusable="False"
IsOpen="{Binding IsChecked, ElementName=PART_DropDownButton}">
IsOpen="{Binding IsChecked, ElementName=PART_DropDownButton}"
ToolTip="{x:Static sys:String.Empty}">
<Popup.Resources>
<Style TargetType="ToolTip">
<Style.Triggers>
<Trigger Property="Content"
Value="{x:Static sys:String.Empty}">
<Setter Property="Visibility"
Value="Collapsed" />
</Trigger>
</Style.Triggers>
</Style>
</Popup.Resources>
<Border BorderThickness="1"
Background="{StaticResource PopupBackgroundBrush}"
BorderBrush="{StaticResource PopupDarkBorderBrush}"

52
ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/Magnifier/Implementation/Magnifier.cs

@ -63,6 +63,24 @@ namespace Xceed.Wpf.Toolkit
#endregion //FrameType
#region IsUsingZoomOnMouseWheel
public static readonly DependencyProperty IsUsingZoomOnMouseWheelProperty = DependencyProperty.Register( "IsUsingZoomOnMouseWheel", typeof( bool )
, typeof( Magnifier ), new UIPropertyMetadata( true ) );
public bool IsUsingZoomOnMouseWheel
{
get
{
return (bool)GetValue( IsUsingZoomOnMouseWheelProperty );
}
set
{
SetValue( IsUsingZoomOnMouseWheelProperty, value );
}
}
#endregion //IsUsingZoomOnMouseWheel
#region Radius
public static readonly DependencyProperty RadiusProperty = DependencyProperty.Register( "Radius", typeof( double ), typeof( Magnifier ), new FrameworkPropertyMetadata( ( Magnifier.DEFAULT_SIZE / 2 ), new PropertyChangedCallback( OnRadiusPropertyChanged ) ) );
@ -158,6 +176,40 @@ namespace Xceed.Wpf.Toolkit
#endregion //ZoomFactor
#region ZoomFactorOnMouseWheel
public static readonly DependencyProperty ZoomFactorOnMouseWheelProperty = DependencyProperty.Register( "ZoomFactorOnMouseWheel", typeof( double )
, typeof( Magnifier ), new FrameworkPropertyMetadata( 0.1d, OnZoomFactorOnMouseWheelPropertyChanged ), OnZoomFactorOnMouseWheelValidationCallback );
public double ZoomFactorOnMouseWheel
{
get
{
return (double)GetValue( ZoomFactorOnMouseWheelProperty );
}
set
{
SetValue( ZoomFactorOnMouseWheelProperty, value );
}
}
private static bool OnZoomFactorOnMouseWheelValidationCallback( object baseValue )
{
double zoomFactorOnMouseWheel = (double)baseValue;
return (zoomFactorOnMouseWheel >= 0);
}
private static void OnZoomFactorOnMouseWheelPropertyChanged( DependencyObject d, DependencyPropertyChangedEventArgs e )
{
Magnifier m = (Magnifier)d;
m.OnZoomFactorOnMouseWheelChanged( e );
}
protected virtual void OnZoomFactorOnMouseWheelChanged( DependencyPropertyChangedEventArgs e )
{
}
#endregion //ZoomFactorOnMouseWheel
#endregion //Properties
#region Constructors

38
ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/Magnifier/Implementation/MagnifierManager.cs

@ -57,25 +57,53 @@ namespace Xceed.Wpf.Toolkit
#region Event Handlers
void Element_MouseLeave( object sender, MouseEventArgs e )
private void Element_MouseLeave( object sender, MouseEventArgs e )
{
HideAdorner();
}
void Element_MouseEnter( object sender, MouseEventArgs e )
private void Element_MouseEnter( object sender, MouseEventArgs e )
{
ShowAdorner();
}
#endregion //Event Handlers
private void Element_MouseWheel( object sender, MouseWheelEventArgs e )
{
var magnifier = MagnifierManager.GetMagnifier( _element ) as Magnifier;
if( (magnifier != null) && magnifier.IsUsingZoomOnMouseWheel )
{
if( e.Delta < 0 )
{
var newValue = magnifier.ZoomFactor + magnifier.ZoomFactorOnMouseWheel;
#if VS2008
magnifier.ZoomFactor = newValue;
#else
magnifier.SetCurrentValue( Magnifier.ZoomFactorProperty, newValue );
#endif
}
else if ( e.Delta > 0 )
{
var newValue = (magnifier.ZoomFactor >= magnifier.ZoomFactorOnMouseWheel) ? magnifier.ZoomFactor - magnifier.ZoomFactorOnMouseWheel : 0d;
#if VS2008
magnifier.ZoomFactor = newValue;
#else
magnifier.SetCurrentValue( Magnifier.ZoomFactorProperty, newValue );
#endif
}
_adorner.UpdateViewBox();
}
}
#endregion //Event Handlers
#region Methods
#region Methods
private void AttachToMagnifier( UIElement element, Magnifier magnifier )
{
_element = element;
_element.MouseEnter += Element_MouseEnter;
_element.MouseLeave += Element_MouseLeave;
_element.MouseWheel += Element_MouseWheel;
magnifier.Target = _element;
@ -109,6 +137,6 @@ namespace Xceed.Wpf.Toolkit
}
}
#endregion //Methods
#endregion //Methods
}
}

17
ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/MultiLineTextEditor/Themes/Aero2.NormalColor.xaml

@ -19,7 +19,8 @@
xmlns:local="clr-namespace:Xceed.Wpf.Toolkit"
xmlns:chrome="clr-namespace:Xceed.Wpf.Toolkit.Chromes"
xmlns:themes="clr-namespace:Xceed.Wpf.Toolkit.Themes"
xmlns:conv="clr-namespace:Xceed.Wpf.Toolkit.Core.Converters">
xmlns:conv="clr-namespace:Xceed.Wpf.Toolkit.Core.Converters"
xmlns:sys="clr-namespace:System;assembly=mscorlib">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../../Themes/Aero2/Common.xaml" />
@ -145,7 +146,19 @@
Focusable="False"
PopupAnimation="Slide"
Width="{TemplateBinding DropDownWidth}"
Height="{TemplateBinding DropDownHeight}">
Height="{TemplateBinding DropDownHeight}"
ToolTip="{x:Static sys:String.Empty}">
<Popup.Resources>
<Style TargetType="ToolTip">
<Style.Triggers>
<Trigger Property="Content"
Value="{x:Static sys:String.Empty}">
<Setter Property="Visibility"
Value="Collapsed" />
</Trigger>
</Style.Triggers>
</Style>
</Popup.Resources>
<Border BorderThickness="1"
Background="White"
BorderBrush="{StaticResource PopupDarkBorderBrush}">

17
ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/MultiLineTextEditor/Themes/Generic.xaml

@ -18,7 +18,8 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Xceed.Wpf.Toolkit"
xmlns:chrome="clr-namespace:Xceed.Wpf.Toolkit.Chromes"
xmlns:conv="clr-namespace:Xceed.Wpf.Toolkit.Core.Converters">
xmlns:conv="clr-namespace:Xceed.Wpf.Toolkit.Core.Converters"
xmlns:sys="clr-namespace:System;assembly=mscorlib">
<conv:InverseBoolConverter x:Key="InverseBoolConverter" />
@ -132,7 +133,19 @@
Focusable="False"
PopupAnimation="Slide"
Width="{TemplateBinding DropDownWidth}"
Height="{TemplateBinding DropDownHeight}">
Height="{TemplateBinding DropDownHeight}"
ToolTip="{x:Static sys:String.Empty}">
<Popup.Resources>
<Style TargetType="ToolTip">
<Style.Triggers>
<Trigger Property="Content"
Value="{x:Static sys:String.Empty}">
<Setter Property="Visibility"
Value="Collapsed" />
</Trigger>
</Style.Triggers>
</Style>
</Popup.Resources>
<Border BorderThickness="1" Background="{StaticResource PopupBackgroundBrush}" BorderBrush="{StaticResource PopupDarkBorderBrush}">
<Grid>
<TextBox x:Name="PART_TextBox"

93
ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/Primitives/DateTimeUpDownBase.cs

@ -36,11 +36,75 @@ namespace Xceed.Wpf.Toolkit.Primitives
#endregion //Members
#region Properties
#region CurrentDateTimePart
public static readonly DependencyProperty CurrentDateTimePartProperty = DependencyProperty.Register( "CurrentDateTimePart", typeof( DateTimePart )
, typeof( DateTimeUpDownBase<T> ), new UIPropertyMetadata( DateTimePart.Other, OnCurrentDateTimePartChanged ) );
public DateTimePart CurrentDateTimePart
{
get
{
return (DateTimePart)GetValue( CurrentDateTimePartProperty );
}
set
{
SetValue( CurrentDateTimePartProperty, value );
}
}
private static void OnCurrentDateTimePartChanged( DependencyObject o, DependencyPropertyChangedEventArgs e )
{
DateTimeUpDownBase<T> dateTimeUpDownBase = o as DateTimeUpDownBase<T>;
if( dateTimeUpDownBase != null )
dateTimeUpDownBase.OnCurrentDateTimePartChanged( (DateTimePart)e.OldValue, (DateTimePart)e.NewValue );
}
protected virtual void OnCurrentDateTimePartChanged( DateTimePart oldValue, DateTimePart newValue )
{
this.Select( this.GetDateTimeInfo( newValue ) );
}
#endregion //CurrentDateTimePart
#region Step
public static readonly DependencyProperty StepProperty = DependencyProperty.Register( "Step", typeof( int )
, typeof( DateTimeUpDownBase<T> ), new UIPropertyMetadata( 1, OnStepChanged ) );
public int Step
{
get
{
return (int)GetValue( StepProperty );
}
set
{
SetValue( StepProperty, value );
}
}
private static void OnStepChanged( DependencyObject o, DependencyPropertyChangedEventArgs e )
{
var dateTimeUpDownBase = o as DateTimeUpDownBase<T>;
if( dateTimeUpDownBase != null )
dateTimeUpDownBase.OnStepChanged( (int)e.OldValue, (int)e.NewValue );
}
protected virtual void OnStepChanged( int oldValue, int newValue )
{
}
#endregion //Step
#endregion
#region Constructors
internal DateTimeUpDownBase()
{
this.InitializeDateTimeInfoList();
this.Loaded += this.DateTimeUpDownBase_Loaded;
}
#endregion
@ -51,7 +115,6 @@ namespace Xceed.Wpf.Toolkit.Primitives
{
if( this.TextBox != null )
{
this.TextBox.GotFocus -= new RoutedEventHandler( this.TextBox_GotFocus );
this.TextBox.SelectionChanged -= this.TextBox_SelectionChanged;
}
@ -59,7 +122,6 @@ namespace Xceed.Wpf.Toolkit.Primitives
if( this.TextBox != null )
{
this.TextBox.GotFocus += new RoutedEventHandler( this.TextBox_GotFocus );
this.TextBox.SelectionChanged += this.TextBox_SelectionChanged;
}
}
@ -150,12 +212,9 @@ namespace Xceed.Wpf.Toolkit.Primitives
_fireSelectionChangedEvent = true;
}
private void TextBox_GotFocus( object sender, RoutedEventArgs e )
private void DateTimeUpDownBase_Loaded( object sender, RoutedEventArgs e )
{
if( _selectedDateTimeInfo == null )
{
this.Select( this.GetDateTimeInfo( 0 ) );
}
this.InitSelection();
}
#endregion
@ -192,14 +251,24 @@ namespace Xceed.Wpf.Toolkit.Primitives
( info.StartPosition <= selectionStart ) && ( selectionStart < ( info.StartPosition + info.Length ) ) );
}
internal DateTimeInfo GetDateTimeInfo( DateTimePart part )
{
return _dateTimeInfoList.FirstOrDefault( ( info ) =>info.Type == part );
}
internal void Select( DateTimeInfo info )
{
if( info != null )
if( (info != null) && !info.Equals( _selectedDateTimeInfo ) && ( this.TextBox != null) && !string.IsNullOrEmpty( this.TextBox.Text ) )
{
_fireSelectionChangedEvent = false;
this.TextBox.Select( info.StartPosition, info.Length );
_fireSelectionChangedEvent = true;
_selectedDateTimeInfo = info;
#if VS2008
this.CurrentDateTimePart = info.Type;
#else
this.SetCurrentValue( DateTimeUpDownBase<T>.CurrentDateTimePartProperty, info.Type );
#endif
}
}
@ -301,6 +370,14 @@ namespace Xceed.Wpf.Toolkit.Primitives
return previousDateTimeInfo;
}
private void InitSelection()
{
if( _selectedDateTimeInfo == null )
{
this.Select( (this.CurrentDateTimePart != DateTimePart.Other) ? this.GetDateTimeInfo( this.CurrentDateTimePart ) : this.GetDateTimeInfo( 0 ) );
}
}
#endregion
}
}

4
ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/Primitives/Themes/Aero2/WindowControl.xaml

@ -25,7 +25,7 @@
<ResourceDictionary Source="../../../Themes/Aero2/Common.xaml" />
</ResourceDictionary.MergedDictionaries>
<sys:Double x:Key="TopBorderThumbHeight">8</sys:Double>
<sys:Double x:Key="TopBorderThumbHeight">5</sys:Double>
<conv:WindowContentBorderMarginConverter x:Key="WindowContentBorderMarginConverter" />
<conv:WindowControlBackgroundConverter x:Key="WindowControlBackgroundConverter" />
@ -65,7 +65,7 @@
<ColumnDefinition x:Name="HeaderButtonsColumn" Width="Auto"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition x:Name="HeaderRow" Height="22" />
<RowDefinition x:Name="HeaderRow" Height="28" />
<RowDefinition Height="{Binding WindowThickness.Top, RelativeSource={RelativeSource TemplatedParent}}" />
</Grid.RowDefinitions>

4
ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/Primitives/Themes/Generic/WindowControl.xaml

@ -25,7 +25,7 @@
<ResourceDictionary Source="../../../Themes/Generic/Common.xaml" />
</ResourceDictionary.MergedDictionaries>
<sys:Double x:Key="TopBorderThumbHeight">8</sys:Double>
<sys:Double x:Key="TopBorderThumbHeight">5</sys:Double>
<conv:WindowContentBorderMarginConverter x:Key="WindowContentBorderMarginConverter" />
<conv:WindowControlBackgroundConverter x:Key="WindowControlBackgroundConverter" />
@ -67,7 +67,7 @@
<ColumnDefinition x:Name="HeaderButtonsColumn" Width="Auto"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition x:Name="HeaderRow" Height="22" />
<RowDefinition x:Name="HeaderRow" Height="28" />
<RowDefinition Height="{Binding WindowThickness.Top, RelativeSource={RelativeSource TemplatedParent}}" />
</Grid.RowDefinitions>

9
ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/Primitives/UpDownBase.cs

@ -566,6 +566,8 @@ namespace Xceed.Wpf.Toolkit.Primitives
public event InputValidationErrorEventHandler InputValidationError;
public event EventHandler<SpinEventArgs> Spinned;
#region ValueChanged Event
//Due to a bug in Visual Studio, you cannot create event handlers for generic T args in XAML, so I have to use object instead.
@ -593,6 +595,13 @@ namespace Xceed.Wpf.Toolkit.Primitives
if( e == null )
throw new ArgumentNullException( "e" );
// Raise the Spinned event to user
EventHandler<SpinEventArgs> handler = this.Spinned;
if( handler != null )
{
handler( this, e );
}
if( e.Direction == SpinDirection.Increase )
DoIncrement();
else

65
ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/PropertyGrid/Implementation/CategoryGroupStyleSelector.cs

@ -0,0 +1,65 @@
/*************************************************************************************
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.ComponentModel;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Media;
namespace Xceed.Wpf.Toolkit.PropertyGrid
{
public class CategoryGroupStyleSelector : StyleSelector
{
public Style SingleDefaultCategoryItemGroupStyle
{
get;
set;
}
public Style ItemGroupStyle
{
get;
set;
}
public override Style SelectStyle( object item, DependencyObject container )
{
var group = item as CollectionViewGroup;
// Category is not "Misc" => use regular ItemGroupStyle
if( !group.Name.Equals( CategoryAttribute.Default.Category ) )
return this.ItemGroupStyle;
// Category is "Misc"
while( container != null )
{
container = VisualTreeHelper.GetParent( container );
if( container is ItemsControl )
break;
}
var itemsControl = container as ItemsControl;
if( itemsControl != null )
{
// Category is "Misc" and this is the only category => use SingleDefaultCategoryItemGroupContainerStyle
if( (itemsControl.Items.Count > 0) && (itemsControl.Items.Groups.Count == 1) )
return this.SingleDefaultCategoryItemGroupStyle;
}
// Category is "Misc" and this is NOT the only category => use regular ItemGroupStyle
return this.ItemGroupStyle;
}
}
}

2
ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/PropertyGrid/Implementation/DescriptorPropertyDefinition.cs

@ -101,7 +101,7 @@ namespace Xceed.Wpf.Toolkit.PropertyGrid
//Bind the value property with the source object.
var binding = new Binding( PropertyDescriptor.Name )
{
Source = SelectedObject,
Source = this.GetValueInstance( SelectedObject ),
Mode = PropertyDescriptor.IsReadOnly ? BindingMode.OneWay : BindingMode.TwoWay,
ValidatesOnDataErrors = true,
ValidatesOnExceptions = true,

24
ExtendedWPFToolkitSolution_35/Src/Xceed.Wpf.Toolkit/PropertyGrid/Implementation/DescriptorPropertyDefinitionBase.cs

@ -152,15 +152,12 @@ namespace Xceed.Wpf.Toolkit.PropertyGrid
bool isResource = false;
bool isDynamicResource = false;
var markupProperty = markupObject.Properties.Where( p => p.Name == PropertyName ).FirstOrDefault();
if( ( markupProperty != null )
&& ( markupProperty.PropertyType != typeof( object ) )
&& !markupProperty.PropertyType.IsEnum
&& !markupProperty.PropertyType.IsArray )
{
//TODO: need to find a better way to determine if a StaticResource has been applied to any property not just a style
isResource = ( markupProperty.Value is Style );
isDynamicResource = ( markupProperty.Value is DynamicResourceExtension );
var markupProperty = markupObject.Properties.FirstOrDefault( p => p.Name == PropertyName );
if( markupProperty != null )
{
//TODO: need to find a better way to determine if a StaticResource has been applied to any property not just a style(maybe with StaticResourceExtension)
isResource = typeof( Style ).IsAssignableFrom( markupProperty.PropertyType );
isDynamicResource = typeof( DynamicResourceExtension ).IsAssignableFrom( markupProperty.PropertyType );
}
if( isResource || isDynamicResource )
@ -293,6 +290,15 @@ namespace Xceed.Wpf.Toolkit.PropertyGrid
return this.ComputeDisplayOrder( isPropertyGridCategorized );
}
internal object GetValueInstance( object sourceObject )
{
ICustomTypeDescriptor customTypeDescriptor = sourceObject as ICustomTypeDescriptor;
if( customTypeDescriptor != null )
sourceObject = customTypeDescriptor.GetPropertyOwner( PropertyDescriptor );
return sourceObject;
}
#endregion
#region Private Methods

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

Loading…
Cancel
Save