From 84480870868d5348ddfebb4d23a35b42375bcc35 Mon Sep 17 00:00:00 2001 From: brianlagunas_cp Date: Tue, 5 Apr 2011 17:37:55 +0000 Subject: [PATCH] Getting ready for v1.4 release --- .../MainWindow.xaml | 37 +- .../MainWindow.xaml.cs | 92 ++++ .../ColorPicker/Themes/Generic.xaml | 21 +- .../Core/Primitives/UpDownBase.cs | 7 +- .../Implementation/PropertyGrid.cs | 62 ++- .../ExtendedWPFToolkit.sln | 6 +- .../Properties/Resources.Designer.cs | 46 +- .../Properties/Settings.Designer.cs | 24 +- .../WPFToolkit.Extended.Examples.csproj | 11 +- .../ButtonSpinner/Themes/Generic.xaml | 4 +- .../Calculator/Themes/Generic.xaml | 496 ++++++++++++++++++ .../CalculatorUpDown/Themes/Generic.xaml | 118 +++++ .../ChildWindow/Themes/Generic.xaml | 33 +- .../ColorCanvas/Themes/Generic.xaml | 10 +- .../ColorPicker/Themes/Generic.xaml | 27 +- .../DateTimePicker/Themes/Generic.xaml | 28 +- .../DateTimeUpDown/Themes/Generic.xaml | 48 +- .../NumericUpDown/Themes/Generic.xaml | 73 ++- .../Properties/AssemblyInfo.cs | 4 +- .../PropertyGrid/Themes/Generic.xaml | 2 +- .../SplitButton/Themes/Generic.xaml | 2 +- .../WPFToolkit.Extended/Themes/Generic.xaml | 2 + .../TimePicker/Themes/Generic.xaml | 49 +- .../WPFToolkit.Extended.csproj | 83 ++- .../WatermarkTextBox/Themes/Generic.xaml | 14 +- 25 files changed, 1104 insertions(+), 195 deletions(-) create mode 100644 ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/Calculator/Themes/Generic.xaml create mode 100644 ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/CalculatorUpDown/Themes/Generic.xaml diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended.Samples/MainWindow.xaml b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended.Samples/MainWindow.xaml index 816e834e..e61a28f8 100644 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended.Samples/MainWindow.xaml +++ b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended.Samples/MainWindow.xaml @@ -3,9 +3,40 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:extToolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit/extended" xmlns:local="clr-namespace:WPFToolkit.Extended.Samples" - Title="MainWindow" Height="600" Width="800" WindowStartupLocation="CenterScreen" ForceCursor="True"> + Title="MainWindow" Height="600" Width="250" WindowStartupLocation="CenterScreen" ForceCursor="True" + xmlns:sys="clr-namespace:System;assembly=mscorlib" Background="White"> + + + + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended.Samples/MainWindow.xaml.cs b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended.Samples/MainWindow.xaml.cs index 07543ada..688a567d 100644 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended.Samples/MainWindow.xaml.cs +++ b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended.Samples/MainWindow.xaml.cs @@ -14,6 +14,8 @@ using System.Windows.Shapes; using System.ComponentModel; using System.Collections.ObjectModel; using Microsoft.Windows.Controls; +using System.Text.RegularExpressions; +using System.Diagnostics; namespace WPFToolkit.Extended.Samples { @@ -25,12 +27,102 @@ namespace WPFToolkit.Extended.Samples public MainWindow() { InitializeComponent(); + DataContext = new Data(); Loaded += new RoutedEventHandler(MainWindow_Loaded); } void MainWindow_Loaded(object sender, RoutedEventArgs e) { + + } + + private void Calculator_ValueChanged(object sender, RoutedPropertyChangedEventArgs e) + { + Debug.WriteLine(e.NewValue.HasValue ? e.NewValue.Value.ToString() : "NULL"); + } + + private void ColorCanvas_SelectedColorChanged(object sender, RoutedPropertyChangedEventArgs e) + { + Debug.WriteLine(e.NewValue); + } + } + + public class Data : System.ComponentModel.INotifyPropertyChanged + { + + protected string _Text = "C2"; + public string Text + { + get { return _Text; } + set + { + _Text = value; + NotifyPropertyChanged("Text"); + } + } + + private int? _integer = 5; + public int? Integer + { + get { return _integer; } + set + { + _integer = value; + NotifyPropertyChanged("Integer"); + } + } + private double? _double = 5; + public double? Double + { + get { return _double; } + set + { + _double = value; + NotifyPropertyChanged("Double"); + } + } + + private decimal? _decimal = 5; + public decimal? Decimal + { + get { return _decimal; } + set + { + _decimal = value; + NotifyPropertyChanged("Decimal"); + } + } + + + private DateTime? _dueDate; + public DateTime? DueDate + { + get { return _dueDate; } + set + { + _dueDate = value; + NotifyPropertyChanged("DueDate"); + } + } + + + + public Data() + { + //Text = "testm"; + } + + #region PropertyChanged + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + private void NotifyPropertyChanged(string info) + { + if (PropertyChanged != null) + { + PropertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(info)); + } } + #endregion } } diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/ColorPicker/Themes/Generic.xaml b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/ColorPicker/Themes/Generic.xaml index 55c47d4a..12d36ca1 100644 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/ColorPicker/Themes/Generic.xaml +++ b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/ColorPicker/Themes/Generic.xaml @@ -187,9 +187,10 @@ + ItemsSource="{Binding AvailableColors, RelativeSource={RelativeSource TemplatedParent}}" + ItemTemplate="{StaticResource ColorItemTemplate}" + ItemContainerStyle="{StaticResource ColorPaletteLisBoxStyle}" + Style="{x:Null}"> @@ -208,9 +209,10 @@ + ItemsSource="{Binding StandardColors, RelativeSource={RelativeSource TemplatedParent}}" + ItemTemplate="{StaticResource ColorItemTemplate}" + ItemContainerStyle="{StaticResource ColorPaletteLisBoxStyle}" + Style="{x:Null}"> @@ -229,9 +231,10 @@ + ItemsSource="{Binding RecentColors, RelativeSource={RelativeSource TemplatedParent}}" + ItemTemplate="{StaticResource ColorItemTemplate}" + ItemContainerStyle="{StaticResource ColorPaletteLisBoxStyle}" + Style="{x:Null}"> diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Core/Primitives/UpDownBase.cs b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Core/Primitives/UpDownBase.cs index b637b977..3001fa37 100644 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Core/Primitives/UpDownBase.cs +++ b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Core/Primitives/UpDownBase.cs @@ -163,7 +163,7 @@ namespace Microsoft.Windows.Controls.Primitives { base.OnMouseWheel(e); - if (!e.Handled && AllowSpin) + if (!e.Handled && AllowSpin && TextBox.IsFocused) { if (e.Delta < 0) { @@ -257,6 +257,11 @@ namespace Microsoft.Windows.Controls.Primitives Text = ConvertValueToText(); +#if VS2008 + //there is a bug in .NET 3.5 which will not correctly update the textbox text through binding. + TextBox.Text = Text; +#endif + _isSyncingTextAndValueProperties = false; } diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/PropertyGrid.cs b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/PropertyGrid.cs index 49057cfb..6ae1a563 100644 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/PropertyGrid.cs +++ b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/PropertyGrid.cs @@ -277,10 +277,17 @@ namespace Microsoft.Windows.Controls.PropertyGrid var properties = TypeDescriptor.GetProperties(instance.GetType(), new Attribute[] { new PropertyFilterAttribute(PropertyFilterOptions.All) }); - // Get all properties of the type - propertyItems.AddRange(properties.Cast(). - Where(p => p.IsBrowsable && p.Name != "GenericParameterAttributes"). - Select(property => CreatePropertyItem(property, instance, this))); + try + { + + // Get all properties of the type + propertyItems.AddRange(properties.Cast(). + Where(p => p.IsBrowsable && p.Name != "GenericParameterAttributes"). + Select(property => CreatePropertyItem(property, instance, this))); + } + catch (Exception ex) + { + } return propertyItems; } @@ -315,27 +322,34 @@ namespace Microsoft.Windows.Controls.PropertyGrid editor = customEditor.Editor; } - //no custom editor found - if (editor == null) + try { - if (propertyItem.IsReadOnly) - editor = new TextBlockEditor(); - else if (propertyItem.PropertyType == typeof(bool)) - editor = new CheckBoxEditor(); - else if (propertyItem.PropertyType == typeof(decimal) || propertyItem.PropertyType == typeof(decimal?)) - editor = new DecimalUpDownEditor(); - else if (propertyItem.PropertyType == typeof(double) || propertyItem.PropertyType == typeof(double?)) - editor = new DoubleUpDownEditor(); - else if (propertyItem.PropertyType == typeof(int) || propertyItem.PropertyType == typeof(int?)) - editor = new IntegerUpDownEditor(); - else if (propertyItem.PropertyType == typeof(DateTime)) - editor = new DateTimeUpDownEditor(); - else if (propertyItem.PropertyType.IsEnum) - editor = new EnumComboBoxEditor(); - else if (propertyItem.PropertyType == typeof(FontFamily) || propertyItem.PropertyType == typeof(FontWeight) || propertyItem.PropertyType == typeof(FontStyle) || propertyItem.PropertyType == typeof(FontStretch)) - editor = new FontComboBoxEditor(); - else - editor = new TextBoxEditor(); + //no custom editor found + if (editor == null) + { + if (propertyItem.IsReadOnly) + editor = new TextBlockEditor(); + else if (propertyItem.PropertyType == typeof(bool)) + editor = new CheckBoxEditor(); + else if (propertyItem.PropertyType == typeof(decimal) || propertyItem.PropertyType == typeof(decimal?)) + editor = new DecimalUpDownEditor(); + else if (propertyItem.PropertyType == typeof(double) || propertyItem.PropertyType == typeof(double?)) + editor = new DoubleUpDownEditor(); + else if (propertyItem.PropertyType == typeof(int) || propertyItem.PropertyType == typeof(int?)) + editor = new IntegerUpDownEditor(); + else if (propertyItem.PropertyType == typeof(DateTime)) + editor = new DateTimeUpDownEditor(); + else if (propertyItem.PropertyType.IsEnum) + editor = new EnumComboBoxEditor(); + else if (propertyItem.PropertyType == typeof(FontFamily) || propertyItem.PropertyType == typeof(FontWeight) || propertyItem.PropertyType == typeof(FontStyle) || propertyItem.PropertyType == typeof(FontStretch)) + editor = new FontComboBoxEditor(); + else + editor = new TextBoxEditor(); + } + } + catch (Exception ex) + { + } editor.Attach(propertyItem); diff --git a/ExtendedWPFToolkitSolution_35/ExtendedWPFToolkit.sln b/ExtendedWPFToolkitSolution_35/ExtendedWPFToolkit.sln index 3a8496f2..d0d4034b 100644 --- a/ExtendedWPFToolkitSolution_35/ExtendedWPFToolkit.sln +++ b/ExtendedWPFToolkitSolution_35/ExtendedWPFToolkit.sln @@ -1,6 +1,6 @@  -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WPFToolkit.Extended", "Src\WPFToolkit.Extended\WPFToolkit.Extended.csproj", "{72E591D6-8F83-4D8C-8F67-9C325E623234}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WPFToolkit.Extended.Examples", "Src\WPFToolkit.Extended.Examples\WPFToolkit.Extended.Examples.csproj", "{747652D0-6AA6-4F96-99F7-0C834274FAB2}" @@ -9,7 +9,7 @@ Global GlobalSection(TeamFoundationVersionControl) = preSolution SccNumberOfProjects = 3 SccEnterpriseProvider = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C} - SccTeamFoundationServer = https://tfs.codeplex.com/tfs/TFS02 + SccTeamFoundationServer = https://tfs.codeplex.com/tfs/tfs02 SccLocalPath0 = . SccProjectUniqueName1 = Src\\WPFToolkit.Extended\\WPFToolkit.Extended.csproj SccProjectName1 = Src/WPFToolkit.Extended diff --git a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended.Examples/Properties/Resources.Designer.cs b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended.Examples/Properties/Resources.Designer.cs index 7a589ef7..c3711362 100644 --- a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended.Examples/Properties/Resources.Designer.cs +++ b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended.Examples/Properties/Resources.Designer.cs @@ -1,17 +1,17 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.4952 +// Runtime Version:4.0.30319.225 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // //------------------------------------------------------------------------------ -namespace WPFToolkit.Extended.Examples.Properties -{ - - +namespace WPFToolkit.Extended.Examples.Properties { + using System; + + /// /// A strongly-typed resource class, for looking up localized strings, etc. /// @@ -19,51 +19,43 @@ namespace WPFToolkit.Extended.Examples.Properties // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources - { - + internal class Resources { + private static global::System.Resources.ResourceManager resourceMan; - + private static global::System.Globalization.CultureInfo resourceCulture; - + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() - { + internal Resources() { } - + /// /// Returns the cached ResourceManager instance used by this class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager - { - get - { - if ((resourceMan == null)) - { + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WPFToolkit.Extended.Examples.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; } } - + /// /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture - { - get - { + internal static global::System.Globalization.CultureInfo Culture { + get { return resourceCulture; } - set - { + set { resourceCulture = value; } } diff --git a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended.Examples/Properties/Settings.Designer.cs b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended.Examples/Properties/Settings.Designer.cs index 604a14c1..edee43de 100644 --- a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended.Examples/Properties/Settings.Designer.cs +++ b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended.Examples/Properties/Settings.Designer.cs @@ -1,28 +1,24 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.4952 +// Runtime Version:4.0.30319.225 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // //------------------------------------------------------------------------------ -namespace WPFToolkit.Extended.Examples.Properties -{ - - +namespace WPFToolkit.Extended.Examples.Properties { + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase - { - + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default - { - get - { + + public static Settings Default { + get { return defaultInstance; } } diff --git a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended.Examples/WPFToolkit.Extended.Examples.csproj b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended.Examples/WPFToolkit.Extended.Examples.csproj index 9150807f..1fce92a3 100644 --- a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended.Examples/WPFToolkit.Extended.Examples.csproj +++ b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended.Examples/WPFToolkit.Extended.Examples.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU @@ -18,6 +18,11 @@ SAK SAK SAK + + + + + 3.5 true @@ -58,10 +63,14 @@ MSBuild:Compile Designer + MSBuild:Compile + Designer MSBuild:Compile Designer + MSBuild:Compile + Designer App.xaml diff --git a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/ButtonSpinner/Themes/Generic.xaml b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/ButtonSpinner/Themes/Generic.xaml index 00d06d5f..73c19ad1 100644 --- a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/ButtonSpinner/Themes/Generic.xaml +++ b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/ButtonSpinner/Themes/Generic.xaml @@ -7,6 +7,8 @@ + + @@ -40,7 +42,7 @@ - + diff --git a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/Calculator/Themes/Generic.xaml b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/Calculator/Themes/Generic.xaml new file mode 100644 index 00000000..37529ff7 --- /dev/null +++ b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/Calculator/Themes/Generic.xaml @@ -0,0 +1,496 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +