diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/ColorPicker/ColorPicker.cs b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/ColorPicker/ColorPicker.cs
index 03b31965..d87447d8 100644
--- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/ColorPicker/ColorPicker.cs
+++ b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/ColorPicker/ColorPicker.cs
@@ -269,7 +269,7 @@ namespace Microsoft.Windows.Controls
void ColorShadingCanvas_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
Point p = e.GetPosition(_colorShadingCanvas);
- UpdateColorShadeSelectorPositionAndCalculateColor(p);
+ UpdateColorShadeSelectorPositionAndCalculateColor(p, true);
}
void ColorShadingCanvas_MouseMove(object sender, MouseEventArgs e)
@@ -277,7 +277,7 @@ namespace Microsoft.Windows.Controls
if (e.LeftButton == MouseButtonState.Pressed)
{
Point p = e.GetPosition(_colorShadingCanvas);
- UpdateColorShadeSelectorPositionAndCalculateColor(p);
+ UpdateColorShadeSelectorPositionAndCalculateColor(p, true);
Mouse.Synchronize();
}
}
@@ -338,7 +338,7 @@ namespace Microsoft.Windows.Controls
UpdateColorShadeSelectorPosition(_currentColor);
}
- private void UpdateColorShadeSelectorPositionAndCalculateColor(Point p, bool calculateColor = true)
+ private void UpdateColorShadeSelectorPositionAndCalculateColor(Point p, bool calculateColor)
{
if (p.Y < 0)
p.Y = 0;
diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/MaskedTextBox/MaskedTextBox.cs b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/MaskedTextBox/MaskedTextBox.cs
index 6cfec820..c877788e 100644
--- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/MaskedTextBox/MaskedTextBox.cs
+++ b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/MaskedTextBox/MaskedTextBox.cs
@@ -117,10 +117,17 @@ namespace Microsoft.Windows.Controls
{
convertedValue = valueToConvert;
}
+#if !VS2008
else if (String.IsNullOrWhiteSpace(valueToConvert))
{
convertedValue = Activator.CreateInstance(dataType);
}
+#else
+ else if (String.IsNullOrEmpty(valueToConvert))
+ {
+ convertedValue = Activator.CreateInstance(dataType);
+ }
+#endif
else if (null == convertedValue && valueToConvert is IConvertible)
{
convertedValue = Convert.ChangeType(valueToConvert, dataType);
diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/RichTextBoxFormatBar/RichTextBoxFormatBarManager.cs b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/RichTextBoxFormatBar/RichTextBoxFormatBarManager.cs
index d7553cf7..7f5cdce2 100644
--- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/RichTextBoxFormatBar/RichTextBoxFormatBarManager.cs
+++ b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/RichTextBoxFormatBar/RichTextBoxFormatBarManager.cs
@@ -57,10 +57,17 @@ namespace Microsoft.Windows.Controls
if (e.LeftButton == MouseButtonState.Released)
{
TextRange selectedText = new TextRange(_richTextBox.Selection.Start, _richTextBox.Selection.End);
+#if !VS2008
if (selectedText.Text.Length > 0 && !String.IsNullOrWhiteSpace(selectedText.Text))
{
ShowAdorner();
}
+#else
+ if (selectedText.Text.Length > 0 && !String.IsNullOrEmpty(selectedText.Text))
+ {
+ ShowAdorner();
+ }
+#endif
else
{
HideAdorner();
diff --git a/ExtendedWPFToolkitSolution_35/ExtendedWPFToolkit.sln b/ExtendedWPFToolkitSolution_35/ExtendedWPFToolkit.sln
index e1ed3032..3a8496f2 100644
--- a/ExtendedWPFToolkitSolution_35/ExtendedWPFToolkit.sln
+++ b/ExtendedWPFToolkitSolution_35/ExtendedWPFToolkit.sln
@@ -3,15 +3,20 @@ Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
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}"
+EndProject
Global
GlobalSection(TeamFoundationVersionControl) = preSolution
- SccNumberOfProjects = 2
+ SccNumberOfProjects = 3
SccEnterpriseProvider = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}
SccTeamFoundationServer = https://tfs.codeplex.com/tfs/TFS02
SccLocalPath0 = .
SccProjectUniqueName1 = Src\\WPFToolkit.Extended\\WPFToolkit.Extended.csproj
SccProjectName1 = Src/WPFToolkit.Extended
SccLocalPath1 = Src\\WPFToolkit.Extended
+ SccProjectUniqueName2 = Src\\WPFToolkit.Extended.Examples\\WPFToolkit.Extended.Examples.csproj
+ SccProjectName2 = Src/WPFToolkit.Extended.Examples
+ SccLocalPath2 = Src\\WPFToolkit.Extended.Examples
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -22,6 +27,10 @@ Global
{72E591D6-8F83-4D8C-8F67-9C325E623234}.Debug|Any CPU.Build.0 = Debug|Any CPU
{72E591D6-8F83-4D8C-8F67-9C325E623234}.Release|Any CPU.ActiveCfg = Release|Any CPU
{72E591D6-8F83-4D8C-8F67-9C325E623234}.Release|Any CPU.Build.0 = Release|Any CPU
+ {747652D0-6AA6-4F96-99F7-0C834274FAB2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {747652D0-6AA6-4F96-99F7-0C834274FAB2}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {747652D0-6AA6-4F96-99F7-0C834274FAB2}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {747652D0-6AA6-4F96-99F7-0C834274FAB2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended.Examples/App.xaml b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended.Examples/App.xaml
new file mode 100644
index 00000000..b6483ed1
--- /dev/null
+++ b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended.Examples/App.xaml
@@ -0,0 +1,8 @@
+
+
+
+
+
diff --git a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended.Examples/App.xaml.cs b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended.Examples/App.xaml.cs
new file mode 100644
index 00000000..490ee2d0
--- /dev/null
+++ b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended.Examples/App.xaml.cs
@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Data;
+using System.Linq;
+using System.Windows;
+
+namespace WPFToolkit.Extended.Examples
+{
+ ///
+ /// Interaction logic for App.xaml
+ ///
+ public partial class App : Application
+ {
+ }
+}
diff --git a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended.Examples/Properties/AssemblyInfo.cs b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended.Examples/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000..af4eebe1
--- /dev/null
+++ b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended.Examples/Properties/AssemblyInfo.cs
@@ -0,0 +1,55 @@
+using System.Reflection;
+using System.Resources;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Windows;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("WPFToolkit.Extended.Examples")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Microsoft")]
+[assembly: AssemblyProduct("WPFToolkit.Extended.Examples")]
+[assembly: AssemblyCopyright("Copyright © Microsoft 2010")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+//In order to begin building localizable applications, set
+//CultureYouAreCodingWith in your .csproj file
+//inside a . For example, if you are using US english
+//in your source files, set the to en-US. Then uncomment
+//the NeutralResourceLanguage attribute below. Update the "en-US" in
+//the line below to match the UICulture setting in the project file.
+
+//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
+
+
+[assembly: ThemeInfo(
+ ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
+ //(used if a resource is not found in the page,
+ // or application resource dictionaries)
+ ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
+ //(used if a resource is not found in the page,
+ // app, or any theme specific resource dictionaries)
+)]
+
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// 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("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended.Examples/Properties/Resources.Designer.cs b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended.Examples/Properties/Resources.Designer.cs
new file mode 100644
index 00000000..7a589ef7
--- /dev/null
+++ b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended.Examples/Properties/Resources.Designer.cs
@@ -0,0 +1,71 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:2.0.50727.4952
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace WPFToolkit.Extended.Examples.Properties
+{
+
+
+ ///
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ ///
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // 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.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ 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()
+ {
+ }
+
+ ///
+ /// 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))
+ {
+ 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
+ {
+ return resourceCulture;
+ }
+ set
+ {
+ resourceCulture = value;
+ }
+ }
+ }
+}
diff --git a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended.Examples/Properties/Resources.resx b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended.Examples/Properties/Resources.resx
new file mode 100644
index 00000000..ffecec85
--- /dev/null
+++ b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended.Examples/Properties/Resources.resx
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended.Examples/Properties/Settings.Designer.cs b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended.Examples/Properties/Settings.Designer.cs
new file mode 100644
index 00000000..604a14c1
--- /dev/null
+++ b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended.Examples/Properties/Settings.Designer.cs
@@ -0,0 +1,30 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:2.0.50727.4952
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+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
+ {
+
+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+ public static Settings Default
+ {
+ get
+ {
+ return defaultInstance;
+ }
+ }
+ }
+}
diff --git a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended.Examples/Properties/Settings.settings b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended.Examples/Properties/Settings.settings
new file mode 100644
index 00000000..8f2fd95d
--- /dev/null
+++ b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended.Examples/Properties/Settings.settings
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended.Examples/WPFToolkit.Extended.Examples.csproj b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended.Examples/WPFToolkit.Extended.Examples.csproj
new file mode 100644
index 00000000..9150807f
--- /dev/null
+++ b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended.Examples/WPFToolkit.Extended.Examples.csproj
@@ -0,0 +1,113 @@
+
+
+
+ Debug
+ AnyCPU
+ 9.0.30729
+ 2.0
+ {747652D0-6AA6-4F96-99F7-0C834274FAB2}
+ WinExe
+ Properties
+ WPFToolkit.Extended.Examples
+ WPFToolkit.Extended.Examples
+ v3.5
+ 512
+ {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
+ 4
+ SAK
+ SAK
+ SAK
+ SAK
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+
+ 3.5
+
+
+ 3.5
+
+
+ 3.5
+
+
+
+
+
+
+
+
+
+
+ MSBuild:Compile
+ Designer
+
+
+ MSBuild:Compile
+ Designer
+
+
+ App.xaml
+ Code
+
+
+ Window1.xaml
+ Code
+
+
+
+
+ Code
+
+
+ True
+ True
+ Resources.resx
+
+
+ True
+ Settings.settings
+ True
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.cs
+
+
+
+
+
+ {72E591D6-8F83-4D8C-8F67-9C325E623234}
+ WPFToolkit.Extended
+
+
+
+
+
\ No newline at end of file
diff --git a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended.Examples/WPFToolkit.Extended.Examples.csproj.vspscc b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended.Examples/WPFToolkit.Extended.Examples.csproj.vspscc
new file mode 100644
index 00000000..feffdeca
--- /dev/null
+++ b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended.Examples/WPFToolkit.Extended.Examples.csproj.vspscc
@@ -0,0 +1,10 @@
+""
+{
+"FILE_VERSION" = "9237"
+"ENLISTMENT_CHOICE" = "NEVER"
+"PROJECT_FILE_RELATIVE_PATH" = ""
+"NUMBER_OF_EXCLUDED_FILES" = "0"
+"ORIGINAL_PROJECT_FILE_PATH" = ""
+"NUMBER_OF_NESTED_PROJECTS" = "0"
+"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
+}
diff --git a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended.Examples/Window1.xaml b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended.Examples/Window1.xaml
new file mode 100644
index 00000000..78cc5db9
--- /dev/null
+++ b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended.Examples/Window1.xaml
@@ -0,0 +1,9 @@
+
+
+
+
+
diff --git a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended.Examples/Window1.xaml.cs b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended.Examples/Window1.xaml.cs
new file mode 100644
index 00000000..009eb35f
--- /dev/null
+++ b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended.Examples/Window1.xaml.cs
@@ -0,0 +1,33 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace WPFToolkit.Extended.Examples
+{
+ ///
+ /// Interaction logic for Window1.xaml
+ ///
+ public partial class Window1 : Window
+ {
+ public Window1()
+ {
+ InitializeComponent();
+ Loaded += new RoutedEventHandler(Window1_Loaded);
+ }
+
+ void Window1_Loaded(object sender, RoutedEventArgs e)
+ {
+ Microsoft.Windows.Controls.MessageBox.Show("MyStezt", "Test", MessageBoxButton.OKCancel, MessageBoxImage.Stop);
+ }
+ }
+}
diff --git a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/BusyIndicator/BusyIndicator.cs b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/BusyIndicator/BusyIndicator.cs
deleted file mode 100644
index 6a73cd8f..00000000
--- a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/BusyIndicator/BusyIndicator.cs
+++ /dev/null
@@ -1,266 +0,0 @@
-using System;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Shapes;
-using System.Windows.Threading;
-
-namespace Microsoft.Windows.Controls
-{
- ///
- /// A control to provide a visual indicator when an application is busy.
- ///
- [TemplateVisualState(Name = VisualStates.StateIdle, GroupName = VisualStates.GroupBusyStatus)]
- [TemplateVisualState(Name = VisualStates.StateBusy, GroupName = VisualStates.GroupBusyStatus)]
- [TemplateVisualState(Name = VisualStates.StateVisible, GroupName = VisualStates.GroupVisibility)]
- [TemplateVisualState(Name = VisualStates.StateHidden, GroupName = VisualStates.GroupVisibility)]
- [StyleTypedProperty(Property = "OverlayStyle", StyleTargetType = typeof(Rectangle))]
- [StyleTypedProperty(Property = "ProgressBarStyle", StyleTargetType = typeof(ProgressBar))]
- public class BusyIndicator : ContentControl
- {
- #region Private Members
-
- ///
- /// Timer used to delay the initial display and avoid flickering.
- ///
- private DispatcherTimer _displayAfterTimer = new DispatcherTimer();
-
- #endregion //Private Members
-
- #region Constructors
-
- static BusyIndicator()
- {
- DefaultStyleKeyProperty.OverrideMetadata(typeof(BusyIndicator), new FrameworkPropertyMetadata(typeof(BusyIndicator)));
- }
-
- public BusyIndicator()
- {
- _displayAfterTimer.Tick += DisplayAfterTimerElapsed;
- }
-
- #endregion //Constructors
-
- #region Base Class Overrides
-
- ///
- /// Overrides the OnApplyTemplate method.
- ///
- public override void OnApplyTemplate()
- {
- base.OnApplyTemplate();
- ChangeVisualState(false);
- }
-
- #endregion //Base Class Overrides
-
- #region Properties
-
- ///
- /// Gets or sets a value indicating whether the BusyContent is visible.
- ///
- protected bool IsContentVisible { get; set; }
-
- #endregion //Properties
-
- #region Dependency Properties
-
- #region IsBusy
-
- ///
- /// Identifies the IsBusy dependency property.
- ///
- public static readonly DependencyProperty IsBusyProperty = DependencyProperty.Register(
- "IsBusy",
- typeof(bool),
- typeof(BusyIndicator),
- new PropertyMetadata(false, new PropertyChangedCallback(OnIsBusyChanged)));
-
- ///
- /// Gets or sets a value indicating whether the busy indicator should show.
- ///
- public bool IsBusy
- {
- get { return (bool)GetValue(IsBusyProperty); }
- set { SetValue(IsBusyProperty, value); }
- }
-
- ///
- /// IsBusyProperty property changed handler.
- ///
- /// BusyIndicator that changed its IsBusy.
- /// Event arguments.
- private static void OnIsBusyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
- {
- ((BusyIndicator)d).OnIsBusyChanged(e);
- }
-
- ///
- /// IsBusyProperty property changed handler.
- ///
- /// Event arguments.
- protected virtual void OnIsBusyChanged(DependencyPropertyChangedEventArgs e)
- {
- if (IsBusy)
- {
- if (DisplayAfter.Equals(TimeSpan.Zero))
- {
- // Go visible now
- IsContentVisible = true;
- }
- else
- {
- // Set a timer to go visible
- _displayAfterTimer.Interval = DisplayAfter;
- _displayAfterTimer.Start();
- }
- }
- else
- {
- // No longer visible
- _displayAfterTimer.Stop();
- IsContentVisible = false;
- }
-
- ChangeVisualState(true);
- }
-
- #endregion //IsBusy
-
- #region Busy Content
-
- ///
- /// Identifies the BusyContent dependency property.
- ///
- public static readonly DependencyProperty BusyContentProperty = DependencyProperty.Register(
- "BusyContent",
- typeof(object),
- typeof(BusyIndicator),
- new PropertyMetadata(null));
-
- ///
- /// Gets or sets a value indicating the busy content to display to the user.
- ///
- public object BusyContent
- {
- get { return (object)GetValue(BusyContentProperty); }
- set { SetValue(BusyContentProperty, value); }
- }
-
- #endregion //Busy Content
-
- #region Busy Content Template
-
- ///
- /// Identifies the BusyTemplate dependency property.
- ///
- public static readonly DependencyProperty BusyContentTemplateProperty = DependencyProperty.Register(
- "BusyContentTemplate",
- typeof(DataTemplate),
- typeof(BusyIndicator),
- new PropertyMetadata(null));
-
- ///
- /// Gets or sets a value indicating the template to use for displaying the busy content to the user.
- ///
- public DataTemplate BusyContentTemplate
- {
- get { return (DataTemplate)GetValue(BusyContentTemplateProperty); }
- set { SetValue(BusyContentTemplateProperty, value); }
- }
-
- #endregion //Busy Content Template
-
- #region Display After
-
- ///
- /// Identifies the DisplayAfter dependency property.
- ///
- public static readonly DependencyProperty DisplayAfterProperty = DependencyProperty.Register(
- "DisplayAfter",
- typeof(TimeSpan),
- typeof(BusyIndicator),
- new PropertyMetadata(TimeSpan.FromSeconds(0.1)));
-
- ///
- /// Gets or sets a value indicating how long to delay before displaying the busy content.
- ///
- public TimeSpan DisplayAfter
- {
- get { return (TimeSpan)GetValue(DisplayAfterProperty); }
- set { SetValue(DisplayAfterProperty, value); }
- }
-
- #endregion //Display After
-
- #region Overlay Style
-
- ///
- /// Identifies the OverlayStyle dependency property.
- ///
- public static readonly DependencyProperty OverlayStyleProperty = DependencyProperty.Register(
- "OverlayStyle",
- typeof(Style),
- typeof(BusyIndicator),
- new PropertyMetadata(null));
-
- ///
- /// Gets or sets a value indicating the style to use for the overlay.
- ///
- public Style OverlayStyle
- {
- get { return (Style)GetValue(OverlayStyleProperty); }
- set { SetValue(OverlayStyleProperty, value); }
- }
- #endregion //Overlay Style
-
- #region ProgressBar Style
-
- ///
- /// Identifies the ProgressBarStyle dependency property.
- ///
- public static readonly DependencyProperty ProgressBarStyleProperty = DependencyProperty.Register(
- "ProgressBarStyle",
- typeof(Style),
- typeof(BusyIndicator),
- new PropertyMetadata(null));
-
- ///
- /// Gets or sets a value indicating the style to use for the progress bar.
- ///
- public Style ProgressBarStyle
- {
- get { return (Style)GetValue(ProgressBarStyleProperty); }
- set { SetValue(ProgressBarStyleProperty, value); }
- }
-
- #endregion //ProgressBar Style
-
- #endregion //Dependency Properties
-
- #region Methods
-
- ///
- /// Handler for the DisplayAfterTimer.
- ///
- /// Event sender.
- /// Event arguments.
- private void DisplayAfterTimerElapsed(object sender, EventArgs e)
- {
- _displayAfterTimer.Stop();
- IsContentVisible = true;
- ChangeVisualState(true);
- }
-
- ///
- /// Changes the control's visual state(s).
- ///
- /// True if state transitions should be used.
- protected virtual void ChangeVisualState(bool useTransitions)
- {
- VisualStateManager.GoToState(this, IsBusy ? VisualStates.StateBusy : VisualStates.StateIdle, useTransitions);
- VisualStateManager.GoToState(this, IsContentVisible ? VisualStates.StateVisible : VisualStates.StateHidden, useTransitions);
- }
-
- #endregion //Methods
- }
-}
diff --git a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/BusyIndicator/VisualStates.BusyIndicator.cs b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/BusyIndicator/VisualStates.BusyIndicator.cs
deleted file mode 100644
index 5d78d952..00000000
--- a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/BusyIndicator/VisualStates.BusyIndicator.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-using System;
-
-namespace Microsoft.Windows.Controls
-{
- internal static partial class VisualStates
- {
- ///
- /// Busyness group name.
- ///
- public const string GroupBusyStatus = "BusyStatusStates";
-
- ///
- /// Busy state for BusyIndicator.
- ///
- public const string StateBusy = "Busy";
-
- ///
- /// Idle state for BusyIndicator.
- ///
- public const string StateIdle = "Idle";
-
- ///
- /// BusyDisplay group.
- ///
- public const string GroupVisibility = "VisibilityStates";
-
- ///
- /// Visible state name for BusyIndicator.
- ///
- public const string StateVisible = "Visible";
-
- ///
- /// Hidden state name for BusyIndicator.
- ///
- public const string StateHidden = "Hidden";
- }
-}
diff --git a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/ButtonSpinner/ButtonSpinner.cs b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/ButtonSpinner/ButtonSpinner.cs
deleted file mode 100644
index b2c2ad99..00000000
--- a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/ButtonSpinner/ButtonSpinner.cs
+++ /dev/null
@@ -1,191 +0,0 @@
-using System;
-using System.Windows;
-using System.Windows.Input;
-using System.Windows.Markup;
-using System.Windows.Controls.Primitives;
-
-namespace Microsoft.Windows.Controls
-{
- ///
- /// Represents a spinner control that includes two Buttons.
- ///
- [ContentProperty("Content")]
- public class ButtonSpinner : Spinner
- {
- #region Properties
-
- #region Content
-
- ///
- /// Identifies the Content dependency property.
- ///
- public static readonly DependencyProperty ContentProperty = DependencyProperty.Register("Content", typeof(object), typeof(ButtonSpinner), new PropertyMetadata(null, OnContentPropertyChanged));
- public object Content
- {
- get { return GetValue(ContentProperty) as object; }
- set { SetValue(ContentProperty, value); }
- }
-
- ///
- /// ContentProperty property changed handler.
- ///
- /// ButtonSpinner that changed its Content.
- /// Event arguments.
- private static void OnContentPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
- {
- ButtonSpinner source = d as ButtonSpinner;
- source.OnContentChanged(e.OldValue, e.NewValue);
- }
-
- #endregion //Content
-
- private ButtonBase _increaseButton;
- ///
- /// Gets or sets the IncreaseButton template part.
- ///
- private ButtonBase IncreaseButton
- {
- get { return _increaseButton; }
- set
- {
- if (_increaseButton != null)
- {
- _increaseButton.Click -= OnButtonClick;
- }
-
- _increaseButton = value;
-
- if (_increaseButton != null)
- {
- _increaseButton.Click += OnButtonClick;
- }
- }
- }
-
-
- private ButtonBase _decreaseButton;
- ///
- /// Gets or sets the DecreaseButton template part.
- ///
- private ButtonBase DecreaseButton
- {
- get { return _decreaseButton; }
- set
- {
- if (_decreaseButton != null)
- {
- _decreaseButton.Click -= OnButtonClick;
- }
-
- _decreaseButton = value;
-
- if (_decreaseButton != null)
- {
- _decreaseButton.Click += OnButtonClick;
- }
- }
- }
-
- #endregion //Properties
-
- #region Constructors
-
- static ButtonSpinner()
- {
- DefaultStyleKeyProperty.OverrideMetadata(typeof(ButtonSpinner), new FrameworkPropertyMetadata(typeof(ButtonSpinner)));
- }
-
- #endregion //Constructors
-
- #region Base Class Overrides
-
- public override void OnApplyTemplate()
- {
- base.OnApplyTemplate();
-
- IncreaseButton = GetTemplateChild("IncreaseButton") as ButtonBase;
- DecreaseButton = GetTemplateChild("DecreaseButton") as ButtonBase;
-
- SetButtonUsage();
- }
-
- #endregion //Base Class Overrides
-
- ///
- /// Occurs when the Content property value changed.
- ///
- /// The old value of the Content property.
- /// The new value of the Content property.
- protected virtual void OnContentChanged(object oldValue, object newValue) { }
-
- ///
- /// Handle click event of IncreaseButton and DecreaseButton template parts,
- /// translating Click to appropriate Spin event.
- ///
- /// Event sender, should be either IncreaseButton or DecreaseButton template part.
- /// Event args.
- private void OnButtonClick(object sender, RoutedEventArgs e)
- {
- SpinDirection direction = sender == IncreaseButton ? SpinDirection.Increase : SpinDirection.Decrease;
- OnSpin(new SpinEventArgs(direction));
- }
-
- ///
- /// Cancel LeftMouseButtonUp events originating from a button that has
- /// been changed to disabled.
- ///
- /// The data for the event.
- protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e)
- {
- base.OnMouseLeftButtonUp(e);
-
- Point mousePosition;
- if (IncreaseButton != null && IncreaseButton.IsEnabled == false)
- {
- mousePosition = e.GetPosition(IncreaseButton);
- if (mousePosition.X > 0 && mousePosition.X < IncreaseButton.ActualWidth &&
- mousePosition.Y > 0 && mousePosition.Y < IncreaseButton.ActualHeight)
- {
- e.Handled = true;
- }
- }
-
- if (DecreaseButton != null && DecreaseButton.IsEnabled == false)
- {
- mousePosition = e.GetPosition(DecreaseButton);
- if (mousePosition.X > 0 && mousePosition.X < DecreaseButton.ActualWidth &&
- mousePosition.Y > 0 && mousePosition.Y < DecreaseButton.ActualHeight)
- {
- e.Handled = true;
- }
- }
- }
-
- ///
- /// Called when valid spin direction changed.
- ///
- /// The old value.
- /// The new value.
- protected override void OnValidSpinDirectionChanged(ValidSpinDirections oldValue, ValidSpinDirections newValue)
- {
- SetButtonUsage();
- }
-
- ///
- /// Disables or enables the buttons based on the valid spin direction.
- ///
- private void SetButtonUsage()
- {
- // buttonspinner adds buttons that spin, so disable accordingly.
- if (IncreaseButton != null)
- {
- IncreaseButton.IsEnabled = ((ValidSpinDirection & ValidSpinDirections.Increase) == ValidSpinDirections.Increase);
- }
-
- if (DecreaseButton != null)
- {
- DecreaseButton.IsEnabled = ((ValidSpinDirection & ValidSpinDirections.Decrease) == ValidSpinDirections.Decrease);
- }
- }
- }
-}
diff --git a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/ButtonSpinner/SpinDirection.cs b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/ButtonSpinner/SpinDirection.cs
deleted file mode 100644
index aaa121fb..00000000
--- a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/ButtonSpinner/SpinDirection.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using System;
-
-namespace Microsoft.Windows.Controls
-{
- ///
- /// Represents spin directions that could be initiated by the end-user.
- ///
- /// Preview
- public enum SpinDirection
- {
- ///
- /// Represents a spin initiated by the end-user in order to Increase a value.
- ///
- Increase = 0,
-
- ///
- /// Represents a spin initiated by the end-user in order to Decrease a value.
- ///
- Decrease = 1
- }
-}
diff --git a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/ButtonSpinner/SpinEventArgs.cs b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/ButtonSpinner/SpinEventArgs.cs
deleted file mode 100644
index f8a89385..00000000
--- a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/ButtonSpinner/SpinEventArgs.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-using System;
-using System.Windows;
-
-namespace Microsoft.Windows.Controls
-{
- ///
- /// Provides data for the Spinner.Spin event.
- ///
- /// Preview
- public class SpinEventArgs : RoutedEventArgs
- {
- ///
- /// Gets the SpinDirection for the spin that has been initiated by the
- /// end-user.
- ///
- public SpinDirection Direction { get; private set; }
-
- ///
- /// Initializes a new instance of the SpinEventArgs class.
- ///
- /// Spin direction.
- public SpinEventArgs(SpinDirection direction)
- : base()
- {
- Direction = direction;
- }
- }
-}
diff --git a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/ButtonSpinner/Spinner.cs b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/ButtonSpinner/Spinner.cs
deleted file mode 100644
index 20b8d1cb..00000000
--- a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/ButtonSpinner/Spinner.cs
+++ /dev/null
@@ -1,77 +0,0 @@
-using System;
-using System.Windows.Controls;
-using System.Windows;
-
-namespace Microsoft.Windows.Controls
-{
- ///
- /// Base class for controls that represents controls that can spin.
- ///
- public abstract class Spinner : Control
- {
- #region Properties
-
- ///
- /// Identifies the ValidSpinDirection dependency property.
- ///
- public static readonly DependencyProperty ValidSpinDirectionProperty = DependencyProperty.Register("ValidSpinDirection", typeof(ValidSpinDirections), typeof(Spinner), new PropertyMetadata(ValidSpinDirections.Increase | ValidSpinDirections.Decrease, OnValidSpinDirectionPropertyChanged));
- public ValidSpinDirections ValidSpinDirection
- {
- get { return (ValidSpinDirections)GetValue(ValidSpinDirectionProperty); }
- set { SetValue(ValidSpinDirectionProperty, value); }
- }
-
- ///
- /// ValidSpinDirectionProperty property changed handler.
- ///
- /// ButtonSpinner that changed its ValidSpinDirection.
- /// Event arguments.
- private static void OnValidSpinDirectionPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
- {
- Spinner source = (Spinner)d;
- ValidSpinDirections oldvalue = (ValidSpinDirections)e.OldValue;
- ValidSpinDirections newvalue = (ValidSpinDirections)e.NewValue;
- source.OnValidSpinDirectionChanged(oldvalue, newvalue);
- }
-
- #endregion //Properties
-
- ///
- /// Occurs when spinning is initiated by the end-user.
- ///
- public event EventHandler Spin;
-
- ///
- /// Initializes a new instance of the Spinner class.
- ///
- protected Spinner() { }
-
- ///
- /// Raises the OnSpin event when spinning is initiated by the end-user.
- ///
- /// Spin event args.
- protected virtual void OnSpin(SpinEventArgs e)
- {
- ValidSpinDirections valid = e.Direction == SpinDirection.Increase ? ValidSpinDirections.Increase : ValidSpinDirections.Decrease;
-
- if ((ValidSpinDirection & valid) != valid)
- {
- // spin is not allowed.
- throw new InvalidOperationException("Spin action is not valid at this moment.");
- }
-
- EventHandler handler = Spin;
- if (handler != null)
- {
- handler(this, e);
- }
- }
-
- ///
- /// Called when valid spin direction changed.
- ///
- /// The old value.
- /// The new value.
- protected virtual void OnValidSpinDirectionChanged(ValidSpinDirections oldValue, ValidSpinDirections newValue) { }
- }
-}
diff --git a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/ButtonSpinner/ValidSpinDirections.cs b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/ButtonSpinner/ValidSpinDirections.cs
deleted file mode 100644
index d744620d..00000000
--- a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/ButtonSpinner/ValidSpinDirections.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-using System;
-
-namespace Microsoft.Windows.Controls
-{
- ///
- /// Represents spin directions that are valid.
- ///
- [Flags]
- public enum ValidSpinDirections
- {
- ///
- /// Can not increase nor decrease.
- ///
- None = 0,
-
- ///
- /// Can increase.
- ///
- Increase = 1,
-
- ///
- /// Can decrease.
- ///
- Decrease = 2
- }
-}
diff --git a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/ChildWindow/ChildWindow.cs b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/ChildWindow/ChildWindow.cs
deleted file mode 100644
index 8a44695d..00000000
--- a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/ChildWindow/ChildWindow.cs
+++ /dev/null
@@ -1,482 +0,0 @@
-using System;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Controls.Primitives;
-using System.ComponentModel;
-
-namespace Microsoft.Windows.Controls
-{
- [TemplateVisualState(GroupName = VisualStates.WindowStatesGroup, Name = VisualStates.Open)]
- [TemplateVisualState(GroupName = VisualStates.WindowStatesGroup, Name = VisualStates.Closed)]
- public class ChildWindow : ContentControl
- {
- #region Private Members
-
- private TranslateTransform _moveTransform = new TranslateTransform();
- private bool _startupPositionInitialized;
- private bool _isMouseCaptured;
- private Point _clickPoint;
- private Point _oldPosition;
- private Border _dragWidget;
- private FrameworkElement _parent;
-
- #endregion //Private Members
-
- #region Constructors
-
- static ChildWindow()
- {
- DefaultStyleKeyProperty.OverrideMetadata(typeof(ChildWindow), new FrameworkPropertyMetadata(typeof(ChildWindow)));
- }
-
- public ChildWindow()
- {
- LayoutUpdated += (o, e) =>
- {
- //we only want to set the start position if this is the first time the control has bee initialized
- if (!_startupPositionInitialized)
- {
- SetStartupPosition();
- _startupPositionInitialized = true;
- }
- };
- }
-
- #endregion //Constructors
-
- #region Base Class Overrides
-
- public override void OnApplyTemplate()
- {
- base.OnApplyTemplate();
-
- _dragWidget = (Border)GetTemplateChild("PART_DragWidget");
- if (_dragWidget != null)
- {
- _dragWidget.AddHandler(UIElement.MouseLeftButtonDownEvent, new MouseButtonEventHandler(HeaderLeftMouseButtonDown), true);
- _dragWidget.AddHandler(UIElement.MouseLeftButtonUpEvent, new MouseButtonEventHandler(HeaderMouseLeftButtonUp), true);
- _dragWidget.MouseMove += (o, e) => HeaderMouseMove(e);
- }
-
- CloseButton = (Button)GetTemplateChild("PART_CloseButton");
- if (CloseButton != null)
- CloseButton.Click += (o, e) => Close();
-
- Overlay = GetTemplateChild("PART_Overlay") as Panel;
- WindowRoot = GetTemplateChild("PART_WindowRoot") as Grid;
-
- WindowRoot.RenderTransform = _moveTransform;
-
- //TODO: move somewhere else
- _parent = VisualTreeHelper.GetParent(this) as FrameworkElement;
- _parent.SizeChanged += (o, ea) =>
- {
- Overlay.Height = ea.NewSize.Height;
- Overlay.Width = ea.NewSize.Width;
- };
-
- ChangeVisualState();
- }
-
- #endregion //Base Class Overrides
-
- #region Properties
-
- #region Internal Properties
-
- internal Panel Overlay { get; private set; }
- internal Grid WindowRoot { get; private set; }
- internal Thumb DragWidget { get; private set; }
- internal Button MinimizeButton { get; private set; }
- internal Button MaximizeButton { get; private set; }
- internal Button CloseButton { get; private set; }
-
- #endregion //Internal Properties
-
- #region Dependency Properties
-
- public static readonly DependencyProperty CaptionProperty = DependencyProperty.Register("Caption", typeof(string), typeof(ChildWindow), new UIPropertyMetadata(String.Empty));
- public string Caption
- {
- get { return (string)GetValue(CaptionProperty); }
- set { SetValue(CaptionProperty, value); }
- }
-
- public static readonly DependencyProperty CaptionForegroundProperty = DependencyProperty.Register("CaptionForeground", typeof(Brush), typeof(ChildWindow), new UIPropertyMetadata(null));
- public Brush CaptionForeground
- {
- get { return (Brush)GetValue(CaptionForegroundProperty); }
- set { SetValue(CaptionForegroundProperty, value); }
- }
-
- public static readonly DependencyProperty CloseButtonStyleProperty = DependencyProperty.Register("CloseButtonStyle", typeof(Style), typeof(ChildWindow), new PropertyMetadata(null));
- public Style CloseButtonStyle
- {
- get { return (Style)GetValue(CloseButtonStyleProperty); }
- set { SetValue(CloseButtonStyleProperty, value); }
- }
-
- public static readonly DependencyProperty CloseButtonVisibilityProperty = DependencyProperty.Register("CloseButtonVisibility", typeof(Visibility), typeof(ChildWindow), new PropertyMetadata(Visibility.Visible));
- public Visibility CloseButtonVisibility
- {
- get { return (Visibility)GetValue(CloseButtonVisibilityProperty); }
- set { SetValue(CloseButtonVisibilityProperty, value); }
- }
-
- public static readonly DependencyProperty IconSourceProperty = DependencyProperty.Register("Icon", typeof(ImageSource), typeof(ChildWindow), new UIPropertyMetadata(default(ImageSource)));
- public ImageSource Icon
- {
- get { return (ImageSource)GetValue(IconSourceProperty); }
- set { SetValue(IconSourceProperty, value); }
- }
-
- public static readonly DependencyProperty IsModalProperty = DependencyProperty.Register("IsModal", typeof(bool), typeof(ChildWindow), new UIPropertyMetadata(true));
- public bool IsModal
- {
- get { return (bool)GetValue(IsModalProperty); }
- set { SetValue(IsModalProperty, value); }
- }
-
- #region Left
-
- public static readonly DependencyProperty LeftProperty = DependencyProperty.Register("Left", typeof(double), typeof(ChildWindow), new PropertyMetadata(0.0, new PropertyChangedCallback(OnLeftPropertyChanged)));
- public double Left
- {
- get { return (double)GetValue(LeftProperty); }
- set { SetValue(LeftProperty, value); }
- }
-
- private static void OnLeftPropertyChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
- {
- ChildWindow window = (ChildWindow)obj;
- window.Left = window.GetRestrictedLeft();
- window.ProcessMove((double)e.NewValue - (double)e.OldValue, 0);
- }
-
- #endregion //Left
-
- #region OverlayBrush
-
- public static readonly DependencyProperty OverlayBrushProperty = DependencyProperty.Register("OverlayBrush", typeof(Brush), typeof(ChildWindow));
- public Brush OverlayBrush
- {
- get { return (Brush)GetValue(OverlayBrushProperty); }
- set { SetValue(OverlayBrushProperty, value); }
- }
-
- #endregion //OverlayBrush
-
- #region OverlayOpacity
-
- public static readonly DependencyProperty OverlayOpacityProperty = DependencyProperty.Register("OverlayOpacity", typeof(double), typeof(ChildWindow));
- public double OverlayOpacity
- {
- get { return (double)GetValue(OverlayOpacityProperty); }
- set { SetValue(OverlayOpacityProperty, value); }
- }
-
- #endregion //OverlayOpacity
-
- #region Top
-
- public static readonly DependencyProperty TopProperty = DependencyProperty.Register("Top", typeof(double), typeof(ChildWindow), new PropertyMetadata(0.0, new PropertyChangedCallback(OnTopPropertyChanged)));
- public double Top
- {
- get { return (double)GetValue(TopProperty); }
- set { SetValue(TopProperty, value); }
- }
-
- private static void OnTopPropertyChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
- {
- ChildWindow window = (ChildWindow)obj;
- window.Top = window.GetRestrictedTop();
- window.ProcessMove(0, (double)e.NewValue - (double)e.OldValue);
- }
-
- #endregion //TopProperty
-
- public static readonly DependencyProperty WindowBackgroundProperty = DependencyProperty.Register("WindowBackground", typeof(Brush), typeof(ChildWindow), new PropertyMetadata(null));
- public Brush WindowBackground
- {
- get { return (Brush)GetValue(WindowBackgroundProperty); }
- set { SetValue(WindowBackgroundProperty, value); }
- }
-
- public static readonly DependencyProperty WindowBorderBrushProperty = DependencyProperty.Register("WindowBorderBrush", typeof(Brush), typeof(ChildWindow), new PropertyMetadata(null));
- public Brush WindowBorderBrush
- {
- get { return (Brush)GetValue(WindowBorderBrushProperty); }
- set { SetValue(WindowBorderBrushProperty, value); }
- }
-
- public static readonly DependencyProperty WindowOpacityProperty = DependencyProperty.Register("WindowOpacity", typeof(double), typeof(ChildWindow), new PropertyMetadata(null));
- public double WindowOpacity
- {
- get { return (double)GetValue(WindowOpacityProperty); }
- set { SetValue(WindowOpacityProperty, value); }
- }
-
- #region WindowState
-
- public static readonly DependencyProperty WindowStateProperty = DependencyProperty.Register("WindowState", typeof(WindowState), typeof(ChildWindow), new PropertyMetadata(WindowState.Open, new PropertyChangedCallback(OnWindowStatePropertyChanged)));
- public WindowState WindowState
- {
- get { return (WindowState)GetValue(WindowStateProperty); }
- set { SetValue(WindowStateProperty, value); }
- }
-
- private static void OnWindowStatePropertyChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
- {
- ChildWindow window = (ChildWindow)obj;
- window.SetWindowState((WindowState)e.NewValue);
- }
-
- #endregion //WindowState
-
- #endregion //Dependency Properties
-
- private bool? _dialogResult;
- ///
- /// Gets or sets a value indicating whether the ChildWindow was accepted or canceled.
- ///
- ///
- /// True if the child window was accepted; false if the child window was
- /// canceled. The default is null.
- ///
- [TypeConverter(typeof(NullableBoolConverter))]
- public bool? DialogResult
- {
- get { return _dialogResult; }
- set
- {
- if (_dialogResult != value)
- {
- _dialogResult = value;
- Close();
- }
- }
- }
-
- #endregion //Properties
-
- #region Event Handlers
-
- void HeaderLeftMouseButtonDown(object sender, MouseButtonEventArgs e)
- {
- e.Handled = true;
- Focus();
- _dragWidget.CaptureMouse();
- _isMouseCaptured = true;
- _clickPoint = e.GetPosition(null); //save off the mouse position
- _oldPosition = new Point(Left, Top); //save off our original window position
- }
-
- private void HeaderMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
- {
- e.Handled = true;
- _dragWidget.ReleaseMouseCapture();
- _isMouseCaptured = false;
- }
-
- private void HeaderMouseMove(MouseEventArgs e)
- {
- if (_isMouseCaptured && Visibility == Visibility.Visible)
- {
- Point currentPosition = e.GetPosition(null); //our current mouse position
-
- Left = _oldPosition.X + (currentPosition.X - _clickPoint.X);
- Top = _oldPosition.Y + (currentPosition.Y - _clickPoint.Y);
-
- //this helps keep our mouse position in sync with the drag widget position
- Point dragWidgetPosition = e.GetPosition(_dragWidget);
- if (dragWidgetPosition.X < 0 || dragWidgetPosition.X > _dragWidget.ActualWidth || dragWidgetPosition.Y < 0 || dragWidgetPosition.Y > _dragWidget.ActualHeight)
- {
- return;
- }
-
- _oldPosition = new Point(Left, Top);
- _clickPoint = e.GetPosition(Window.GetWindow(this)); //store the point where we are relative to the window
- }
- }
-
- #endregion //Event Handlers
-
- #region Methods
-
- #region Private
-
- private double GetRestrictedLeft()
- {
- if (_parent != null)
- {
- if (Left < 0)
- {
- return 0;
- }
-
- if (Left + WindowRoot.ActualWidth > _parent.ActualWidth)
- {
- return _parent.ActualWidth - WindowRoot.ActualWidth;
- }
- }
-
- return Left;
- }
-
- private double GetRestrictedTop()
- {
- if (_parent != null)
- {
- if (Top < 0)
- {
- return 0;
- }
-
- if (Top + WindowRoot.ActualHeight > _parent.ActualHeight)
- {
- return _parent.ActualHeight - WindowRoot.ActualHeight;
- }
- }
-
- return Top;
- }
-
- private void SetWindowState(WindowState state)
- {
- switch (state)
- {
- case WindowState.Closed:
- {
- ExecuteClose();
- break;
- }
- case WindowState.Open:
- {
- ExecuteOpen();
- break;
- }
- }
-
- ChangeVisualState();
- }
-
- private void ExecuteClose()
- {
- CancelEventArgs e = new CancelEventArgs();
- OnClosing(e);
-
- if (!e.Cancel)
- {
- if (!_dialogResult.HasValue)
- _dialogResult = false;
-
- OnClosed(EventArgs.Empty);
- }
- else
- {
- _dialogResult = null; //if the Close is cancelled, DialogResult should always be NULL:
- }
- }
-
- private void ExecuteOpen()
- {
- _dialogResult = null; //reset the dialogResult to null each time the window is opened
- SetZIndex();
- }
-
- private void SetZIndex()
- {
- if (_parent != null)
- {
- int parentIndex = (int)_parent.GetValue(Canvas.ZIndexProperty);
- this.SetValue(Canvas.ZIndexProperty, ++parentIndex);
- }
- else
- {
- this.SetValue(Canvas.ZIndexProperty, 1);
- }
- }
-
- private void SetStartupPosition()
- {
- CenterChildWindow();
- }
-
- private void CenterChildWindow()
- {
- _moveTransform.X = _moveTransform.Y = 0;
-
- if (_parent != null)
- {
- Left = (_parent.ActualWidth - WindowRoot.ActualWidth) / 2.0;
- Top = (_parent.ActualHeight - WindowRoot.ActualHeight) / 2.0;
- }
- }
-
- protected virtual void ChangeVisualState()
- {
- if (WindowState == WindowState.Closed)
- {
- VisualStateManager.GoToState(this, VisualStates.Closed, true);
- }
- else
- {
- VisualStateManager.GoToState(this, VisualStates.Open, true);
- }
- }
-
- #endregion //Private
-
- #region Protected
-
- protected void ProcessMove(double x, double y)
- {
- _moveTransform.X += x;
- _moveTransform.Y += y;
- }
-
- #endregion //Protected
-
- #region Public
-
- public void Show()
- {
- WindowState = WindowState.Open;
- }
-
- public void Close()
- {
- WindowState = WindowState.Closed;
- }
-
- #endregion //Public
-
- #endregion //Methods
-
- #region Events
-
- ///
- /// Occurs when the ChildWindow is closed.
- ///
- public event EventHandler Closed;
- protected virtual void OnClosed(EventArgs e)
- {
- if (Closed != null)
- Closed(this, e);
- }
-
- ///
- /// Occurs when the ChildWindow is closing.
- ///
- public event EventHandler Closing;
- protected virtual void OnClosing(CancelEventArgs e)
- {
- if (Closing != null)
- Closing(this, e);
- }
-
- #endregion //Events
- }
-}
diff --git a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/ChildWindow/VisualStates.ChildWindow.cs b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/ChildWindow/VisualStates.ChildWindow.cs
deleted file mode 100644
index eb3a4ea9..00000000
--- a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/ChildWindow/VisualStates.ChildWindow.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using System;
-
-namespace Microsoft.Windows.Controls
-{
- internal static partial class VisualStates
- {
- ///
- /// Window State group name.
- ///
- public const string WindowStatesGroup = "WindowStatesGroup";
-
- ///
- /// Open state name for ChildWindow.
- ///
- public const string Open = "Open";
-
- ///
- /// Closed state name for ChildWindow.
- ///
- public const string Closed = "Closed";
- }
-}
diff --git a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/ChildWindow/WindowState.cs b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/ChildWindow/WindowState.cs
deleted file mode 100644
index cc001a25..00000000
--- a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/ChildWindow/WindowState.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace Microsoft.Windows.Controls
-{
- public enum WindowState
- {
- Closed,
- Open
- }
-}
diff --git a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/ColorPicker/ColorPicker.cs b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/ColorPicker/ColorPicker.cs
deleted file mode 100644
index 0d767f6f..00000000
--- a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/ColorPicker/ColorPicker.cs
+++ /dev/null
@@ -1,395 +0,0 @@
-using System;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Controls.Primitives;
-
-namespace Microsoft.Windows.Controls
-{
- public class ColorPicker : Control
- {
- #region Private Members
-
- ToggleButton _colorPickerToggleButton;
- Popup _colorPickerCanvasPopup;
- Button _okButton;
- private TranslateTransform _colorShadeSelectorTransform = new TranslateTransform();
- private Canvas _colorShadingCanvas;
- private Canvas _colorShadeSelector;
- private ColorSpectrumSlider _spectrumSlider;
- private Point? _currentColorPosition;
- private Color _currentColor = Colors.White;
-
- #endregion //Private Members
-
- #region Constructors
-
- static ColorPicker()
- {
- DefaultStyleKeyProperty.OverrideMetadata(typeof(ColorPicker), new FrameworkPropertyMetadata(typeof(ColorPicker)));
- }
-
- public ColorPicker()
- {
-
- }
-
- #endregion //Constructors
-
- #region Properties
-
- public static readonly DependencyProperty CurrentColorProperty = DependencyProperty.Register("CurrentColor", typeof(Color), typeof(ColorPicker), new PropertyMetadata(Colors.White));
- public Color CurrentColor
- {
- get { return (Color)GetValue(CurrentColorProperty); }
- set { SetValue(CurrentColorProperty, value); }
- }
-
- #region SelectedColor
-
- public static readonly DependencyProperty SelectedColorProperty = DependencyProperty.Register("SelectedColor", typeof(Color), typeof(ColorPicker), new FrameworkPropertyMetadata(Colors.White, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, new PropertyChangedCallback(SelectedColorPropertyChanged)));
- public Color SelectedColor
- {
- get { return (Color)GetValue(SelectedColorProperty); }
- set { SetValue(SelectedColorProperty, value); }
- }
-
- private static void SelectedColorPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
- {
- ColorPicker colorPicker = (ColorPicker)d;
- colorPicker.SetSelectedColor((Color)e.NewValue);
- }
-
- #endregion //SelectedColor
-
- #region ScRGB
-
- #region ScA
-
- public static readonly DependencyProperty ScAProperty = DependencyProperty.Register("ScA", typeof(float), typeof(ColorPicker), new PropertyMetadata((float)1, new PropertyChangedCallback(OnScAPropertyChangedChanged)));
- public float ScA
- {
- get { return (float)GetValue(ScAProperty); }
- set { SetValue(ScAProperty, value); }
- }
-
- private static void OnScAPropertyChangedChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
- {
- ColorPicker c = (ColorPicker)d;
- c.SetScA((float)e.NewValue);
- }
-
- protected virtual void SetScA(float newValue)
- {
- _currentColor.ScA = newValue;
- A = _currentColor.A;
- CurrentColor = _currentColor;
- HexadecimalString = _currentColor.ToString();
- }
-
- #endregion //ScA
-
- #region ScR
-
- public static readonly DependencyProperty ScRProperty = DependencyProperty.Register("ScR", typeof(float), typeof(ColorPicker), new PropertyMetadata((float)1, new PropertyChangedCallback(OnScRPropertyChanged)));
- public float ScR
- {
- get { return (float)GetValue(ScRProperty); }
- set { SetValue(RProperty, value); }
- }
-
- private static void OnScRPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
- {
-
- }
-
- #endregion //ScR
-
- #region ScG
-
- public static readonly DependencyProperty ScGProperty = DependencyProperty.Register("ScG", typeof(float), typeof(ColorPicker), new PropertyMetadata((float)1, new PropertyChangedCallback(OnScGPropertyChanged)));
- public float ScG
- {
- get { return (float)GetValue(ScGProperty); }
- set { SetValue(GProperty, value); }
- }
-
- private static void OnScGPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
- {
-
- }
-
- #endregion //ScG
-
- #region ScB
-
- public static readonly DependencyProperty ScBProperty = DependencyProperty.Register("ScB", typeof(float), typeof(ColorPicker), new PropertyMetadata((float)1, new PropertyChangedCallback(OnScBPropertyChanged)));
- public float ScB
- {
- get { return (float)GetValue(BProperty); }
- set { SetValue(BProperty, value); }
- }
-
- private static void OnScBPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
- {
-
- }
-
- #endregion //ScB
-
- #endregion //ScRGB
-
- #region RGB
-
- #region A
-
- public static readonly DependencyProperty AProperty = DependencyProperty.Register("A", typeof(byte), typeof(ColorPicker), new PropertyMetadata((byte)255, new PropertyChangedCallback(OnAPropertyChanged)));
- public byte A
- {
- get { return (byte)GetValue(AProperty); }
- set { SetValue(AProperty, value); }
- }
-
- private static void OnAPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
- {
- ColorPicker c = (ColorPicker)d;
- c.SetA((byte)e.NewValue);
- }
-
- protected virtual void SetA(byte newValue)
- {
- _currentColor.A = newValue;
- SetValue(CurrentColorProperty, _currentColor);
- }
-
- #endregion //A
-
- #region R
-
- public static readonly DependencyProperty RProperty = DependencyProperty.Register("R", typeof(byte), typeof(ColorPicker), new PropertyMetadata((byte)255, new PropertyChangedCallback(OnRPropertyChanged)));
- public byte R
- {
- get { return (byte)GetValue(RProperty); }
- set { SetValue(RProperty, value); }
- }
-
- private static void OnRPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
- {
-
- }
-
- #endregion //R
-
- #region G
-
- public static readonly DependencyProperty GProperty = DependencyProperty.Register("G", typeof(byte), typeof(ColorPicker), new PropertyMetadata((byte)255, new PropertyChangedCallback(OnGPropertyChanged)));
- public byte G
- {
- get { return (byte)GetValue(GProperty); }
- set { SetValue(GProperty, value); }
- }
-
- private static void OnGPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
- {
-
- }
-
- #endregion //G
-
- #region B
-
- public static readonly DependencyProperty BProperty = DependencyProperty.Register("B", typeof(byte), typeof(ColorPicker), new PropertyMetadata((byte)255, new PropertyChangedCallback(OnBPropertyChanged)));
- public byte B
- {
- get { return (byte)GetValue(BProperty); }
- set { SetValue(BProperty, value); }
- }
-
- private static void OnBPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
- {
-
- }
-
- #endregion //B
-
- #endregion //RGB
-
- #region HexadecimalString
-
- public static readonly DependencyProperty HexadecimalStringProperty = DependencyProperty.Register("HexadecimalString", typeof(string), typeof(ColorPicker), new PropertyMetadata("#FFFFFFFF", new PropertyChangedCallback(OnHexadecimalStringPropertyChanged)));
- public string HexadecimalString
- {
- get { return (string)GetValue(HexadecimalStringProperty); }
- set { SetValue(HexadecimalStringProperty, value); }
- }
-
- private static void OnHexadecimalStringPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
- {
-
- }
-
- #endregion //HexadecimalString
-
- #endregion //Properties
-
- #region Base Class Overrides
-
- public override void OnApplyTemplate()
- {
- base.OnApplyTemplate();
-
- _colorPickerToggleButton = (ToggleButton)GetTemplateChild("PART_ColorPickerToggleButton");
- _colorPickerToggleButton.Click += ColorPickerToggleButton_Clicked;
-
- _colorPickerCanvasPopup = (Popup)GetTemplateChild("PART_ColorPickerCanvasPopup");
-
- _colorShadingCanvas = (Canvas)GetTemplateChild("PART_ColorShadingCanvas");
- _colorShadingCanvas.MouseLeftButtonDown += ColorShadingCanvas_MouseLeftButtonDown;
- _colorShadingCanvas.MouseMove += ColorShadingCanvas_MouseMove;
- _colorShadingCanvas.SizeChanged += ColorShadingCanvas_SizeChanged;
-
- _colorShadeSelector = (Canvas)GetTemplateChild("PART_ColorShadeSelector");
- _colorShadeSelector.RenderTransform = _colorShadeSelectorTransform;
-
- _spectrumSlider = (ColorSpectrumSlider)GetTemplateChild("PART_SpectrumSlider");
- _spectrumSlider.ValueChanged += SpectrumSlider_ValueChanged;
-
- _okButton = (Button)GetTemplateChild("PART_OkButton");
- _okButton.Click += OkButton_Click;
-
- SetSelectedColor(SelectedColor);
- }
-
- #endregion //Base Class Overrides
-
- #region Event Handlers
-
- void ColorShadingCanvas_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
- {
- Point p = e.GetPosition(_colorShadingCanvas);
- UpdateColorShadeSelectorPositionAndCalculateColor(p, true);
- }
-
- void ColorShadingCanvas_MouseMove(object sender, MouseEventArgs e)
- {
- if (e.LeftButton == MouseButtonState.Pressed)
- {
- Point p = e.GetPosition(_colorShadingCanvas);
- UpdateColorShadeSelectorPositionAndCalculateColor(p, true);
- Mouse.Synchronize();
- }
- }
-
- void ColorShadingCanvas_SizeChanged(object sender, SizeChangedEventArgs e)
- {
- if (_currentColorPosition != null)
- {
- Point _newPoint = new Point
- {
- X = ((Point)_currentColorPosition).X * e.NewSize.Width,
- Y = ((Point)_currentColorPosition).Y * e.NewSize.Height
- };
-
- UpdateColorShadeSelectorPositionAndCalculateColor(_newPoint, false);
- }
- }
-
- void SpectrumSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs e)
- {
- if (_currentColorPosition != null)
- {
- CalculateColor((Point)_currentColorPosition);
- }
- }
-
- void OkButton_Click(object sender, RoutedEventArgs e)
- {
- if (_colorPickerCanvasPopup.IsOpen || _colorPickerToggleButton.IsChecked == true)
- {
- CloseColorPicker();
- SelectedColor = CurrentColor;
- }
- }
-
- void ColorPickerToggleButton_Clicked(object sender, RoutedEventArgs e)
- {
- _colorPickerCanvasPopup.IsOpen = _colorPickerToggleButton.IsChecked ?? false;
- }
-
- #endregion //Event Handlers
-
- #region Methods
-
- private void CloseColorPicker()
- {
- _colorPickerToggleButton.IsChecked = false;
- _colorPickerCanvasPopup.IsOpen = false;
- }
-
- private void SetSelectedColor(Color theColor)
- {
- _currentColor = theColor;
- SetValue(AProperty, _currentColor.A);
- SetValue(RProperty, _currentColor.R);
- SetValue(GProperty, _currentColor.G);
- SetValue(BProperty, _currentColor.B);
- UpdateColorShadeSelectorPosition(theColor);
- }
-
- private void UpdateColorShadeSelectorPositionAndCalculateColor(Point p, bool calculateColor)
- {
- if (p.Y < 0)
- p.Y = 0;
-
- if (p.X < 0)
- p.X = 0;
-
- if (p.X > _colorShadingCanvas.ActualWidth)
- p.X = _colorShadingCanvas.ActualWidth;
-
- if (p.Y > _colorShadingCanvas.ActualHeight)
- p.Y = _colorShadingCanvas.ActualHeight;
-
- _colorShadeSelectorTransform.X = p.X - (_colorShadeSelector.Width / 2);
- _colorShadeSelectorTransform.Y = p.Y - (_colorShadeSelector.Height / 2);
-
- p.X = p.X / _colorShadingCanvas.ActualWidth;
- p.Y = p.Y / _colorShadingCanvas.ActualHeight;
-
- _currentColorPosition = p;
-
- if (calculateColor)
- CalculateColor(p);
- }
-
- private void UpdateColorShadeSelectorPosition(Color color)
- {
- if (_spectrumSlider == null || _colorShadingCanvas == null)
- return;
-
- _currentColorPosition = null;
-
- HsvColor hsv = ColorUtilities.ConvertRgbToHsv(color.R, color.G, color.B);
- _spectrumSlider.Value = hsv.H;
-
- Point p = new Point(hsv.S, 1 - hsv.V);
-
- _currentColorPosition = p;
-
- _colorShadeSelectorTransform.X = (p.X * _colorShadingCanvas.Width) - 5;
- _colorShadeSelectorTransform.Y = (p.Y * _colorShadingCanvas.Height) - 5;
- }
-
- private void CalculateColor(Point p)
- {
- HsvColor hsv = new HsvColor(360 - _spectrumSlider.Value, 1, 1) { S = p.X, V = 1 - p.Y };
- _currentColor = ColorUtilities.ConvertHsvToRgb(hsv.H, hsv.S, hsv.V); ;
- _currentColor.ScA = ScA;
- CurrentColor = _currentColor;
- HexadecimalString = _currentColor.ToString();
- }
-
- #endregion //Methods
- }
-}
diff --git a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/ColorPicker/ColorSpectrumSlider.cs b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/ColorPicker/ColorSpectrumSlider.cs
deleted file mode 100644
index c4eac2d8..00000000
--- a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/ColorPicker/ColorSpectrumSlider.cs
+++ /dev/null
@@ -1,85 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Media;
-using System.Windows.Shapes;
-
-namespace Microsoft.Windows.Controls
-{
- internal class ColorSpectrumSlider : Slider
- {
- #region Private Members
-
- private Rectangle _spectrumDisplay;
- private LinearGradientBrush _pickerBrush;
-
- #endregion //Private Members
-
- #region Constructors
-
- static ColorSpectrumSlider()
- {
- DefaultStyleKeyProperty.OverrideMetadata(typeof(ColorSpectrumSlider), new FrameworkPropertyMetadata(typeof(ColorSpectrumSlider)));
- }
-
- #endregion //Constructors
-
- #region Dependency Properties
-
- public static readonly DependencyProperty SelectedColorProperty = DependencyProperty.Register("SelectedColor", typeof(Color), typeof(ColorSpectrumSlider), new PropertyMetadata(System.Windows.Media.Colors.Transparent));
- public Color SelectedColor
- {
- get { return (Color)GetValue(SelectedColorProperty); }
- set { SetValue(SelectedColorProperty, value); }
- }
-
- #endregion //Dependency Properties
-
- #region Base Class Overrides
-
- public override void OnApplyTemplate()
- {
- base.OnApplyTemplate();
-
- _spectrumDisplay = (Rectangle)GetTemplateChild("PART_SpectrumDisplay");
- CreateSpectrum();
- OnValueChanged(Double.NaN, Value);
- }
-
- protected override void OnValueChanged(double oldValue, double newValue)
- {
- base.OnValueChanged(oldValue, newValue);
-
- Color color = ColorUtilities.ConvertHsvToRgb(360 - newValue, 1, 1);
- SelectedColor = color;
- }
-
- #endregion //Base Class Overrides
-
- #region Methods
-
- private void CreateSpectrum()
- {
- _pickerBrush = new LinearGradientBrush();
- _pickerBrush.StartPoint = new Point(0.5, 0);
- _pickerBrush.EndPoint = new Point(0.5, 1);
- _pickerBrush.ColorInterpolationMode = ColorInterpolationMode.SRgbLinearInterpolation;
-
- List colorsList = ColorUtilities.GenerateHsvSpectrum();
-
- double stopIncrement = (double)1 / colorsList.Count;
-
- int i;
- for (i = 0; i < colorsList.Count; i++)
- {
- _pickerBrush.GradientStops.Add(new GradientStop(colorsList[i], i * stopIncrement));
- }
-
- _pickerBrush.GradientStops[i - 1].Offset = 1.0;
- _spectrumDisplay.Fill = _pickerBrush;
- }
-
- #endregion //Methods
- }
-}
diff --git a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/ColorPicker/ColorUtilities.cs b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/ColorPicker/ColorUtilities.cs
deleted file mode 100644
index e621c22b..00000000
--- a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/ColorPicker/ColorUtilities.cs
+++ /dev/null
@@ -1,156 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Windows.Media;
-
-namespace Microsoft.Windows.Controls
-{
- internal static class ColorUtilities
- {
- ///
- /// Converts an RGB color to an HSV color.
- ///
- ///
- ///
- ///
- ///
- public static HsvColor ConvertRgbToHsv(int r, int b, int g)
- {
- double delta, min;
- double h = 0, s, v;
-
- min = Math.Min(Math.Min(r, g), b);
- v = Math.Max(Math.Max(r, g), b);
- delta = v - min;
-
- if (v == 0.0)
- {
- s = 0;
- }
- else
- s = delta / v;
-
- if (s == 0)
- h = 0.0;
-
- else
- {
- if (r == v)
- h = (g - b) / delta;
- else if (g == v)
- h = 2 + (b - r) / delta;
- else if (b == v)
- h = 4 + (r - g) / delta;
-
- h *= 60;
- if (h < 0.0)
- h = h + 360;
-
- }
-
- return new HsvColor { H = h, S = s, V = v / 255 };
- }
-
- ///
- /// Converts an HSV color to an RGB color.
- ///
- ///
- ///
- ///
- ///
- public static Color ConvertHsvToRgb(double h, double s, double v)
- {
- double r = 0, g = 0, b = 0;
-
- if (s == 0)
- {
- r = v;
- g = v;
- b = v;
- }
- else
- {
- int i;
- double f, p, q, t;
-
- if (h == 360)
- h = 0;
- else
- h = h / 60;
-
- i = (int)Math.Truncate(h);
- f = h - i;
-
- p = v * (1.0 - s);
- q = v * (1.0 - (s * f));
- t = v * (1.0 - (s * (1.0 - f)));
-
- switch (i)
- {
- case 0:
- {
- r = v;
- g = t;
- b = p;
- break;
- }
- case 1:
- {
- r = q;
- g = v;
- b = p;
- break;
- }
- case 2:
- {
- r = p;
- g = v;
- b = t;
- break;
- }
- case 3:
- {
- r = p;
- g = q;
- b = v;
- break;
- }
- case 4:
- {
- r = t;
- g = p;
- b = v;
- break;
- }
- default:
- {
- r = v;
- g = p;
- b = q;
- break;
- }
- }
-
- }
-
- return Color.FromArgb(255, (byte)(r * 255), (byte)(g * 255), (byte)(b * 255));
- }
-
- ///
- /// Generates a list of colors with hues ranging from 0 360 and a saturation and value of 1.
- ///
- ///
- public static List GenerateHsvSpectrum()
- {
- List colorsList = new List(8);
-
- for (int i = 0; i < 29; i++)
- {
- colorsList.Add(ColorUtilities.ConvertHsvToRgb(i * 12, 1, 1));
- }
-
- colorsList.Add(ColorUtilities.ConvertHsvToRgb(0, 1, 1));
-
- return colorsList;
- }
- }
-}
diff --git a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/ColorPicker/HsvColor.cs b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/ColorPicker/HsvColor.cs
deleted file mode 100644
index eed5c3bd..00000000
--- a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/ColorPicker/HsvColor.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-using System;
-
-namespace Microsoft.Windows.Controls
-{
- internal struct HsvColor
- {
- public double H;
- public double S;
- public double V;
-
- public HsvColor(double h, double s, double v)
- {
- H = h;
- S = s;
- V = v;
- }
- }
-}
diff --git a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/Core/UIElementAdorner.cs b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/Core/UIElementAdorner.cs
deleted file mode 100644
index 263ca034..00000000
--- a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/Core/UIElementAdorner.cs
+++ /dev/null
@@ -1,215 +0,0 @@
-using System;
-using System.Collections;
-using System.Windows.Media;
-using System.Windows.Documents;
-using System.Windows;
-
-namespace Microsoft.Windows.Controls.Core
-{
- ///
- /// An adorner that can display one and only one UIElement.
- /// That element can be a panel, which contains multiple other elements.
- /// The element is added to the adorner's visual and logical trees, enabling it to
- /// particpate in dependency property value inheritance, amongst other things.
- ///
- internal class UIElementAdorner
- : Adorner
- where TElement : UIElement
- {
- #region Fields
-
- TElement _child = null;
- double _offsetLeft = 0;
- double _offsetTop = 0;
-
- #endregion // Fields
-
- #region Constructor
-
- ///
- /// Constructor.
- ///
- /// The element to which the adorner will be bound.
- public UIElementAdorner(UIElement adornedElement)
- : base(adornedElement)
- {
- }
-
- #endregion // Constructor
-
- #region Public Interface
-
- #region Child
-
- ///
- /// Gets/sets the child element hosted in the adorner.
- ///
- public TElement Child
- {
- get { return _child; }
- set
- {
- if (value == _child)
- return;
-
- if (_child != null)
- {
- base.RemoveLogicalChild(_child);
- base.RemoveVisualChild(_child);
- }
-
- _child = value;
-
- if (_child != null)
- {
- base.AddLogicalChild(_child);
- base.AddVisualChild(_child);
- }
- }
- }
-
- #endregion // Child
-
- #region GetDesiredTransform
-
- ///
- /// Override.
- ///
- ///
- ///
- public override GeneralTransform GetDesiredTransform(GeneralTransform transform)
- {
- GeneralTransformGroup result = new GeneralTransformGroup();
- result.Children.Add(base.GetDesiredTransform(transform));
- result.Children.Add(new TranslateTransform(_offsetLeft, _offsetTop));
- return result;
- }
-
- #endregion // GetDesiredTransform
-
- #region OffsetLeft
-
- ///
- /// Gets/sets the horizontal offset of the adorner.
- ///
- public double OffsetLeft
- {
- get { return _offsetLeft; }
- set
- {
- _offsetLeft = value;
- UpdateLocation();
- }
- }
-
- #endregion // OffsetLeft
-
- #region SetOffsets
-
- ///
- /// Updates the location of the adorner in one atomic operation.
- ///
- public void SetOffsets(double left, double top)
- {
- _offsetLeft = left;
- _offsetTop = top;
- this.UpdateLocation();
- }
-
- #endregion // SetOffsets
-
- #region OffsetTop
-
- ///
- /// Gets/sets the vertical offset of the adorner.
- ///
- public double OffsetTop
- {
- get { return _offsetTop; }
- set
- {
- _offsetTop = value;
- UpdateLocation();
- }
- }
-
- #endregion // OffsetTop
-
- #endregion // Public Interface
-
- #region Protected Overrides
-
- ///
- /// Override.
- ///
- ///
- ///
- protected override Size MeasureOverride(Size constraint)
- {
- if (_child == null)
- return base.MeasureOverride(constraint);
-
- _child.Measure(constraint);
- return _child.DesiredSize;
- }
-
- ///
- /// Override.
- ///
- ///
- ///
- protected override Size ArrangeOverride(Size finalSize)
- {
- if (_child == null)
- return base.ArrangeOverride(finalSize);
-
- _child.Arrange(new Rect(finalSize));
- return finalSize;
- }
-
- ///
- /// Override.
- ///
- protected override IEnumerator LogicalChildren
- {
- get
- {
- ArrayList list = new ArrayList();
- if (_child != null)
- list.Add(_child);
- return list.GetEnumerator();
- }
- }
-
- ///
- /// Override.
- ///
- ///
- ///
- protected override Visual GetVisualChild(int index)
- {
- return _child;
- }
-
- ///
- /// Override.
- ///
- protected override int VisualChildrenCount
- {
- get { return _child == null ? 0 : 1; }
- }
-
- #endregion // Protected Overrides
-
- #region Private Helpers
-
- void UpdateLocation()
- {
- AdornerLayer adornerLayer = base.Parent as AdornerLayer;
- if (adornerLayer != null)
- adornerLayer.Update(base.AdornedElement);
- }
-
- #endregion // Private Helpers
- }
-}
diff --git a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/MessageBox/MessageBox.cs b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/MessageBox/MessageBox.cs
deleted file mode 100644
index 317dd405..00000000
--- a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/MessageBox/MessageBox.cs
+++ /dev/null
@@ -1,419 +0,0 @@
-using System;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Media;
-using System.Windows.Controls.Primitives;
-
-namespace Microsoft.Windows.Controls
-{
- [TemplateVisualState(Name = VisualStates.OK, GroupName = VisualStates.MessageBoxButtonsGroup)]
- [TemplateVisualState(Name = VisualStates.OKCancel, GroupName = VisualStates.MessageBoxButtonsGroup)]
- [TemplateVisualState(Name = VisualStates.YesNo, GroupName = VisualStates.MessageBoxButtonsGroup)]
- [TemplateVisualState(Name = VisualStates.YesNoCancel, GroupName = VisualStates.MessageBoxButtonsGroup)]
- public class MessageBox : Control
- {
- #region Private Members
-
- ///
- /// Tracks the MessageBoxButon value passed into the InitializeContainer method
- ///
- private MessageBoxButton _button = MessageBoxButton.OK;
-
- #endregion //Private Members
-
- #region Constructors
-
- static MessageBox()
- {
- DefaultStyleKeyProperty.OverrideMetadata(typeof(MessageBox), new FrameworkPropertyMetadata(typeof(MessageBox)));
- }
-
- internal MessageBox()
- { /*user cannot create instance */ }
-
- #endregion //Constructors
-
- #region Properties
-
- #region Protected Properties
-
- ///
- /// A System.Windows.MessageBoxResult value that specifies which message box button was clicked by the user.
- ///
- protected MessageBoxResult MessageBoxResult = MessageBoxResult.None;
-
- protected Window Container { get; private set; }
- protected Thumb DragWidget { get; private set; }
- protected Button CloseButton { get; private set; }
-
- protected Button OkButton { get; private set; }
- protected Button CancelButton { get; private set; }
- protected Button YesButton { get; private set; }
- protected Button NoButton { get; private set; }
-
- protected Button OkButton1 { get; private set; }
- protected Button CancelButton1 { get; private set; }
- protected Button YesButton1 { get; private set; }
- protected Button NoButton1 { get; private set; }
-
- #endregion //Protected Properties
-
- #region Dependency Properties
-
- public static readonly DependencyProperty CaptionProperty = DependencyProperty.Register("Caption", typeof(string), typeof(MessageBox), new UIPropertyMetadata(String.Empty));
- public string Caption
- {
- get { return (string)GetValue(CaptionProperty); }
- set { SetValue(CaptionProperty, value); }
- }
-
- public static readonly DependencyProperty CaptionForegroundProperty = DependencyProperty.Register("CaptionForeground", typeof(Brush), typeof(MessageBox), new UIPropertyMetadata(null));
- public Brush CaptionForeground
- {
- get { return (Brush)GetValue(CaptionForegroundProperty); }
- set { SetValue(CaptionForegroundProperty, value); }
- }
-
- public static readonly DependencyProperty CloseButtonStyleProperty = DependencyProperty.Register("CloseButtonStyle", typeof(Style), typeof(MessageBox), new PropertyMetadata(null));
- public Style CloseButtonStyle
- {
- get { return (Style)GetValue(CloseButtonStyleProperty); }
- set { SetValue(CloseButtonStyleProperty, value); }
- }
-
- public static readonly DependencyProperty ImageSourceProperty = DependencyProperty.Register("ImageSource", typeof(ImageSource), typeof(MessageBox), new UIPropertyMetadata(default(ImageSource)));
- public ImageSource ImageSource
- {
- get { return (ImageSource)GetValue(ImageSourceProperty); }
- set { SetValue(ImageSourceProperty, value); }
- }
-
- public static readonly DependencyProperty TextProperty = DependencyProperty.Register("Text", typeof(string), typeof(MessageBox), new UIPropertyMetadata(String.Empty));
- public string Text
- {
- get { return (string)GetValue(TextProperty); }
- set { SetValue(TextProperty, value); }
- }
-
- public static readonly DependencyProperty WindowBackgroundProperty = DependencyProperty.Register("WindowBackground", typeof(Brush), typeof(MessageBox), new PropertyMetadata(null));
- public Brush WindowBackground
- {
- get { return (Brush)GetValue(WindowBackgroundProperty); }
- set { SetValue(WindowBackgroundProperty, value); }
- }
-
- public static readonly DependencyProperty WindowBorderBrushProperty = DependencyProperty.Register("WindowBorderBrush", typeof(Brush), typeof(MessageBox), new PropertyMetadata(null));
- public Brush WindowBorderBrush
- {
- get { return (Brush)GetValue(WindowBorderBrushProperty); }
- set { SetValue(WindowBorderBrushProperty, value); }
- }
-
- public static readonly DependencyProperty WindowOpacityProperty = DependencyProperty.Register("WindowOpacity", typeof(double), typeof(MessageBox), new PropertyMetadata(null));
- public double WindowOpacity
- {
- get { return (double)GetValue(WindowOpacityProperty); }
- set { SetValue(WindowOpacityProperty, value); }
- }
-
- #endregion //Dependency Properties
-
- #endregion //Properties
-
- #region Base Class Overrides
-
- ///
- /// Overrides the OnApplyTemplate method.
- ///
- public override void OnApplyTemplate()
- {
- base.OnApplyTemplate();
-
- DragWidget = (Thumb)GetTemplateChild("PART_DragWidget");
- if (DragWidget != null)
- DragWidget.DragDelta += (o, e) => ProcessMove(e);
-
- CloseButton = (Button)GetTemplateChild("PART_CloseButton");
- if (CloseButton != null)
- CloseButton.Click += (o, e) => Close();
-
- NoButton = (Button)GetTemplateChild("PART_NoButton");
- if (NoButton != null)
- NoButton.Click += (o, e) => Button_Click(o, e);
-
- NoButton1 = (Button)GetTemplateChild("PART_NoButton1");
- if (NoButton1 != null)
- NoButton1.Click += (o, e) => Button_Click(o, e);
-
- YesButton = (Button)GetTemplateChild("PART_YesButton");
- if (YesButton != null)
- YesButton.Click += (o, e) => Button_Click(o, e);
-
- YesButton1 = (Button)GetTemplateChild("PART_YesButton1");
- if (YesButton1 != null)
- YesButton1.Click += (o, e) => Button_Click(o, e);
-
- CancelButton = (Button)GetTemplateChild("PART_CancelButton");
- if (CancelButton != null)
- CancelButton.Click += (o, e) => Button_Click(o, e);
-
- CancelButton1 = (Button)GetTemplateChild("PART_CancelButton1");
- if (CancelButton1 != null)
- CancelButton1.Click += (o, e) => Button_Click(o, e);
-
- OkButton = (Button)GetTemplateChild("PART_OkButton");
- if (OkButton != null)
- OkButton.Click += (o, e) => Button_Click(o, e);
-
- OkButton1 = (Button)GetTemplateChild("PART_OkButton1");
- if (OkButton1 != null)
- OkButton1.Click += (o, e) => Button_Click(o, e);
-
- ChangeVisualState(_button.ToString(), true);
- }
-
- #endregion //Base Class Overrides
-
- #region Methods
-
- #region Public Static
-
- ///
- /// Displays a message box that has a message and that returns a result.
- ///
- /// A System.String that specifies the text to display.
- /// A System.Windows.MessageBoxResult value that specifies which message box button is clicked by the user.
- public static MessageBoxResult Show(string messageText)
- {
- return Show(messageText, string.Empty, MessageBoxButton.OK);
- }
-
- ///
- /// Displays a message box that has a message and title bar caption; and that returns a result.
- ///
- /// A System.String that specifies the text to display.
- /// A System.String that specifies the title bar caption to display.
- /// A System.Windows.MessageBoxResult value that specifies which message box button is clicked by the user.
- public static MessageBoxResult Show(string messageText, string caption)
- {
- return Show(messageText, caption, MessageBoxButton.OK);
- }
-
- ///
- /// Displays a message box that has a message and that returns a result.
- ///
- /// A System.String that specifies the text to display.
- /// A System.String that specifies the title bar caption to display.
- /// A System.Windows.MessageBoxButton value that specifies which button or buttons to display.
- /// A System.Windows.MessageBoxResult value that specifies which message box button is clicked by the user.
- public static MessageBoxResult Show(string messageText, string caption, MessageBoxButton button)
- {
- return ShowCore(messageText, caption, button, MessageBoxImage.None);
- }
-
- ///
- /// Displays a message box that has a message and that returns a result.
- ///
- /// A System.String that specifies the text to display.
- /// A System.String that specifies the title bar caption to display.
- /// A System.Windows.MessageBoxButton value that specifies which button or buttons to display.
- /// A System.Windows.MessageBoxImage value that specifies the icon to display.
- /// A System.Windows.MessageBoxResult value that specifies which message box button is clicked by the user.
- public static MessageBoxResult Show(string messageText, string caption, MessageBoxButton button, MessageBoxImage icon)
- {
- return ShowCore(messageText, caption, button, icon);
- }
-
- #endregion //Public Static
-
- #region Private Static
-
- private static MessageBoxResult ShowCore(string messageText, string caption, MessageBoxButton button, MessageBoxImage icon)
- {
- MessageBox msgBox = new MessageBox();
- msgBox.InitializeMessageBox(messageText, caption, button, icon);
- msgBox.Show();
- return msgBox.MessageBoxResult;
- }
-
- ///
- /// Resolves the owner Window of the MessageBox.
- ///
- ///
- private static FrameworkElement ResolveOwner()
- {
- FrameworkElement owner = null;
- if (Application.Current != null)
- {
- foreach (Window w in Application.Current.Windows)
- {
- if (w.IsActive)
- {
- owner = w;
- break;
- }
- }
- }
- return owner;
- }
-
- #endregion //Private Static
-
- #region Protected
-
- ///
- /// Shows the MessageBox
- ///
- protected void Show()
- {
- Container.ShowDialog();
- }
-
- ///
- /// Initializes the MessageBox.
- ///
- /// The text.
- /// The caption.
- /// The button.
- /// The image.
- protected void InitializeMessageBox(string text, string caption, MessageBoxButton button, MessageBoxImage image)
- {
- Text = text;
- Caption = caption;
- _button = button;
- SetImageSource(image);
- Container = CreateContainer();
- }
-
- ///
- /// Changes the control's visual state(s).
- ///
- /// name of the state
- /// True if state transitions should be used.
- protected void ChangeVisualState(string name, bool useTransitions)
- {
- VisualStateManager.GoToState(this, name, useTransitions);
- }
-
- #endregion //Protected
-
- #region Private
-
- ///
- /// Sets the message image source.
- ///
- /// The image to show.
- private void SetImageSource(MessageBoxImage image)
- {
- String iconName = String.Empty;
-
- switch (image)
- {
- case MessageBoxImage.Error:
- {
- iconName = "Error48.png";
- break;
- }
- case MessageBoxImage.Information:
- {
- iconName = "Information48.png";
- break;
- }
- case MessageBoxImage.Question:
- {
- iconName = "Question48.png";
- break;
- }
- case MessageBoxImage.Warning:
- {
- iconName = "Warning48.png";
- break;
- }
- case MessageBoxImage.None:
- default:
- {
- return;
- }
- }
-
- ImageSource = (ImageSource)new ImageSourceConverter().ConvertFromString(String.Format("pack://application:,,,/WPFToolkit.Extended;component/MessageBox/Icons/{0}", iconName));
- }
-
- ///
- /// Creates the container which will host the MessageBox control.
- ///
- ///
- private Window CreateContainer()
- {
- return new Window()
- {
- AllowsTransparency = true,
- Background = Brushes.Transparent,
- Content = this,
- Owner = Window.GetWindow(ResolveOwner()),
- ShowInTaskbar = false,
- SizeToContent = System.Windows.SizeToContent.WidthAndHeight,
- ResizeMode = System.Windows.ResizeMode.NoResize,
- WindowStartupLocation = System.Windows.WindowStartupLocation.CenterOwner,
- WindowStyle = System.Windows.WindowStyle.None
- };
- }
-
- #endregion //Private
-
- #endregion //Methods
-
- #region Event Handlers
-
- ///
- /// Processes the move of a drag operation on the header.
- ///
- /// The instance containing the event data.
- private void ProcessMove(DragDeltaEventArgs e)
- {
- Container.Left = Container.Left + e.HorizontalChange;
- Container.Top = Container.Top + e.VerticalChange;
- }
-
- ///
- /// Sets the MessageBoxResult according to the button pressed and then closes the MessageBox.
- ///
- /// The source of the event.
- /// The instance containing the event data.
- private void Button_Click(object sender, RoutedEventArgs e)
- {
- Button button = e.Source as Button;
- switch (button.Name)
- {
- case "PART_NoButton":
- case "PART_NoButton1":
- MessageBoxResult = MessageBoxResult.No;
- break;
- case "PART_YesButton":
- case "PART_YesButton1":
- MessageBoxResult = MessageBoxResult.Yes;
- break;
- case "PART_CancelButton":
- case "PART_CancelButton1":
- MessageBoxResult = MessageBoxResult.Cancel;
- break;
- case "PART_OkButton":
- case "PART_OkButton1":
- MessageBoxResult = MessageBoxResult.OK;
- break;
- }
-
- Close();
- }
-
- ///
- /// Closes the MessageBox.
- ///
- private void Close()
- {
- Container.Close();
- }
-
- #endregion //Event Handlers
- }
-}
diff --git a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/MessageBox/VisualStates.MessageBox.cs b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/MessageBox/VisualStates.MessageBox.cs
deleted file mode 100644
index d47fcb08..00000000
--- a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/MessageBox/VisualStates.MessageBox.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-using System;
-
-namespace Microsoft.Windows.Controls
-{
- internal static partial class VisualStates
- {
- public const string MessageBoxButtonsGroup = "MessageBoxButtonsGroup";
-
- public const string OK = "OK";
-
- public const string OKCancel = "OKCancel";
-
- public const string YesNo = "YesNo";
-
- public const string YesNoCancel = "YesNoCancel";
- }
-}
diff --git a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/NumericUpDown/NumericUpDown.cs b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/NumericUpDown/NumericUpDown.cs
deleted file mode 100644
index b2b9dd9f..00000000
--- a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/NumericUpDown/NumericUpDown.cs
+++ /dev/null
@@ -1,187 +0,0 @@
-using System;
-using System.Windows;
-using System.Globalization;
-
-namespace Microsoft.Windows.Controls
-{
-
- public class NumericUpDown : UpDownBase
- {
- #region Properties
-
- #region Minimum
-
- public static readonly DependencyProperty MinimumProperty = DependencyProperty.Register("Minimum", typeof(double), typeof(NumericUpDown), new PropertyMetadata(Double.MinValue, OnMinimumPropertyChanged));
- public double Minimum
- {
- get { return (double)GetValue(MinimumProperty); }
- set { SetValue(MinimumProperty, value); }
- }
-
- private static void OnMinimumPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
- {
- }
-
- protected virtual void OnMinimumChanged(double oldValue, double newValue)
- {
- }
- #endregion Minimum
-
- #region Maximum
-
- public static readonly DependencyProperty MaximumProperty = DependencyProperty.Register("Maximum", typeof(double), typeof(NumericUpDown), new PropertyMetadata(Double.MaxValue, OnMaximumPropertyChanged));
- public double Maximum
- {
- get { return (double)GetValue(MaximumProperty); }
- set { SetValue(MaximumProperty, value); }
- }
-
- private static void OnMaximumPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
- {
- }
-
- protected virtual void OnMaximumChanged(double oldValue, double newValue)
- {
- }
- #endregion Maximum
-
- #region Increment
-
- public static readonly DependencyProperty IncrementProperty = DependencyProperty.Register("Increment", typeof(double), typeof(NumericUpDown), new PropertyMetadata(1d, OnIncrementPropertyChanged));
- public double Increment
- {
- get { return (double)GetValue(IncrementProperty); }
- set { SetValue(IncrementProperty, value); }
- }
-
- private static void OnIncrementPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
- {
- }
-
- protected virtual void OnIncrementChanged(double oldValue, double newValue)
- {
- }
-
- #endregion
-
- #region FormatString
-
- public static readonly DependencyProperty StringFormatProperty = DependencyProperty.Register("FormatString", typeof(string), typeof(NumericUpDown), new PropertyMetadata("F0", OnStringFormatPropertyPropertyChanged));
- public string FormatString
- {
- get { return (string)GetValue(StringFormatProperty); }
- set { SetValue(StringFormatProperty, value); }
- }
-
- private static void OnStringFormatPropertyPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
- {
- NumericUpDown nud = d as NumericUpDown;
- nud.OnStringFormatChanged(e.OldValue.ToString(), e.NewValue.ToString());
- }
-
- protected virtual void OnStringFormatChanged(string oldValue, string newValue)
- {
- Text = FormatValue();
- }
-
- #endregion //FormatString
-
- #endregion
-
- #region Constructors
-
- public NumericUpDown()
- : base()
- {
- DefaultStyleKeyProperty.OverrideMetadata(typeof(NumericUpDown), new FrameworkPropertyMetadata(typeof(NumericUpDown)));
- }
-
- #endregion //Constructors
-
- #region Base Class Overrides
-
- public override void OnApplyTemplate()
- {
- base.OnApplyTemplate();
- SetValidSpinDirection();
- }
-
- protected override void OnValueChanged(RoutedPropertyChangedEventArgs e)
- {
- SetValidSpinDirection();
- }
-
- protected override double ParseValue(string text)
- {
- NumberFormatInfo info = NumberFormatInfo.GetInstance(CultureInfo.CurrentCulture);
- if (text.Contains(info.PercentSymbol))
- return TryParcePercent(text, info);
- else
- return TryParceDouble(text, info);
- }
-
- protected internal override string FormatValue()
- {
- return Value.ToString(FormatString, CultureInfo.CurrentCulture);
- }
-
- protected override void OnIncrement()
- {
- Value = (double)((decimal)Value + (decimal)Increment);
- }
-
- protected override void OnDecrement()
- {
- Value = (double)((decimal)Value - (decimal)Increment);
- }
-
- #endregion //Base Class Overrides
-
- #region Methods
-
- ///
- /// Sets the valid spin direction based on current value, minimum and maximum.
- ///
- private void SetValidSpinDirection()
- {
- ValidSpinDirections validDirections = ValidSpinDirections.None;
-
- if (Value < Maximum)
- {
- validDirections = validDirections | ValidSpinDirections.Increase;
- }
-
- if (Value > Minimum)
- {
- validDirections = validDirections | ValidSpinDirections.Decrease;
- }
-
- if (Spinner != null)
- {
- Spinner.ValidSpinDirection = validDirections;
- }
- }
-
- private double TryParcePercent(string text, NumberFormatInfo info)
- {
- double result;
- text = text.Replace(info.PercentSymbol, null);
- result = TryParceDouble(text, info);
- return result / 100;
- }
-
- private double TryParceDouble(string text, NumberFormatInfo info)
- {
- double result;
- if (!double.TryParse(text, NumberStyles.Any, info, out result))
- {
- //an error occured now lets reset our value, text, and the text in the textbox
- result = Value;
- TextBox.Text = Text = FormatValue();
- }
- return result;
- }
-
- #endregion //Methods
- }
-}
diff --git a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/RichTextBox/Formatters/ITextFormatter.cs b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/RichTextBox/Formatters/ITextFormatter.cs
deleted file mode 100644
index f8e22d41..00000000
--- a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/RichTextBox/Formatters/ITextFormatter.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-using System;
-using System.Windows.Documents;
-
-namespace Microsoft.Windows.Controls
-{
- public interface ITextFormatter
- {
- string GetText(FlowDocument document);
- void SetText(FlowDocument document, string text);
- }
-}
diff --git a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/RichTextBox/Formatters/PlainTextFormatter.cs b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/RichTextBox/Formatters/PlainTextFormatter.cs
deleted file mode 100644
index 1c792a32..00000000
--- a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/RichTextBox/Formatters/PlainTextFormatter.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using System;
-using System.Windows.Documents;
-
-namespace Microsoft.Windows.Controls
-{
- ///
- /// Formats the RichTextBox text as plain text
- ///
- public class PlainTextFormatter : ITextFormatter
- {
- public string GetText(FlowDocument document)
- {
- return new TextRange(document.ContentStart, document.ContentEnd).Text;
- }
-
- public void SetText(FlowDocument document, string text)
- {
- new TextRange(document.ContentStart, document.ContentEnd).Text = text;
- }
- }
-}
diff --git a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/RichTextBox/Formatters/RtfFormatter.cs b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/RichTextBox/Formatters/RtfFormatter.cs
deleted file mode 100644
index e5a1def6..00000000
--- a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/RichTextBox/Formatters/RtfFormatter.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-using System;
-using System.Text;
-using System.Windows.Documents;
-using System.IO;
-using System.Windows;
-
-namespace Microsoft.Windows.Controls
-{
- ///
- /// Formats the RichTextBox text as RTF
- ///
- public class RtfFormatter : ITextFormatter
- {
- public string GetText(FlowDocument document)
- {
- TextRange tr = new TextRange(document.ContentStart, document.ContentEnd);
- using (MemoryStream ms = new MemoryStream())
- {
- tr.Save(ms, DataFormats.Rtf);
- return ASCIIEncoding.Default.GetString(ms.ToArray());
- }
- }
-
- public void SetText(FlowDocument document, string text)
- {
- TextRange tr = new TextRange(document.ContentStart, document.ContentEnd);
- using (MemoryStream ms = new MemoryStream(Encoding.ASCII.GetBytes(text)))
- {
- tr.Load(ms, DataFormats.Rtf);
- }
- }
- }
-}
diff --git a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/RichTextBox/Formatters/XamlFormatter.cs b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/RichTextBox/Formatters/XamlFormatter.cs
deleted file mode 100644
index 07e1d31a..00000000
--- a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/RichTextBox/Formatters/XamlFormatter.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-using System;
-using System.Text;
-using System.IO;
-using System.Windows.Documents;
-using System.Windows;
-
-namespace Microsoft.Windows.Controls
-{
- ///
- /// Formats the RichTextBox text as Xaml
- ///
- public class XamlFormatter : ITextFormatter
- {
- public string GetText(System.Windows.Documents.FlowDocument document)
- {
- TextRange tr = new TextRange(document.ContentStart, document.ContentEnd);
- using (MemoryStream ms = new MemoryStream())
- {
- tr.Save(ms, DataFormats.Xaml);
- return ASCIIEncoding.Default.GetString(ms.ToArray());
- }
- }
-
- public void SetText(System.Windows.Documents.FlowDocument document, string text)
- {
- try
- {
- TextRange tr = new TextRange(document.ContentStart, document.ContentEnd);
- using (MemoryStream ms = new MemoryStream(Encoding.ASCII.GetBytes(text)))
- {
- tr.Load(ms, DataFormats.Xaml);
- }
- }
- catch
- {
- throw new InvalidDataException("data provided is not in the correct Xaml format.");
- }
- }
- }
-}
diff --git a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/RichTextBox/RichTextBox.cs b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/RichTextBox/RichTextBox.cs
deleted file mode 100644
index ab1c805a..00000000
--- a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/RichTextBox/RichTextBox.cs
+++ /dev/null
@@ -1,135 +0,0 @@
-using System;
-using System.Windows;
-using System.Windows.Data;
-using System.Windows.Threading;
-
-namespace Microsoft.Windows.Controls
-{
- public class RichTextBox : System.Windows.Controls.RichTextBox
- {
- #region Private Members
-
- private bool _textHasLoaded;
- private bool isInvokePending;
-
- #endregion //Private Members
-
- #region Constructors
-
- public RichTextBox()
- {
- Loaded += RichTextBox_Loaded;
- }
-
- public RichTextBox(System.Windows.Documents.FlowDocument document)
- : base(document)
- {
-
- }
-
- #endregion //Constructors
-
- #region Properties
-
- #region Text
-
- public static readonly DependencyProperty TextProperty = DependencyProperty.Register("Text", typeof(string), typeof(RichTextBox), new FrameworkPropertyMetadata(String.Empty, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnTextPropertyChanged, CoerceTextProperty, true, UpdateSourceTrigger.LostFocus));
- public string Text
- {
- get { return (string)GetValue(TextProperty); }
- set { SetValue(TextProperty, value); }
- }
-
- private static void OnTextPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
- {
- RichTextBox rtb = (RichTextBox)d;
-
- if (!rtb._textHasLoaded)
- {
- rtb.TextFormatter.SetText(rtb.Document, (string)e.NewValue);
- rtb._textHasLoaded = true;
- }
- }
-
- private static object CoerceTextProperty(DependencyObject d, object value)
- {
- return value ?? "";
- }
-
- #endregion //Text
-
- #region TextFormatter
-
- private ITextFormatter _textFormatter;
- ///
- /// The ITextFormatter the is used to format the text of the RichTextBox.
- /// Deafult formatter is the RtfFormatter
- ///
- public ITextFormatter TextFormatter
- {
- get
- {
- if (_textFormatter == null)
- _textFormatter = new RtfFormatter(); //default is rtf
-
- return _textFormatter;
- }
- set
- {
- _textFormatter = value;
- }
- }
-
- #endregion //TextFormatter
-
- #endregion //Properties
-
- #region Methods
-
- private void InvokeUpdateText()
- {
- if (!isInvokePending)
- {
- Dispatcher.BeginInvoke(DispatcherPriority.Background, new Action(UpdateText));
- isInvokePending = true;
- }
- }
-
- private void UpdateText()
- {
- //when the Text is null and the Text hasn't been loaded, it indicates that the OnTextPropertyChanged event hasn't exceuted
- //and since we are initializing the text from here, we don't want the OnTextPropertyChanged to execute, so set the loaded flag to true.
- //this prevents the cursor to jumping to the front of the textbox after the first letter is typed.
- if (!_textHasLoaded && string.IsNullOrEmpty(Text))
- _textHasLoaded = true;
-
- if (_textHasLoaded)
- Text = TextFormatter.GetText(Document);
-
- isInvokePending = false;
- }
-
- #endregion //Methods
-
- #region Event Hanlders
-
- private void RichTextBox_Loaded(object sender, RoutedEventArgs e)
- {
- Binding binding = BindingOperations.GetBinding(this, TextProperty);
-
- if (binding != null)
- {
- if (binding.UpdateSourceTrigger == UpdateSourceTrigger.Default || binding.UpdateSourceTrigger == UpdateSourceTrigger.LostFocus)
- {
- PreviewLostKeyboardFocus += (o, ea) => UpdateText(); //do this synchronously
- }
- else
- {
- TextChanged += (o, ea) => InvokeUpdateText(); //do this async
- }
- }
- }
-
- #endregion //Event Hanlders
- }
-}
diff --git a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/RichTextBoxFormatBar/IRichTextBoxFormatBar.cs b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/RichTextBoxFormatBar/IRichTextBoxFormatBar.cs
deleted file mode 100644
index 46c38afe..00000000
--- a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/RichTextBoxFormatBar/IRichTextBoxFormatBar.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-using System;
-
-namespace Microsoft.Windows.Controls
-{
- public interface IRichTextBoxFormatBar
- {
- ///
- /// Represents the RichTextBox that will be the target for all text manipulations in the format bar.
- ///
- global::System.Windows.Controls.RichTextBox Target { get; set; }
- }
-}
diff --git a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/RichTextBoxFormatBar/RichTextBoxFormatBar.xaml b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/RichTextBoxFormatBar/RichTextBoxFormatBar.xaml
deleted file mode 100644
index 6d919c41..00000000
--- a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/RichTextBoxFormatBar/RichTextBoxFormatBar.xaml
+++ /dev/null
@@ -1,203 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/RichTextBoxFormatBar/RichTextBoxFormatBar.xaml.cs b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/RichTextBoxFormatBar/RichTextBoxFormatBar.xaml.cs
deleted file mode 100644
index 65e78914..00000000
--- a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/RichTextBoxFormatBar/RichTextBoxFormatBar.xaml.cs
+++ /dev/null
@@ -1,162 +0,0 @@
-using System;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Documents;
-using System.Windows.Media;
-using System.Windows.Controls.Primitives;
-using Microsoft.Windows.Controls.Core;
-
-namespace Microsoft.Windows.Controls
-{
- ///
- /// Interaction logic for RichTextBoxFormatBar.xaml
- ///
- public partial class RichTextBoxFormatBar : UserControl, IRichTextBoxFormatBar
- {
- #region Properties
-
- #region RichTextBox
-
- public static readonly DependencyProperty TargetProperty = DependencyProperty.Register("Target", typeof(global::System.Windows.Controls.RichTextBox), typeof(RichTextBoxFormatBar), new PropertyMetadata(null, OnRichTextBoxPropertyChanged));
- public global::System.Windows.Controls.RichTextBox Target
- {
- get { return (global::System.Windows.Controls.RichTextBox)GetValue(TargetProperty); }
- set { SetValue(TargetProperty, value); }
- }
-
- private static void OnRichTextBoxPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
- {
- RichTextBoxFormatBar formatBar = d as RichTextBoxFormatBar;
- formatBar.HookupRichTextBoxEvents();
- }
-
- private void HookupRichTextBoxEvents()
- {
- Target.SelectionChanged += RichTextBox_SelectionChanged;
- }
-
- #endregion //RichTextBox
-
- public static double[] FontSizes
- {
- get
- {
- return new double[] {
- 3.0, 4.0, 5.0, 6.0, 6.5, 7.0, 7.5, 8.0, 8.5, 9.0, 9.5,
- 10.0, 10.5, 11.0, 11.5, 12.0, 12.5, 13.0, 13.5, 14.0, 15.0,
- 16.0, 17.0, 18.0, 19.0, 20.0, 22.0, 24.0, 26.0, 28.0, 30.0,
- 32.0, 34.0, 36.0, 38.0, 40.0, 44.0, 48.0, 52.0, 56.0, 60.0, 64.0, 68.0, 72.0, 76.0,
- 80.0, 88.0, 96.0, 104.0, 112.0, 120.0, 128.0, 136.0, 144.0
- };
- }
- }
-
- #endregion
-
- #region Constructors
-
- public RichTextBoxFormatBar()
- {
- InitializeComponent();
- Loaded += FormatToolbar_Loaded;
- }
-
- #endregion //Constructors
-
- #region Event Hanlders
-
- void FormatToolbar_Loaded(object sender, RoutedEventArgs e)
- {
- _cmbFontFamilies.ItemsSource = Fonts.SystemFontFamilies;
- _cmbFontSizes.ItemsSource = FontSizes;
- }
-
- private void FontFamily_SelectionChanged(object sender, SelectionChangedEventArgs e)
- {
- if (e.AddedItems.Count == 0)
- return;
-
- FontFamily editValue = (FontFamily)e.AddedItems[0];
- ApplyPropertyValueToSelectedText(TextElement.FontFamilyProperty, editValue);
- }
-
- private void FontSize_SelectionChanged(object sender, SelectionChangedEventArgs e)
- {
- if (e.AddedItems.Count == 0)
- return;
-
- ApplyPropertyValueToSelectedText(TextElement.FontSizeProperty, e.AddedItems[0]);
- }
-
- void RichTextBox_SelectionChanged(object sender, RoutedEventArgs e)
- {
- UpdateVisualState();
- }
-
- private void DragWidget_DragDelta(object sender, DragDeltaEventArgs e)
- {
- ProcessMove(e);
- }
-
- #endregion //Event Hanlders
-
- #region Methods
-
- private void UpdateVisualState()
- {
- UpdateToggleButtonState();
- UpdateSelectedFontFamily();
- UpdateSelectedFontSize();
- }
-
- private void UpdateToggleButtonState()
- {
- UpdateItemCheckedState(_btnBold, TextElement.FontWeightProperty, FontWeights.Bold);
- UpdateItemCheckedState(_btnItalic, TextElement.FontStyleProperty, FontStyles.Italic);
- UpdateItemCheckedState(_btnUnderline, Inline.TextDecorationsProperty, TextDecorations.Underline);
-
- UpdateItemCheckedState(_btnAlignLeft, Paragraph.TextAlignmentProperty, TextAlignment.Left);
- UpdateItemCheckedState(_btnAlignCenter, Paragraph.TextAlignmentProperty, TextAlignment.Center);
- UpdateItemCheckedState(_btnAlignRight, Paragraph.TextAlignmentProperty, TextAlignment.Right);
- }
-
- void UpdateItemCheckedState(ToggleButton button, DependencyProperty formattingProperty, object expectedValue)
- {
- object currentValue = Target.Selection.GetPropertyValue(formattingProperty);
- button.IsChecked = (currentValue == DependencyProperty.UnsetValue) ? false : currentValue != null && currentValue.Equals(expectedValue);
- }
-
- private void UpdateSelectedFontFamily()
- {
- object value = Target.Selection.GetPropertyValue(TextElement.FontFamilyProperty);
- FontFamily currentFontFamily = (FontFamily)((value == DependencyProperty.UnsetValue) ? null : value);
- if (currentFontFamily != null)
- {
- _cmbFontFamilies.SelectedItem = currentFontFamily;
- }
- }
-
- private void UpdateSelectedFontSize()
- {
- object value = Target.Selection.GetPropertyValue(TextElement.FontSizeProperty);
- _cmbFontSizes.SelectedValue = (value == DependencyProperty.UnsetValue) ? null : value;
- }
-
- void ApplyPropertyValueToSelectedText(DependencyProperty formattingProperty, object value)
- {
- if (value == null)
- return;
-
- Target.Selection.ApplyPropertyValue(formattingProperty, value);
- }
-
- private void ProcessMove(DragDeltaEventArgs e)
- {
- AdornerLayer layer = AdornerLayer.GetAdornerLayer(Target);
- UIElementAdorner adorner = layer.GetAdorners(Target)[0] as UIElementAdorner;
- adorner.SetOffsets(adorner.OffsetLeft + e.HorizontalChange, adorner.OffsetTop + e.VerticalChange);
- }
-
- #endregion //Methods
- }
-}
diff --git a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/RichTextBoxFormatBar/RichTextBoxFormatBarManager.cs b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/RichTextBoxFormatBar/RichTextBoxFormatBarManager.cs
deleted file mode 100644
index 1b03394f..00000000
--- a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/RichTextBoxFormatBar/RichTextBoxFormatBarManager.cs
+++ /dev/null
@@ -1,187 +0,0 @@
-using System;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Documents;
-using Microsoft.Windows.Controls.Core;
-using System.Windows.Input;
-
-namespace Microsoft.Windows.Controls
-{
- public class RichTextBoxFormatBarManager : DependencyObject
- {
- #region Members
-
- private global::System.Windows.Controls.RichTextBox _richTextBox;
- private UIElementAdorner _adorner;
- private IRichTextBoxFormatBar _toolbar;
-
- #endregion //Members
-
- #region Properties
-
- #region FormatBar
-
- public static readonly DependencyProperty FormatBarProperty = DependencyProperty.RegisterAttached("FormatBar", typeof(IRichTextBoxFormatBar), typeof(RichTextBox), new PropertyMetadata(null, OnFormatBarPropertyChanged));
- public static void SetFormatBar(UIElement element, IRichTextBoxFormatBar value)
- {
- element.SetValue(FormatBarProperty, value);
- }
- public static IRichTextBoxFormatBar GetFormatBar(UIElement element)
- {
- return (IRichTextBoxFormatBar)element.GetValue(FormatBarProperty);
- }
-
- private static void OnFormatBarPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
- {
- global::System.Windows.Controls.RichTextBox rtb = d as global::System.Windows.Controls.RichTextBox;
- if (rtb == null)
- throw new Exception("A FormatBar can only be applied to a RichTextBox.");
-
- RichTextBoxFormatBarManager manager = new RichTextBoxFormatBarManager();
- manager.AttachFormatBarToRichtextBox(rtb, e.NewValue as IRichTextBoxFormatBar);
- }
-
- #endregion //FormatBar
-
- bool AdornerIsVisible
- {
- get { return _adorner.Visibility == Visibility.Visible; }
- }
-
- #endregion //Properties
-
- #region Event Handlers
-
- void RichTextBox_MouseButtonUp(object sender, MouseButtonEventArgs e)
- {
- if (e.LeftButton == MouseButtonState.Released)
- {
- TextRange selectedText = new TextRange(_richTextBox.Selection.Start, _richTextBox.Selection.End);
- if (selectedText.Text.Length > 0 && !String.IsNullOrEmpty(selectedText.Text))
- {
- ShowAdorner();
- }
- else
- {
- HideAdorner();
- }
- }
-
- e.Handled = true;
- }
-
- void RichTextBox_PreviewMouseMove(object sender, MouseEventArgs e)
- {
- //if the mouse moves outside the richtextbox bounds hide the adorner
- //though this deosn't always work, especially if the user moves the mouse very quickly.
- //need to find a better solution, but this will work for now.
- Point p = e.GetPosition(_richTextBox);
- if (p.X <= 5.0 || p.X >= _richTextBox.ActualWidth - 5 || p.Y <= 3.0 || p.Y >= _richTextBox.ActualHeight - 3)
- HideAdorner();
- }
-
- void RichTextBox_TextChanged(object sender, TextChangedEventArgs e)
- {
- //this fixes the bug when applying text transformations the text would lose it's highlight. That was because the RichTextBox was losing focus
- //so we just give it focus again and it seems to do the trick of re-highlighting it.
- if (!_richTextBox.IsFocused)
- _richTextBox.Focus();
- }
-
- #endregion //Event Handlers
-
- #region Methods
-
- ///
- /// Attaches a FormatBar to a RichtextBox
- ///
- /// The RichtextBox to attach to.
- /// The Formatbar to attach.
- private void AttachFormatBarToRichtextBox(global::System.Windows.Controls.RichTextBox richTextBox, IRichTextBoxFormatBar formatBar)
- {
- _richTextBox = richTextBox;
- _richTextBox.PreviewMouseMove += RichTextBox_PreviewMouseMove;
- //we cannot use the PreviewMouseLeftButtonUp event because of selection bugs.
- //we cannot use the MouseLeftButtonUp event because it is handled by the RichTextBox and does not bubble up to here, so we must
- //add a hander to the MouseUpEvent using the Addhandler syntax, and specify to listen for handled events too.
- _richTextBox.AddHandler(Mouse.MouseUpEvent, new MouseButtonEventHandler(RichTextBox_MouseButtonUp), true);
- _richTextBox.TextChanged += RichTextBox_TextChanged;
-
- _adorner = new UIElementAdorner(_richTextBox);
-
- formatBar.Target = _richTextBox;
- _toolbar = formatBar;
- }
-
- ///
- /// Shows the FormatBar
- ///
- void ShowAdorner()
- {
- VerifyAdornerLayer();
-
- Control adorningEditor = _toolbar as Control;
- _adorner.Child = adorningEditor;
- _adorner.Visibility = Visibility.Visible;
-
- PositionFormatBar(adorningEditor);
- }
-
- ///
- /// Positions the FormatBar so that is does not go outside the bounds of the RichTextBox or covers the selected text
- ///
- ///
- private void PositionFormatBar(Control adorningEditor)
- {
- Point mousePosition = Mouse.GetPosition(_richTextBox);
-
- double left = mousePosition.X;
- double top = (mousePosition.Y - 15) - adorningEditor.ActualHeight;
-
- //top
- if (top < 0)
- {
- top = mousePosition.Y + 10;
- }
-
- //right boundary
- if (left + adorningEditor.ActualWidth > _richTextBox.ActualWidth - 20)
- {
- left = left - (adorningEditor.ActualWidth - (_richTextBox.ActualWidth - left));
- }
-
- _adorner.SetOffsets(left, top);
- }
-
- ///
- /// Ensures that the IRichTextFormatBar is in the adorner layer.
- ///
- /// True if the IRichTextFormatBar is in the adorner layer, else false.
- bool VerifyAdornerLayer()
- {
- if (_adorner.Parent != null)
- return true;
-
- AdornerLayer layer = AdornerLayer.GetAdornerLayer(_richTextBox);
- if (layer == null)
- return false;
-
- layer.Add(_adorner);
- return true;
- }
-
- ///
- /// Hides the IRichTextFormatBar that is in the adornor layer.
- ///
- void HideAdorner()
- {
- if (AdornerIsVisible)
- {
- _adorner.Visibility = Visibility.Collapsed;
- _adorner.Child = null;
- }
- }
-
- #endregion //Methods
- }
-}
diff --git a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/Themes/Generic.xaml b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/Themes/Generic.xaml
index 7ad95cc4..4338377d 100644
--- a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/Themes/Generic.xaml
+++ b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/Themes/Generic.xaml
@@ -1,8 +1,16 @@
-
+
+
+
+
+
+
@@ -99,6 +107,7 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/UpDownBase/UpDownBase.cs b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/UpDownBase/UpDownBase.cs
deleted file mode 100644
index aed90390..00000000
--- a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/UpDownBase/UpDownBase.cs
+++ /dev/null
@@ -1,321 +0,0 @@
-using System;
-using System.Windows.Input;
-using System.Windows.Controls;
-using System.Windows;
-
-namespace Microsoft.Windows.Controls
-{
- public abstract class UpDownBase : Control
- {
- #region Members
-
- ///
- /// Name constant for Text template part.
- ///
- internal const string ElementTextName = "Text";
-
- ///
- /// Name constant for Spinner template part.
- ///
- internal const string ElementSpinnerName = "Spinner";
-
- ///
- /// Flags if the Text and Value properties are in the process of being sync'd
- ///
- bool _isSyncingTextAndValueProperties;
-
- #endregion //Members
-
- #region Properties
-
- #region Value
-
- public static readonly DependencyProperty ValueProperty = DependencyProperty.Register("Value", typeof(T), typeof(UpDownBase), new FrameworkPropertyMetadata(default(T), FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnValuePropertyChanged));
- public virtual T Value
- {
- get { return (T)GetValue(ValueProperty); }
- set { SetValue(ValueProperty, value); }
- }
-
- private static void OnValuePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
- {
- UpDownBase udb = (UpDownBase)d;
- T oldValue = (T)e.OldValue;
- T newValue = (T)e.NewValue;
-
- udb.SyncTextAndValueProperties(e.Property, e.NewValue);
-
- RoutedPropertyChangedEventArgs changedArgs = new RoutedPropertyChangedEventArgs(oldValue, newValue);
- udb.OnValueChanged(changedArgs);
- }
-
- protected virtual void OnValueChanged(RoutedPropertyChangedEventArgs e)
- {
- if (ValueChanged != null)
- ValueChanged(this, e);
- }
-
- #endregion //Value
-
- #region Text
-
- public static readonly DependencyProperty TextProperty = DependencyProperty.Register("Text", typeof(string), typeof(UpDownBase), new FrameworkPropertyMetadata("0", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnTextPropertyChanged));
- public string Text
- {
- get { return (string)GetValue(TextProperty); }
- set { SetValue(TextProperty, value); }
- }
-
- private static void OnTextPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
- {
- UpDownBase udb = (UpDownBase)d;
- udb.SyncTextAndValueProperties(e.Property, e.NewValue);
- }
-
- #endregion //Text
-
- #region IsEditable
-
- public static readonly DependencyProperty IsEditableProperty = DependencyProperty.Register("IsEditable", typeof(bool), typeof(UpDownBase), new PropertyMetadata(true, OnIsEditablePropertyChanged));
- public bool IsEditable
- {
- get { return (bool)GetValue(IsEditableProperty); }
- set { SetValue(IsEditableProperty, value); }
- }
-
- private static void OnIsEditablePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
- {
- UpDownBase source = d as UpDownBase;
- source.OnIsEditableChanged((bool)e.OldValue, (bool)e.NewValue);
- }
-
- protected virtual void OnIsEditableChanged(bool oldValue, bool newValue)
- {
- if (TextBox != null)
- TextBox.IsReadOnly = !IsEditable;
- }
-
- #endregion //IsEditable
-
- internal TextBox TextBox { get; private set; }
-
- private Spinner _spinner;
- internal Spinner Spinner
- {
- get { return _spinner; }
- private set
- {
- _spinner = value;
- _spinner.Spin += OnSpinnerSpin;
- }
- }
-
- #endregion //Properties
-
- #region Constructors
-
- protected UpDownBase() { }
-
- #endregion //Constructors
-
- #region Base Class Overrides
-
- public override void OnApplyTemplate()
- {
- base.OnApplyTemplate();
-
- TextBox = GetTemplateChild(ElementTextName) as TextBox;
- Spinner = GetTemplateChild(ElementSpinnerName) as Spinner;
-
- if (TextBox != null)
- TextBox.IsReadOnly = !IsEditable;
- }
-
- protected override void OnPreviewKeyDown(KeyEventArgs e)
- {
- switch (e.Key)
- {
- case Key.Up:
- {
- DoIncrement();
- e.Handled = true;
- break;
- }
- case Key.Down:
- {
- DoDecrement();
- e.Handled = true;
- break;
- }
- case Key.Enter:
- {
- SyncTextAndValueProperties(UpDownBase.TextProperty, TextBox.Text);
- break;
- }
- }
- }
-
- protected override void OnMouseWheel(MouseWheelEventArgs e)
- {
- base.OnMouseWheel(e);
-
- if (!e.Handled)
- {
- if (e.Delta < 0)
- {
- DoDecrement();
- }
- else if (0 < e.Delta)
- {
- DoIncrement();
- }
-
- e.Handled = true;
- }
- }
-
- #endregion //Base Class Overrides
-
- #region Methods
-
- #region Abstract
-
- ///
- /// Called by ApplyValue to parse user input.
- ///
- /// User input.
- /// Value parsed from user input.
- protected abstract T ParseValue(string text);
-
- ///
- /// Renders the value property into the textbox text.
- ///
- /// Formatted Value.
- protected internal abstract string FormatValue();
-
- ///
- /// Called by OnSpin when the spin direction is SpinDirection.Increase.
- ///
- protected abstract void OnIncrement();
-
- ///
- /// Called by OnSpin when the spin direction is SpinDirection.Descrease.
- ///
- protected abstract void OnDecrement();
-
- #endregion //Abstract
-
- #region Protected
-
- ///
- /// GetValue override to return Value property as object type.
- ///
- /// The Value property as object type.
- protected object GetValue()
- {
- return Value;
- }
-
- ///
- /// SetValue override to set value to Value property.
- ///
- /// New value.
- protected void SetValue(object value)
- {
- Value = (T)value;
- }
-
- #endregion //Protected
-
- #region Private
-
- ///
- /// Performs an increment if conditions allow it.
- ///
- private void DoDecrement()
- {
- if (Spinner == null || (Spinner.ValidSpinDirection & ValidSpinDirections.Decrease) == ValidSpinDirections.Decrease)
- {
- OnDecrement();
- }
- }
-
- ///
- /// Performs a decrement if conditions allow it.
- ///
- private void DoIncrement()
- {
- if (Spinner == null || (Spinner.ValidSpinDirection & ValidSpinDirections.Increase) == ValidSpinDirections.Increase)
- {
- OnIncrement();
- }
- }
-
- protected void SyncTextAndValueProperties(DependencyProperty p, object newValue)
- {
- //prevents recursive syncing properties
- if (_isSyncingTextAndValueProperties)
- return;
-
- _isSyncingTextAndValueProperties = true;
-
- //this only occures when the user typed in the value
- if (UpDownBase.TextProperty == p)
- {
- SetValue(UpDownBase.ValueProperty, ParseValue(newValue.ToString()));
- }
-
- //we need to update the text no matter what because the user could have used the spin buttons to change dthe value
- //or typed in the textbox so we need to reformat the entered value.
- SetValue(UpDownBase.TextProperty, FormatValue());
-
- _isSyncingTextAndValueProperties = false;
- }
-
- #endregion //Private
-
- #region Virtual
-
- ///
- /// Occurs when the spinner spins.
- ///
- /// Event args.
- protected virtual void OnSpin(SpinEventArgs e)
- {
- if (e == null)
- throw new ArgumentNullException("e");
-
- if (e.Direction == SpinDirection.Increase)
- DoIncrement();
- else
- DoDecrement();
- }
-
- #endregion //Virtual
-
- #endregion //Methods
-
- #region Event Handlers
-
- ///
- /// Event handler for Spinner template part's Spin event.
- ///
- /// The Spinner template part.
- /// Event args.
- private void OnSpinnerSpin(object sender, SpinEventArgs e)
- {
- OnSpin(e);
- }
-
- #endregion //Event Handlers
-
- #region Events
-
- ///
- /// Occurs when Value property has changed.
- ///
- public event RoutedPropertyChangedEventHandler ValueChanged;
-
- #endregion //Events
- }
-}
diff --git a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/VisualStates.cs b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/VisualStates.cs
deleted file mode 100644
index 721a96e2..00000000
--- a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/VisualStates.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-using System;
-
-namespace Microsoft.Windows.Controls
-{
- internal static partial class VisualStates
- {
-
- }
-}
diff --git a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/WPFToolkit.Extended.csproj b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/WPFToolkit.Extended.csproj
index bd366366..7bfbbd20 100644
--- a/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/WPFToolkit.Extended.csproj
+++ b/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/WPFToolkit.Extended.csproj
@@ -25,7 +25,7 @@
full
false
bin\Debug\
- DEBUG;TRACE
+ TRACE;DEBUG;VS2008
prompt
4
@@ -46,38 +46,153 @@
-
-
-
+
+ 3.0
+
+
+ 3.0
+
+
+ 3.0
+
+
+ 3.0
+
-
+
+ RichTextBoxFormatBar\RichTextBoxFormatBar.xaml
MSBuild:Compile
Designer
- MSBuild:Compile
Designer
+ MSBuild:Compile
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ BusyIndicator\BusyIndicator.cs
+
+
+ BusyIndicator\VisualStates.BusyIndicator.cs
+
+
+ ButtonSpinner\ButtonSpinner.cs
+
+
+ ButtonSpinner\SpinDirection.cs
+
+
+ ButtonSpinner\SpinEventArgs.cs
+
+
+ ButtonSpinner\Spinner.cs
+
+
+ ButtonSpinner\ValidSpinDirections.cs
+
+
+ ChildWindow\ChildWindow.cs
+
+
+ ChildWindow\VisualStates.ChildWindow.cs
+
+
+ ChildWindow\WindowState.cs
+
+
+ ColorPicker\ColorPicker.cs
+
+
+ ColorPicker\ColorSpectrumSlider.cs
+
+
+ ColorPicker\ColorUtilities.cs
+
+
+ ColorPicker\HsvColor.cs
+
+
+ Core\Converters\InverseBoolConverter.cs
+
+
+ Core\Primitives\InputBase.cs
+
+
+ Core\UIElementAdorner.cs
+
+
+ DateTimeUpDown\DateTimeFormat.cs
+
+
+ DateTimeUpDown\DateTimeInfo.cs
+
+
+ DateTimeUpDown\DateTimePart.cs
+
+
+ DateTimeUpDown\DateTimeUpDown.cs
+
+
+ Magnifier\Converters\BorderThicknessToStrokeThicknessConverter.cs
+
+
+ Magnifier\Converters\RadiusConverter.cs
+
+
+ Magnifier\Magnifier.cs
+
+
+ Magnifier\MagnifierAdorner.cs
+
+
+ Magnifier\MagnifierManager.cs
+
+
+ MaskedTextBox\MaskedTextBox.cs
+
+
+ MessageBox\MessageBox.cs
+
+
+ MessageBox\VisualStates.MessageBox.cs
+
+
+ NumericUpDown\NumericUpDown.cs
+
+
+ RichTextBoxFormatBar\IRichTextBoxFormatBar.cs
+
+
+ RichTextBoxFormatBar\RichTextBoxFormatBar.xaml.cs
+ RichTextBoxFormatBar.xaml
+
+
+ RichTextBoxFormatBar\RichTextBoxFormatBarManager.cs
+
+
+ RichTextBox\Formatters\ITextFormatter.cs
+
+
+ RichTextBox\Formatters\PlainTextFormatter.cs
+
+
+ RichTextBox\Formatters\RtfFormatter.cs
+
+
+ RichTextBox\Formatters\XamlFormatter.cs
+
+
+ RichTextBox\RichTextBox.cs
+
+
+ UpDownBase\UpDownBase.cs
+
+
+ VisualStates.cs
+
Code
@@ -91,20 +206,6 @@
Settings.settings
True
-
-
-
- RichTextBoxFormatBar.xaml
-
-
-
-
-
-
-
-
-
-
ResXFileCodeGenerator
Resources.Designer.cs
@@ -130,9 +231,6 @@
-
-
-