diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/BusyIndicator/BusyIndicator.xaml b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/BusyIndicator/BusyIndicator.xaml deleted file mode 100644 index a43fa9e1..00000000 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/BusyIndicator/BusyIndicator.xaml +++ /dev/null @@ -1,142 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Collapsed - - - - - - - Collapsed - - - - - - - - - - - Visible - - - - - - - Visible - - - - - - - - - - - - - True - - - - - - - - - - - False - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/CheckListBox/Implementation/CheckListBoxCheckedChangedEventArgs.cs b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/CheckListBox/Implementation/CheckListBoxCheckedChangedEventArgs.cs deleted file mode 100644 index 7450379c..00000000 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/CheckListBox/Implementation/CheckListBoxCheckedChangedEventArgs.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Windows; - -namespace Microsoft.Windows.Controls -{ - public delegate void CheckListBoxCheckedChangedEventHandler(object sender, CheckListBoxCheckedChangedEventArgs e); - public class CheckListBoxCheckedChangedEventArgs : RoutedEventArgs - { - public object Item { get; private set; } - - public CheckListBoxCheckedChangedEventArgs(RoutedEvent routedEvent, object source, object item) - : base(routedEvent, source) - { - Item = item; - } - } -} diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/CheckListBox/Implementation/CheckListBoxItem.cs b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/CheckListBox/Implementation/CheckListBoxItem.cs deleted file mode 100644 index 1993c7ca..00000000 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/CheckListBox/Implementation/CheckListBoxItem.cs +++ /dev/null @@ -1,81 +0,0 @@ -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; -using System.Windows.Controls.Primitives; - -namespace Microsoft.Windows.Controls -{ - public class CheckListBoxItem : ContentControl - { - static CheckListBoxItem() - { - DefaultStyleKeyProperty.OverrideMetadata(typeof(CheckListBoxItem), new FrameworkPropertyMetadata(typeof(CheckListBoxItem))); - } - - public CheckListBoxItem() - { - AddHandler(Mouse.MouseDownEvent, new MouseButtonEventHandler(CheckListBoxItem_MouseDown)); - } - - #region Properties - - public static readonly DependencyProperty IsCheckedProperty = DependencyProperty.Register("IsChecked", typeof(bool), typeof(CheckListBoxItem), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnIsSelectedChanged)); - public bool IsChecked - { - get { return (bool)GetValue(IsCheckedProperty); } - set { SetValue(IsCheckedProperty, value); } - } - - private static void OnIsSelectedChanged(DependencyObject o, DependencyPropertyChangedEventArgs e) - { - CheckListBoxItem checkListBoxItem = o as CheckListBoxItem; - if (checkListBoxItem != null) - checkListBoxItem.OnIsSelectedChanged((bool)e.OldValue, (bool)e.NewValue); - } - - protected virtual void OnIsSelectedChanged(bool oldValue, bool newValue) - { - if (newValue) - RaiseSelectionChangedEvent(new RoutedEventArgs(CheckListBox.CheckedEvent, this)); - else - RaiseSelectionChangedEvent(new RoutedEventArgs(CheckListBox.UncheckedEvent, this)); - } - - #endregion //Properties - - #region Events - - public static readonly RoutedEvent SelectedEvent = CheckListBox.CheckedEvent.AddOwner(typeof(CheckListBoxItem)); - public static readonly RoutedEvent UnselectedEvent = CheckListBox.UncheckedEvent.AddOwner(typeof(CheckListBoxItem)); - - #endregion - - #region Event Hanlders - - void CheckListBoxItem_MouseDown(object sender, MouseButtonEventArgs e) - { - IsChecked = !IsChecked; - } - - #endregion //Event Hanlders - - #region Methods - - private void RaiseSelectionChangedEvent(RoutedEventArgs e) - { - base.RaiseEvent(e); - } - - #endregion //Methods - } -} diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/ChildWindow/ChildWindow.xaml b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/ChildWindow/ChildWindow.xaml deleted file mode 100644 index 45bcc828..00000000 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/ChildWindow/ChildWindow.xaml +++ /dev/null @@ -1,196 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/ChildWindow/Implementation/VisualStates.ChildWindow.cs b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/ChildWindow/Implementation/VisualStates.ChildWindow.cs deleted file mode 100644 index eb3a4ea9..00000000 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/ChildWindow/Implementation/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/Src/WPFToolkit.Extended/ColorPicker/ColorPicker.xaml b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/ColorPicker/ColorPicker.xaml deleted file mode 100644 index 7b07bb77..00000000 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/ColorPicker/ColorPicker.xaml +++ /dev/null @@ -1,367 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/ColorPicker/ColorSpectrumSlider.cs b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/ColorPicker/ColorSpectrumSlider.cs deleted file mode 100644 index c4eac2d8..00000000 --- a/ExtendedWPFToolkitSolution/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/Src/WPFToolkit.Extended/ColorPicker/HsvColor.cs b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/ColorPicker/HsvColor.cs deleted file mode 100644 index eed5c3bd..00000000 --- a/ExtendedWPFToolkitSolution/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/Src/WPFToolkit.Extended/MaskedTextBox/Themes/Generic.xaml b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/MaskedTextBox/Themes/Generic.xaml deleted file mode 100644 index 9f6dac6a..00000000 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/MaskedTextBox/Themes/Generic.xaml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/MessageBox/MessageBox.xaml b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/MessageBox/MessageBox.xaml deleted file mode 100644 index 7223ba9c..00000000 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/MessageBox/MessageBox.xaml +++ /dev/null @@ -1,286 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Properties/Resources.Designer.cs b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Properties/Resources.Designer.cs deleted file mode 100644 index 8917394e..00000000 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Properties/Resources.Designer.cs +++ /dev/null @@ -1,63 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.261 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Xceed.Wpf.Toolkit.Properties { - using System; - - - /// - /// 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", "4.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 (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Xceed.Wpf.Toolkit.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/Src/WPFToolkit.Extended/Properties/Resources.resx b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Properties/Resources.resx deleted file mode 100644 index ffecec85..00000000 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Properties/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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/Src/WPFToolkit.Extended/Properties/Settings.Designer.cs b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Properties/Settings.Designer.cs deleted file mode 100644 index 6ec402eb..00000000 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Properties/Settings.Designer.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.261 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Xceed.Wpf.Toolkit.Properties { - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default { - get { - return defaultInstance; - } - } - } -} diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Properties/Settings.settings b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Properties/Settings.settings deleted file mode 100644 index 8f2fd95d..00000000 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Properties/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/Attributes/TypeEditorAttribute.cs b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/Attributes/TypeEditorAttribute.cs deleted file mode 100644 index 26bbd28f..00000000 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/Attributes/TypeEditorAttribute.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; - -namespace Microsoft.Windows.Controls.PropertyGrid.Attributes -{ - public class TypeEditorAttribute : Attribute - { - public Type Type { get; set; } - - public TypeEditorAttribute(Type type) - { - var valueSourceInterface = type.GetInterface("Microsoft.Windows.Controls.PropertyGrid.Editors.ITypeEditor"); - if (valueSourceInterface == null) - throw new ArgumentException("Type must implement the ITypeEditor interface.", "type"); - - Type = type; - } - } -} diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/EditorProviders/CheckBoxEditorProvider.cs b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/EditorProviders/CheckBoxEditorProvider.cs deleted file mode 100644 index 4d80b084..00000000 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/EditorProviders/CheckBoxEditorProvider.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows; - -namespace Microsoft.Windows.Controls.PropertyGrid.Implementation.EditorProviders -{ - public class CheckBoxEditorProvider : ITypeEditorProvider - { - CheckBox _checkbox; - - public CheckBoxEditorProvider() - { - _checkbox = new CheckBox(); - _checkbox.Margin = new Thickness(2, 0, 0, 0); - } - - public void Initialize(PropertyItem propertyItem) - { - ResolveBinding(propertyItem); - } - - public FrameworkElement ResolveEditor() - { - return _checkbox; - } - - private void ResolveBinding(PropertyItem property) - { - var binding = new Binding(property.Name); - binding.Source = property.Instance; - binding.ValidatesOnExceptions = true; - binding.ValidatesOnDataErrors = true; - - if (property.IsWriteable) - binding.Mode = BindingMode.TwoWay; - else - binding.Mode = BindingMode.OneWay; - - BindingOperations.SetBinding(_checkbox, CheckBox.IsCheckedProperty, binding); - } - - - } -} diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/EditorProviders/EnumComboBoxEditorProvider.cs b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/EditorProviders/EnumComboBoxEditorProvider.cs deleted file mode 100644 index 17301263..00000000 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/EditorProviders/EnumComboBoxEditorProvider.cs +++ /dev/null @@ -1,67 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Windows.Controls; -using System.Windows; -using System.Windows.Data; -using System.Reflection; - -namespace Microsoft.Windows.Controls.PropertyGrid.Implementation.EditorProviders -{ - public class EnumComboBoxEditorProvider : ITypeEditorProvider - { - ComboBox _comboBox; - - public EnumComboBoxEditorProvider() - { - _comboBox = new ComboBox(); - } - - public void Initialize(PropertyItem propertyItem) - { - ResolveBinding(propertyItem); - SetItemsSource(propertyItem); - } - - public FrameworkElement ResolveEditor() - { - return _comboBox; - } - - private void ResolveBinding(PropertyItem property) - { - var binding = new Binding(property.Name); - binding.Source = property.Instance; - binding.ValidatesOnExceptions = true; - binding.ValidatesOnDataErrors = true; - - if (property.IsWriteable) - binding.Mode = BindingMode.TwoWay; - else - binding.Mode = BindingMode.OneWay; - - BindingOperations.SetBinding(_comboBox, ComboBox.SelectedItemProperty, binding); - } - - private void SetItemsSource(PropertyItem property) - { - _comboBox.ItemsSource = GetValues(property.PropertyType); - } - - public static object[] GetValues(Type enumType) - { - List values = new List(); - - var fields = from field in enumType.GetFields() - where field.IsLiteral - select field; - - foreach (FieldInfo field in fields) - { - values.Add(field.GetValue(enumType)); - } - - return values.ToArray(); - } - } -} diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/EditorProviders/FontComboBoxEditorProvider.cs b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/EditorProviders/FontComboBoxEditorProvider.cs deleted file mode 100644 index a6c06394..00000000 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/EditorProviders/FontComboBoxEditorProvider.cs +++ /dev/null @@ -1,110 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Windows.Controls; -using System.Windows; -using System.Windows.Data; -using System.Windows.Media; - -namespace Microsoft.Windows.Controls.PropertyGrid.Implementation.EditorProviders -{ - public class FontComboBoxEditorProvider : ITypeEditorProvider - { - ComboBox _comboBox; - - public FontComboBoxEditorProvider() - { - _comboBox = new ComboBox(); - } - - public void Initialize(PropertyItem propertyItem) - { - ResolveBinding(propertyItem); - SetItemsSource(propertyItem); - } - - public FrameworkElement ResolveEditor() - { - return _comboBox; - } - - private void ResolveBinding(PropertyItem property) - { - var binding = new Binding(property.Name); - binding.Source = property.Instance; - binding.ValidatesOnExceptions = true; - binding.ValidatesOnDataErrors = true; - - if (property.IsWriteable) - binding.Mode = BindingMode.TwoWay; - else - binding.Mode = BindingMode.OneWay; - - BindingOperations.SetBinding(_comboBox, ComboBox.SelectedItemProperty, binding); - } - - private void SetItemsSource(PropertyItem property) - { - if (property.PropertyType == typeof(FontFamily)) - { - List fonts = new List(); - fonts.Add(new FontFamily("Arial")); - fonts.Add(new FontFamily("Courier New")); - fonts.Add(new FontFamily("Times New Roman")); - fonts.Add(new FontFamily("Batang")); - fonts.Add(new FontFamily("BatangChe")); - fonts.Add(new FontFamily("DFKai-SB")); - fonts.Add(new FontFamily("Dotum")); - fonts.Add(new FontFamily("DutumChe")); - fonts.Add(new FontFamily("FangSong")); - fonts.Add(new FontFamily("GulimChe")); - fonts.Add(new FontFamily("Gungsuh")); - fonts.Add(new FontFamily("GungsuhChe")); - fonts.Add(new FontFamily("KaiTi")); - fonts.Add(new FontFamily("Malgun Gothic")); - fonts.Add(new FontFamily("Meiryo")); - fonts.Add(new FontFamily("Microsoft JhengHei")); - fonts.Add(new FontFamily("Microsoft YaHei")); - fonts.Add(new FontFamily("MingLiU")); - fonts.Add(new FontFamily("MingLiu_HKSCS")); - fonts.Add(new FontFamily("MingLiu_HKSCS-ExtB")); - fonts.Add(new FontFamily("MingLiu-ExtB")); - _comboBox.ItemsSource = fonts; - } - else if (property.PropertyType == typeof(FontWeight)) - { - List list = new List() - { - FontWeights.Black, FontWeights.Bold, FontWeights.ExtraBlack, FontWeights.ExtraBold, - FontWeights.ExtraLight, FontWeights.Light, FontWeights.Medium, FontWeights.Normal, FontWeights.SemiBold, - FontWeights.Thin - }; - _comboBox.ItemsSource = list; - } - else if (property.PropertyType == typeof(FontStyle)) - { - List list = new List() - { - FontStyles.Italic, - FontStyles.Normal - }; - _comboBox.ItemsSource = list; - } - else if (property.PropertyType == typeof(FontStretch)) - { - List list = new List() - { - FontStretches.Condensed, - FontStretches.Expanded, - FontStretches.ExtraCondensed, - FontStretches.ExtraExpanded, - FontStretches.Normal, - FontStretches.SemiCondensed, - FontStretches.SemiExpanded, - FontStretches.UltraCondensed, - FontStretches.UltraExpanded - }; - _comboBox.ItemsSource = list; - } - } - } -} diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/EditorProviders/ITypeEditorProvider.cs b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/EditorProviders/ITypeEditorProvider.cs deleted file mode 100644 index 5c629e96..00000000 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/EditorProviders/ITypeEditorProvider.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; -using System.Windows; - -namespace Microsoft.Windows.Controls.PropertyGrid.Implementation.EditorProviders -{ - interface ITypeEditorProvider - { - void Initialize(PropertyItem propertyItem); - FrameworkElement ResolveEditor(); - } -} diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/EditorProviders/NumericUpDownEditorProvider.cs b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/EditorProviders/NumericUpDownEditorProvider.cs deleted file mode 100644 index 8dd8a3d6..00000000 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/EditorProviders/NumericUpDownEditorProvider.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System; -using System.Windows.Data; -using System.Windows; - -namespace Microsoft.Windows.Controls.PropertyGrid.Implementation.EditorProviders -{ - public class NumericUpDownEditorProvider : ITypeEditorProvider - { - NumericUpDown _numericUpDown; - - public NumericUpDownEditorProvider() - { - _numericUpDown = new NumericUpDown(); - } - - public void Initialize(PropertyItem propertyItem) - { - ResolveBinding(propertyItem); - } - - public FrameworkElement ResolveEditor() - { - return _numericUpDown; - } - - private void ResolveBinding(PropertyItem property) - { - var binding = new Binding(property.Name); - binding.Source = property.Instance; - binding.ValidatesOnExceptions = true; - binding.ValidatesOnDataErrors = true; - - if (property.IsWriteable) - binding.Mode = BindingMode.TwoWay; - else - binding.Mode = BindingMode.OneWay; - - BindingOperations.SetBinding(_numericUpDown, NumericUpDown.ValueProperty, binding); - } - } -} diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/EditorProviders/TextBoxEditorProvider.cs b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/EditorProviders/TextBoxEditorProvider.cs deleted file mode 100644 index c475713d..00000000 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/EditorProviders/TextBoxEditorProvider.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows; - -namespace Microsoft.Windows.Controls.PropertyGrid.Implementation.EditorProviders -{ - public class TextBoxEditorProvider : ITypeEditorProvider - { - FrameworkElement _editor; - - public TextBoxEditorProvider() - { - _editor = new TextBox(); - } - - public void Initialize(PropertyItem propertyItem) - { - ResolveBinding(propertyItem); - } - - public FrameworkElement ResolveEditor() - { - return _editor; - } - - private void ResolveBinding(PropertyItem property) - { - var binding = new Binding(property.Name); - binding.Source = property.Instance; - binding.ValidatesOnExceptions = true; - binding.ValidatesOnDataErrors = true; - - if (property.IsWriteable) - binding.Mode = BindingMode.TwoWay; - else - binding.Mode = BindingMode.OneWay; - - BindingOperations.SetBinding(_editor, TextBox.TextProperty, binding); - } - } -} diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/Editors/DateTimeUpDownEditor.cs b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/Editors/DateTimeUpDownEditor.cs deleted file mode 100644 index 1aafa787..00000000 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/Editors/DateTimeUpDownEditor.cs +++ /dev/null @@ -1,33 +0,0 @@ -/************************************************************************ - - Extended WPF Toolkit - - Copyright (C) 2010-2012 Xceed Software Inc. - - This program is provided to you under the terms of the Microsoft Public - License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license - - This program can be provided to you by Xceed Software Inc. under a - proprietary commercial license agreement for use in non-Open Source - projects. The commercial version of Extended WPF Toolkit also includes - priority technical support, commercial updates, and many additional - useful WPF controls if you license Xceed Business Suite for WPF. - - Visit http://xceed.com and follow @datagrid on Twitter. - - **********************************************************************/ - -namespace Xceed.Wpf.Toolkit.PropertyGrid.Editors -{ - public class DateTimeUpDownEditor : TypeEditor - { - protected override void SetControlProperties() - { - Editor.BorderThickness = new System.Windows.Thickness( 0 ); - } - protected override void SetValueDependencyProperty() - { - ValueProperty = DateTimeUpDown.ValueProperty; - } - } -} diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/Editors/DecimalUpDownEditor.cs b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/Editors/DecimalUpDownEditor.cs deleted file mode 100644 index b778bcfc..00000000 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/Editors/DecimalUpDownEditor.cs +++ /dev/null @@ -1,34 +0,0 @@ -/************************************************************************ - - Extended WPF Toolkit - - Copyright (C) 2010-2012 Xceed Software Inc. - - This program is provided to you under the terms of the Microsoft Public - License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license - - This program can be provided to you by Xceed Software Inc. under a - proprietary commercial license agreement for use in non-Open Source - projects. The commercial version of Extended WPF Toolkit also includes - priority technical support, commercial updates, and many additional - useful WPF controls if you license Xceed Business Suite for WPF. - - Visit http://xceed.com and follow @datagrid on Twitter. - - **********************************************************************/ - -namespace Xceed.Wpf.Toolkit.PropertyGrid.Editors -{ - public class DecimalUpDownEditor : TypeEditor - { - protected override void SetControlProperties() - { - Editor.BorderThickness = new System.Windows.Thickness( 0 ); - } - - protected override void SetValueDependencyProperty() - { - ValueProperty = DecimalUpDown.ValueProperty; - } - } -} diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/Editors/DoubleUpDownEditor.cs b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/Editors/DoubleUpDownEditor.cs deleted file mode 100644 index ce2b6ded..00000000 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/Editors/DoubleUpDownEditor.cs +++ /dev/null @@ -1,34 +0,0 @@ -/************************************************************************ - - Extended WPF Toolkit - - Copyright (C) 2010-2012 Xceed Software Inc. - - This program is provided to you under the terms of the Microsoft Public - License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license - - This program can be provided to you by Xceed Software Inc. under a - proprietary commercial license agreement for use in non-Open Source - projects. The commercial version of Extended WPF Toolkit also includes - priority technical support, commercial updates, and many additional - useful WPF controls if you license Xceed Business Suite for WPF. - - Visit http://xceed.com and follow @datagrid on Twitter. - - **********************************************************************/ - -namespace Xceed.Wpf.Toolkit.PropertyGrid.Editors -{ - public class DoubleUpDownEditor : TypeEditor - { - protected override void SetControlProperties() - { - Editor.BorderThickness = new System.Windows.Thickness( 0 ); - } - - protected override void SetValueDependencyProperty() - { - ValueProperty = DoubleUpDown.ValueProperty; - } - } -} diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/Editors/IntegerUpDownEditor.cs b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/Editors/IntegerUpDownEditor.cs deleted file mode 100644 index 6d4c6491..00000000 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/Editors/IntegerUpDownEditor.cs +++ /dev/null @@ -1,33 +0,0 @@ -/************************************************************************ - - Extended WPF Toolkit - - Copyright (C) 2010-2012 Xceed Software Inc. - - This program is provided to you under the terms of the Microsoft Public - License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license - - This program can be provided to you by Xceed Software Inc. under a - proprietary commercial license agreement for use in non-Open Source - projects. The commercial version of Extended WPF Toolkit also includes - priority technical support, commercial updates, and many additional - useful WPF controls if you license Xceed Business Suite for WPF. - - Visit http://xceed.com and follow @datagrid on Twitter. - - **********************************************************************/ - -namespace Xceed.Wpf.Toolkit.PropertyGrid.Editors -{ - public class IntegerUpDownEditor : TypeEditor - { - protected override void SetControlProperties() - { - Editor.BorderThickness = new System.Windows.Thickness( 0 ); - } - protected override void SetValueDependencyProperty() - { - ValueProperty = IntegerUpDown.ValueProperty; - } - } -} diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/Editors/NumericUpDownEditor.cs b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/Editors/NumericUpDownEditor.cs deleted file mode 100644 index 283106bd..00000000 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/Editors/NumericUpDownEditor.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; - -namespace Microsoft.Windows.Controls.PropertyGrid.Editors -{ - public class NumericUpDownEditor : TypeEditor - { - protected override void SetValueDependencyProperty() - { - ValueProperty = NumericUpDown.ValueProperty; - } - } -} diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/IEditorDefinition.cs b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/IEditorDefinition.cs deleted file mode 100644 index 5d8c0039..00000000 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/IEditorDefinition.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Windows; - -namespace Microsoft.Windows.Controls.PropertyGrid -{ - public interface IEditorDefinition - { - DataTemplate EditorTemplate { get; set; } - PropertyDefinitionCollection PropertiesDefinitions { get; set; } - Type TargetType { get; set; } - } -} diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/PropertyCategoryItem.cs b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/PropertyCategoryItem.cs deleted file mode 100644 index 27089598..00000000 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/PropertyCategoryItem.cs +++ /dev/null @@ -1,72 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Windows.Controls; -using System.Windows; - -namespace Microsoft.Windows.Controls.PropertyGrid -{ - public class PropertyCategoryItem : Control - { - public static readonly DependencyProperty CategoryProperty = DependencyProperty.Register("Category", typeof(string), typeof(PropertyCategoryItem), new UIPropertyMetadata(String.Empty, new PropertyChangedCallback(OnCategoryChanged), new CoerceValueCallback(OnCoerceCategory))); - - private static object OnCoerceCategory(DependencyObject o, object value) - { - PropertyCategoryItem propertyCategoryItem = o as PropertyCategoryItem; - if (propertyCategoryItem != null) - return propertyCategoryItem.OnCoerceCategory((string)value); - else - return value; - } - - private static void OnCategoryChanged(DependencyObject o, DependencyPropertyChangedEventArgs e) - { - PropertyCategoryItem propertyCategoryItem = o as PropertyCategoryItem; - if (propertyCategoryItem != null) - propertyCategoryItem.OnCategoryChanged((string)e.OldValue, (string)e.NewValue); - } - - protected virtual string OnCoerceCategory(string value) - { - // TODO: Keep the proposed value within the desired range. - return value; - } - - protected virtual void OnCategoryChanged(string oldValue, string newValue) - { - // TODO: Add your property changed side-effects. Descendants can override as well. - } - - public string Category - { - // IMPORTANT: To maintain parity between setting a property in XAML and procedural code, do not touch the getter and setter inside this dependency property! - get - { - return (string)GetValue(CategoryProperty); - } - set - { - SetValue(CategoryProperty, value); - } - } - - - private List _Properties = new List(); - public List Properties - { - get - { - return _Properties; - } - set - { - _Properties = value; - } - } - - - static PropertyCategoryItem() - { - DefaultStyleKeyProperty.OverrideMetadata(typeof(PropertyCategoryItem), new FrameworkPropertyMetadata(typeof(PropertyCategoryItem))); - } - } -} diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/RichTextBox/FormatToolbar/FormatToolbar.xaml b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/RichTextBox/FormatToolbar/FormatToolbar.xaml deleted file mode 100644 index 314e9102..00000000 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/RichTextBox/FormatToolbar/FormatToolbar.xaml +++ /dev/null @@ -1,186 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/RichTextBox/FormatToolbar/FormatToolbar.xaml.cs b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/RichTextBox/FormatToolbar/FormatToolbar.xaml.cs deleted file mode 100644 index a0cfef85..00000000 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/RichTextBox/FormatToolbar/FormatToolbar.xaml.cs +++ /dev/null @@ -1,148 +0,0 @@ -using System; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Documents; -using System.Windows.Media; -using System.Windows.Controls.Primitives; - -namespace Microsoft.Windows.Controls.Formatting -{ - /// - /// Interaction logic for FormatToolbar.xaml - /// - public partial class FormatToolbar : UserControl - { - #region Properties - - public static readonly DependencyProperty RichTextBoxProperty = DependencyProperty.Register("RichTextBox", typeof(RichTextBox), typeof(FormatToolbar)); - public RichTextBox RichTextBox - { - get { return (RichTextBox)GetValue(RichTextBoxProperty); } - set { SetValue(RichTextBoxProperty, value); } - } - - public 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 FormatToolbar(RichTextBox richTextBox) - { - InitializeComponent(); - Loaded += FormatToolbar_Loaded; - RichTextBox = richTextBox; - RichTextBox.SelectionChanged += RichTextBox_SelectionChanged; - } - - #endregion //Constructors - - #region Event Hanlders - - void FormatToolbar_Loaded(object sender, RoutedEventArgs e) - { - _cmbFontFamilies.ItemsSource = System.Windows.Media.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 = RichTextBox.Selection.GetPropertyValue(formattingProperty); - button.IsChecked = (currentValue == DependencyProperty.UnsetValue) ? false : currentValue != null && currentValue.Equals(expectedValue); - } - - private void UpdateSelectedFontFamily() - { - object value = RichTextBox.Selection.GetPropertyValue(TextElement.FontFamilyProperty); - FontFamily currentFontFamily = (FontFamily)((value == DependencyProperty.UnsetValue) ? null : value); - if (currentFontFamily != null) - { - _cmbFontFamilies.SelectedItem = currentFontFamily; - } - } - - private void UpdateSelectedFontSize() - { - object value = RichTextBox.Selection.GetPropertyValue(TextElement.FontSizeProperty); - _cmbFontSizes.SelectedValue = (value == DependencyProperty.UnsetValue) ? null : value; - } - - void ApplyPropertyValueToSelectedText(DependencyProperty formattingProperty, object value) - { - if (value == null) - return; - - RichTextBox.Selection.ApplyPropertyValue(formattingProperty, value); - } - - private void ProcessMove(DragDeltaEventArgs e) - { - AdornerLayer layer = AdornerLayer.GetAdornerLayer(RichTextBox); - UIElementAdorner adorner = layer.GetAdorners(RichTextBox)[0] as UIElementAdorner; - adorner.SetOffsets(adorner.OffsetLeft + e.HorizontalChange, adorner.OffsetTop + e.VerticalChange); - } - - #endregion //Methods - } -} diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/RichTextBox/FormatToolbar/FormatToolbarManager.cs b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/RichTextBox/FormatToolbar/FormatToolbarManager.cs deleted file mode 100644 index 295e419a..00000000 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/RichTextBox/FormatToolbar/FormatToolbarManager.cs +++ /dev/null @@ -1,107 +0,0 @@ -using System; -using System.Windows.Controls; -using System.Windows.Documents; -using System.Windows; - -namespace Microsoft.Windows.Controls.Formatting -{ - internal class FormatToolbarManager - { - RichTextBox _richTextBox; - readonly UIElementAdorner _adorner; - FormatToolbar toolbar; - - bool AdornerIsVisible - { - get { return _adorner.Visibility == Visibility.Visible; } - } - - public FormatToolbarManager(RichTextBox richTextBox) - { - _richTextBox = richTextBox; - _adorner = new UIElementAdorner(richTextBox); - toolbar = new FormatToolbar(richTextBox); - AttachToRichtextBox(); - } - - private void AttachToRichtextBox() - { - _richTextBox.Selection.Changed += Selection_Changed; - } - - void Selection_Changed(object sender, EventArgs e) - { - TextRange selectedText = new TextRange(_richTextBox.Selection.Start, _richTextBox.Selection.End); - if (selectedText.Text.Length > 0) - { - VerifyAdorner(); - } - else - { - HideAdorner(); - } - } - - //TODO: refactor - void VerifyAdorner() - { - VerifyAdornerLayer(); - - Control adorningEditor = toolbar; - _adorner.Child = adorningEditor; - _adorner.Visibility = Visibility.Visible; - - Rect wordBoundary = _richTextBox.Selection.End.GetPositionAtOffset(0, LogicalDirection.Backward).GetCharacterRect(LogicalDirection.Backward); - - double left = wordBoundary.X; - double top = (wordBoundary.Y + wordBoundary.Height) - toolbar.ActualHeight; - - //top boundary - if (top < 0) - { - top = wordBoundary.Y + wordBoundary.Height; - } - - //right boundary - if (left + toolbar.ActualWidth > _richTextBox.ActualWidth - 20) - { - left = left - toolbar.ActualWidth; - top = wordBoundary.Y + wordBoundary.Height + 5; - } - - //bottom boundary - if (top + toolbar.ActualHeight > _richTextBox.ActualHeight - 20) - { - top = wordBoundary.Y - (toolbar.ActualHeight + wordBoundary.Height); - } - - _adorner.SetOffsets(left, top); - } - - /// - /// Ensures that the adorner is in the adorner layer. - /// - /// True if the adorner 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; - } - - void HideAdorner() - { - if (this.AdornerIsVisible) - { - _adorner.Visibility = Visibility.Collapsed; - _adorner.Child = null; - } - } - } -} diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/RichTextBox/FormatToolbar/Images/Bold16.png b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/RichTextBox/FormatToolbar/Images/Bold16.png deleted file mode 100644 index 8fb36a1a..00000000 Binary files a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/RichTextBox/FormatToolbar/Images/Bold16.png and /dev/null differ diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/RichTextBox/FormatToolbar/Images/CenterAlign16.png b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/RichTextBox/FormatToolbar/Images/CenterAlign16.png deleted file mode 100644 index 1030a021..00000000 Binary files a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/RichTextBox/FormatToolbar/Images/CenterAlign16.png and /dev/null differ diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/RichTextBox/FormatToolbar/Images/Italic16.png b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/RichTextBox/FormatToolbar/Images/Italic16.png deleted file mode 100644 index 8259a9e1..00000000 Binary files a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/RichTextBox/FormatToolbar/Images/Italic16.png and /dev/null differ diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/RichTextBox/FormatToolbar/Images/JustifyAlign16.png b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/RichTextBox/FormatToolbar/Images/JustifyAlign16.png deleted file mode 100644 index c5499bce..00000000 Binary files a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/RichTextBox/FormatToolbar/Images/JustifyAlign16.png and /dev/null differ diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/RichTextBox/FormatToolbar/Images/LeftAlign16.png b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/RichTextBox/FormatToolbar/Images/LeftAlign16.png deleted file mode 100644 index 51dffb73..00000000 Binary files a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/RichTextBox/FormatToolbar/Images/LeftAlign16.png and /dev/null differ diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/RichTextBox/FormatToolbar/Images/RightAlign16.png b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/RichTextBox/FormatToolbar/Images/RightAlign16.png deleted file mode 100644 index cb8e400a..00000000 Binary files a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/RichTextBox/FormatToolbar/Images/RightAlign16.png and /dev/null differ diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/RichTextBox/FormatToolbar/Images/Underline16.png b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/RichTextBox/FormatToolbar/Images/Underline16.png deleted file mode 100644 index 72689482..00000000 Binary files a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/RichTextBox/FormatToolbar/Images/Underline16.png and /dev/null differ diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Themes/Aero/Buttons.xaml b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Themes/Aero/Buttons.xaml deleted file mode 100644 index 30d4977f..00000000 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Themes/Aero/Buttons.xaml +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Themes/Common/Generic_Common.xaml b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Themes/Common/Generic_Common.xaml deleted file mode 100644 index cb7d3894..00000000 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Themes/Common/Generic_Common.xaml +++ /dev/null @@ -1,135 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/TokenizedTextBox/Images/delete8.png b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/TokenizedTextBox/Images/delete8.png deleted file mode 100644 index 153a6c82..00000000 Binary files a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/TokenizedTextBox/Images/delete8.png and /dev/null differ diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/TokenizedTextBox/Implementation/Token.cs b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/TokenizedTextBox/Implementation/Token.cs deleted file mode 100644 index ade47fde..00000000 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/TokenizedTextBox/Implementation/Token.cs +++ /dev/null @@ -1,55 +0,0 @@ -/************************************************************************ - - Extended WPF Toolkit - - Copyright (C) 2010-2012 Xceed Software Inc. - - This program is provided to you under the terms of the Microsoft Public - License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license - - This program can be provided to you by Xceed Software Inc. under a - proprietary commercial license agreement for use in non-Open Source - projects. The commercial version of Extended WPF Toolkit also includes - priority technical support, commercial updates, and many additional - useful WPF controls if you license Xceed Business Suite for WPF. - - Visit http://xceed.com and follow @datagrid on Twitter. - - **********************************************************************/ - -using System; - -namespace Xceed.Wpf.Toolkit -{ - internal class Token - { - public string Delimiter - { - get; - private set; - } - public object Item - { - get; - set; - } - - private string _tokenKey; - public string TokenKey - { - get - { - return _tokenKey; - } - set - { - _tokenKey = String.Format( "{0}{1}", value, Delimiter ); - } - } - - public Token( string delimiter ) - { - Delimiter = delimiter; - } - } -} diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/TokenizedTextBox/Implementation/TokenItem.cs b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/TokenizedTextBox/Implementation/TokenItem.cs deleted file mode 100644 index d38202b5..00000000 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/TokenizedTextBox/Implementation/TokenItem.cs +++ /dev/null @@ -1,45 +0,0 @@ -/************************************************************************ - - Extended WPF Toolkit - - Copyright (C) 2010-2012 Xceed Software Inc. - - This program is provided to you under the terms of the Microsoft Public - License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license - - This program can be provided to you by Xceed Software Inc. under a - proprietary commercial license agreement for use in non-Open Source - projects. The commercial version of Extended WPF Toolkit also includes - priority technical support, commercial updates, and many additional - useful WPF controls if you license Xceed Business Suite for WPF. - - Visit http://xceed.com and follow @datagrid on Twitter. - - **********************************************************************/ - -using System.Windows; -using System.Windows.Controls; - -namespace Xceed.Wpf.Toolkit -{ - public class TokenItem : ContentControl - { - static TokenItem() - { - DefaultStyleKeyProperty.OverrideMetadata( typeof( TokenItem ), new FrameworkPropertyMetadata( typeof( TokenItem ) ) ); - } - - public static readonly DependencyProperty TokenKeyProperty = DependencyProperty.Register( "TokenKey", typeof( string ), typeof( TokenItem ), new UIPropertyMetadata( null ) ); - public string TokenKey - { - get - { - return ( string )GetValue( TokenKeyProperty ); - } - set - { - SetValue( TokenKeyProperty, value ); - } - } - } -} diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/TokenizedTextBox/Implementation/TokenizedTextBox.cs b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/TokenizedTextBox/Implementation/TokenizedTextBox.cs deleted file mode 100644 index 9ddd586a..00000000 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/TokenizedTextBox/Implementation/TokenizedTextBox.cs +++ /dev/null @@ -1,394 +0,0 @@ -/************************************************************************ - - Extended WPF Toolkit - - Copyright (C) 2010-2012 Xceed Software Inc. - - This program is provided to you under the terms of the Microsoft Public - License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license - - This program can be provided to you by Xceed Software Inc. under a - proprietary commercial license agreement for use in non-Open Source - projects. The commercial version of Extended WPF Toolkit also includes - priority technical support, commercial updates, and many additional - useful WPF controls if you license Xceed Business Suite for WPF. - - Visit http://xceed.com and follow @datagrid on Twitter. - - **********************************************************************/ - -//Based of the code written by Pavan Podila -//http://blog.pixelingene.com/2010/10/tokenizing-control-convert-text-to-tokens/ - -using System; -using System.Linq; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Documents; -using System.Windows.Input; - -namespace Xceed.Wpf.Toolkit -{ - public class TokenizedTextBox : ItemsControl - { - #region Members - - private System.Windows.Controls.RichTextBox _rtb = null; - private bool _surpressTextChanged = false; - private bool _surpressTextChangedEvent = false; - - #endregion //Members - - #region Properties - - public static readonly DependencyProperty SearchMemberPathProperty = DependencyProperty.Register( "SearchMemberPath", typeof( string ), typeof( TokenizedTextBox ), new UIPropertyMetadata( String.Empty ) ); - public string SearchMemberPath - { - get - { - return ( string )GetValue( SearchMemberPathProperty ); - } - set - { - SetValue( SearchMemberPathProperty, value ); - } - } - - public static readonly DependencyProperty TokenDelimiterProperty = DependencyProperty.Register( "TokenDelimiter", typeof( string ), typeof( TokenizedTextBox ), new UIPropertyMetadata( ";" ) ); - public string TokenDelimiter - { - get - { - return ( string )GetValue( TokenDelimiterProperty ); - } - set - { - SetValue( TokenDelimiterProperty, value ); - } - } - - public static readonly DependencyProperty TokenTemplateProperty = DependencyProperty.Register( "TokenTemplate", typeof( DataTemplate ), typeof( TokenizedTextBox ), new UIPropertyMetadata( null ) ); - public DataTemplate TokenTemplate - { - get - { - return ( DataTemplate )GetValue( TokenTemplateProperty ); - } - set - { - SetValue( TokenTemplateProperty, value ); - } - } - - #region Text - - public static readonly DependencyProperty TextProperty = DependencyProperty.Register( "Text", typeof( string ), typeof( TokenizedTextBox ), new UIPropertyMetadata( null, OnTextChanged ) ); - public string Text - { - get - { - return ( string )GetValue( TextProperty ); - } - set - { - SetValue( TextProperty, value ); - } - } - - private static void OnTextChanged( DependencyObject o, DependencyPropertyChangedEventArgs e ) - { - TokenizedTextBox tokenizedTextBox = o as TokenizedTextBox; - if( tokenizedTextBox != null ) - tokenizedTextBox.OnTextChanged( ( string )e.OldValue, ( string )e.NewValue ); - } - - protected virtual void OnTextChanged( string oldValue, string newValue ) - { - if( _rtb == null || _surpressTextChanged ) - return; - - //TODO: when text changes update tokens - } - - #endregion //Text - - public static readonly DependencyProperty ValueMemberPathProperty = DependencyProperty.Register( "ValueMemberPath", typeof( string ), typeof( TokenizedTextBox ), new UIPropertyMetadata( String.Empty ) ); - public string ValueMemberPath - { - get - { - return ( string )GetValue( ValueMemberPathProperty ); - } - set - { - SetValue( ValueMemberPathProperty, value ); - } - } - - - #endregion //Properties - - #region Constructors - - static TokenizedTextBox() - { - DefaultStyleKeyProperty.OverrideMetadata( typeof( TokenizedTextBox ), new FrameworkPropertyMetadata( typeof( TokenizedTextBox ) ) ); - } - - public TokenizedTextBox() - { - CommandBindings.Add( new CommandBinding( TokenizedTextBoxCommands.Delete, DeleteToken ) ); - } - - #endregion //Constructors - - #region Base Class Overrides - - public override void OnApplyTemplate() - { - base.OnApplyTemplate(); - - if( _rtb != null ) - { - _rtb.TextChanged -= RichTextBox_TextChanged; - _rtb.PreviewKeyDown -= RichTextBox_PreviewKeyDown; - } - _rtb = GetTemplateChild( "PART_ContentHost" ) as System.Windows.Controls.RichTextBox; - if( _rtb != null ) - { - _rtb.TextChanged += RichTextBox_TextChanged; - _rtb.PreviewKeyDown += RichTextBox_PreviewKeyDown; - } - - InitializeTokensFromText(); - } - - #endregion //Base Class Overrides - - #region Event Handlers - - private void RichTextBox_TextChanged( object sender, TextChangedEventArgs e ) - { - if( _surpressTextChangedEvent ) - return; - - var text = _rtb.CaretPosition.GetTextInRun( LogicalDirection.Backward ); - var token = ResolveToken( text ); - if( token != null ) - { - ReplaceTextWithToken( text.Trim(), token ); - } - } - - void RichTextBox_PreviewKeyDown( object sender, KeyEventArgs e ) - { - InlineUIContainer container = null; - - if( e.Key == Key.Back ) - { - container = _rtb.CaretPosition.GetAdjacentElement( LogicalDirection.Backward ) as InlineUIContainer; - } - else if( e.Key == Key.Delete ) - { - //if the selected text is a blank space, I will assume that a token item is selected. - //if a token item is selected, we need to move the caret position to the left of the element so we can grab the InlineUIContainer - if( _rtb.Selection.Text == " " ) - { - TextPointer moveTo = _rtb.CaretPosition.GetNextInsertionPosition( LogicalDirection.Backward ); - _rtb.CaretPosition = moveTo; - } - - //the cursor is to the left of a token item - container = _rtb.CaretPosition.GetAdjacentElement( LogicalDirection.Forward ) as InlineUIContainer; - } - - //if the container is not null that means we have something to delete - if( container != null ) - { - var token = ( container as InlineUIContainer ).Child as TokenItem; - if( token != null ) - { - SetTextInternal( Text.Replace( token.TokenKey, "" ) ); - } - } - } - - #endregion //Event Handlers - - #region Methods - - private void InitializeTokensFromText() - { - if( !String.IsNullOrEmpty( Text ) ) - { - string[] tokenKeys = Text.Split( new string[] { TokenDelimiter }, StringSplitOptions.RemoveEmptyEntries ); - foreach( string tokenKey in tokenKeys ) - { - var para = _rtb.CaretPosition.Paragraph; - var token = new Token( TokenDelimiter ) - { - TokenKey = tokenKey, - Item = ResolveItemByTokenKey( tokenKey ) - }; - para.Inlines.Add( CreateTokenContainer( token ) ); - } - } - } - - private Token ResolveToken( string text ) - { - if( text.EndsWith( TokenDelimiter ) ) - return ResolveTokenBySearchMemberPath( text.Substring( 0, text.Length - 1 ).Trim() ); - - return null; - } - - private Token ResolveTokenBySearchMemberPath( string searchText ) - { - //create a new token and default the settings to the search text - var token = new Token( TokenDelimiter ) - { - TokenKey = searchText, - Item = searchText - }; - - if( ItemsSource != null ) - { - foreach( object item in ItemsSource ) - { - var searchProperty = item.GetType().GetProperty( SearchMemberPath ); - if( searchProperty != null ) - { - var searchValue = searchProperty.GetValue( item, null ); - if( searchText.Equals( searchValue.ToString(), StringComparison.InvariantCultureIgnoreCase ) ) - { - var valueProperty = item.GetType().GetProperty( ValueMemberPath ); - if( valueProperty != null ) - token.TokenKey = valueProperty.GetValue( item, null ).ToString(); - - token.Item = item; - break; - } - } - } - } - - return token; - } - - private object ResolveItemByTokenKey( string tokenKey ) - { - if( ItemsSource != null ) - { - foreach( object item in ItemsSource ) - { - var property = item.GetType().GetProperty( ValueMemberPath ); - if( property != null ) - { - var value = property.GetValue( item, null ); - if( tokenKey.Equals( value.ToString(), StringComparison.InvariantCultureIgnoreCase ) ) - return item; - } - } - } - - return tokenKey; - } - - private void ReplaceTextWithToken( string inputText, Token token ) - { - _surpressTextChangedEvent = true; - - var para = _rtb.CaretPosition.Paragraph; - - var matchedRun = para.Inlines.FirstOrDefault( inline => - { - var run = inline as Run; - return ( run != null && run.Text.EndsWith( inputText ) ); - } ) as Run; - - if( matchedRun != null ) // Found a Run that matched the inputText - { - var tokenContainer = CreateTokenContainer( token ); - para.Inlines.InsertBefore( matchedRun, tokenContainer ); - - // Remove only if the Text in the Run is the same as inputText, else split up - if( matchedRun.Text == inputText ) - { - para.Inlines.Remove( matchedRun ); - } - else // Split up - { - var index = matchedRun.Text.IndexOf( inputText ) + inputText.Length; - var tailEnd = new Run( matchedRun.Text.Substring( index ) ); - para.Inlines.InsertAfter( matchedRun, tailEnd ); - para.Inlines.Remove( matchedRun ); - } - - //now append the Text with the token key - SetTextInternal( Text + token.TokenKey ); - } - - _surpressTextChangedEvent = false; - } - - private InlineUIContainer CreateTokenContainer( Token token ) - { - return new InlineUIContainer( CreateTokenItem( token ) ) - { - BaselineAlignment = BaselineAlignment.Center - }; - } - - private TokenItem CreateTokenItem( Token token ) - { - object item = token.Item; - - var tokenItem = new TokenItem() - { - TokenKey = token.TokenKey, - Content = item, - ContentTemplate = TokenTemplate - }; - - if( TokenTemplate == null ) - { - //if no template was supplied let's try to get a value from the object using the DisplayMemberPath - if( !String.IsNullOrEmpty( DisplayMemberPath ) ) - { - var property = item.GetType().GetProperty( DisplayMemberPath ); - if( property != null ) - { - var value = property.GetValue( item, null ); - if( value != null ) - tokenItem.Content = value; - } - } - } - - return tokenItem; - } - - private void DeleteToken( object sender, ExecutedRoutedEventArgs e ) - { - var para = _rtb.CaretPosition.Paragraph; - - Inline inlineToRemove = para.Inlines.Where( inline => inline is InlineUIContainer && ( ( inline as InlineUIContainer ).Child as TokenItem ).TokenKey.Equals( e.Parameter ) ).FirstOrDefault(); - - if( inlineToRemove != null ) - para.Inlines.Remove( inlineToRemove ); - - //update Text to remove delimited value - SetTextInternal( Text.Replace( e.Parameter.ToString(), "" ) ); - } - - private void SetTextInternal( string text ) - { - _surpressTextChanged = true; - Text = text; - _surpressTextChanged = false; - } - - #endregion //Methods - } -} \ No newline at end of file diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/TokenizedTextBox/Implementation/TokenizedTextBoxCommands.cs b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/TokenizedTextBox/Implementation/TokenizedTextBoxCommands.cs deleted file mode 100644 index a6c4a5a4..00000000 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/TokenizedTextBox/Implementation/TokenizedTextBoxCommands.cs +++ /dev/null @@ -1,36 +0,0 @@ -/************************************************************************ - - Extended WPF Toolkit - - Copyright (C) 2010-2012 Xceed Software Inc. - - This program is provided to you under the terms of the Microsoft Public - License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license - - This program can be provided to you by Xceed Software Inc. under a - proprietary commercial license agreement for use in non-Open Source - projects. The commercial version of Extended WPF Toolkit also includes - priority technical support, commercial updates, and many additional - useful WPF controls if you license Xceed Business Suite for WPF. - - Visit http://xceed.com and follow @datagrid on Twitter. - - **********************************************************************/ - -using System.Windows.Input; - -namespace Xceed.Wpf.Toolkit -{ - public static class TokenizedTextBoxCommands - { - private static RoutedCommand _deleteCommand = new RoutedCommand(); - - public static RoutedCommand Delete - { - get - { - return _deleteCommand; - } - } - } -} diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/TokenizedTextBox/Themes/Generic.xaml b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/TokenizedTextBox/Themes/Generic.xaml deleted file mode 100644 index 1270e6d1..00000000 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/TokenizedTextBox/Themes/Generic.xaml +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/WPFToolkit.Extended.csproj.vspscc b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/WPFToolkit.Extended.csproj.vspscc deleted file mode 100644 index feffdeca..00000000 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/WPFToolkit.Extended.csproj.vspscc +++ /dev/null @@ -1,10 +0,0 @@ -"" -{ -"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/Src/WPFToolkit.Extended/sn.pfx b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/sn.pfx deleted file mode 100644 index 0f441ed9..00000000 Binary files a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/sn.pfx and /dev/null differ diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock.Themes.Aero/AssemblyVersionInfo.cs b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock.Themes.Aero/AssemblyVersionInfo.cs index d3cc2ce9..d0386451 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock.Themes.Aero/AssemblyVersionInfo.cs +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock.Themes.Aero/AssemblyVersionInfo.cs @@ -21,7 +21,7 @@ internal static class _XceedVersionInfo { [System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )] - public const string BaseVersion = "3.0"; + public const string BaseVersion = "3.1"; [System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )] public const string Version = BaseVersion + ".0.0"; diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock.Themes.Aero/Theme.xaml b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock.Themes.Aero/Theme.xaml index fa0eaae1..6a38a1ff 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock.Themes.Aero/Theme.xaml +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock.Themes.Aero/Theme.xaml @@ -1334,7 +1334,7 @@ - + diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock.Themes.Metro/AssemblyVersionInfo.cs b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock.Themes.Metro/AssemblyVersionInfo.cs index d3cc2ce9..d0386451 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock.Themes.Metro/AssemblyVersionInfo.cs +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock.Themes.Metro/AssemblyVersionInfo.cs @@ -21,7 +21,7 @@ internal static class _XceedVersionInfo { [System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )] - public const string BaseVersion = "3.0"; + public const string BaseVersion = "3.1"; [System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )] public const string Version = BaseVersion + ".0.0"; diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock.Themes.Metro/Theme.xaml b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock.Themes.Metro/Theme.xaml index 12f9b5aa..769140f8 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock.Themes.Metro/Theme.xaml +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock.Themes.Metro/Theme.xaml @@ -1360,20 +1360,20 @@ - + diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock.Themes.VS2010/AssemblyVersionInfo.cs b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock.Themes.VS2010/AssemblyVersionInfo.cs index d3cc2ce9..d0386451 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock.Themes.VS2010/AssemblyVersionInfo.cs +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock.Themes.VS2010/AssemblyVersionInfo.cs @@ -21,7 +21,7 @@ internal static class _XceedVersionInfo { [System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )] - public const string BaseVersion = "3.0"; + public const string BaseVersion = "3.1"; [System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )] public const string Version = BaseVersion + ".0.0"; diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock.Themes.VS2010/Theme.xaml b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock.Themes.VS2010/Theme.xaml index d667455c..a82fec6d 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock.Themes.VS2010/Theme.xaml +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock.Themes.VS2010/Theme.xaml @@ -1445,7 +1445,7 @@ - + diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/AssemblyVersionInfo.cs b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/AssemblyVersionInfo.cs index d3cc2ce9..d0386451 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/AssemblyVersionInfo.cs +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/AssemblyVersionInfo.cs @@ -21,7 +21,7 @@ internal static class _XceedVersionInfo { [System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )] - public const string BaseVersion = "3.0"; + public const string BaseVersion = "3.1"; [System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )] public const string Version = BaseVersion + ".0.0"; diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutAnchorableFloatingWindowControl.cs b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutAnchorableFloatingWindowControl.cs index 4545a0db..4dee8d5c 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutAnchorableFloatingWindowControl.cs +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutAnchorableFloatingWindowControl.cs @@ -34,320 +34,333 @@ using Microsoft.Windows.Shell; namespace Xceed.Wpf.AvalonDock.Controls { - public class LayoutAnchorableFloatingWindowControl : LayoutFloatingWindowControl, IOverlayWindowHost + public class LayoutAnchorableFloatingWindowControl : LayoutFloatingWindowControl, IOverlayWindowHost + { + static LayoutAnchorableFloatingWindowControl() { - static LayoutAnchorableFloatingWindowControl() - { - DefaultStyleKeyProperty.OverrideMetadata(typeof(LayoutAnchorableFloatingWindowControl), new FrameworkPropertyMetadata(typeof(LayoutAnchorableFloatingWindowControl))); - } + DefaultStyleKeyProperty.OverrideMetadata( typeof( LayoutAnchorableFloatingWindowControl ), new FrameworkPropertyMetadata( typeof( LayoutAnchorableFloatingWindowControl ) ) ); + } - internal LayoutAnchorableFloatingWindowControl(LayoutAnchorableFloatingWindow model) - :base(model) - { - _model = model; - HideWindowCommand = new RelayCommand((p) => OnExecuteHideWindowCommand(p), (p) => CanExecuteHideWindowCommand(p)); - } + internal LayoutAnchorableFloatingWindowControl( LayoutAnchorableFloatingWindow model ) + : base( model ) + { + _model = model; + HideWindowCommand = new RelayCommand( ( p ) => OnExecuteHideWindowCommand( p ), ( p ) => CanExecuteHideWindowCommand( p ) ); + UpdateThemeResources(); + } - internal override void UpdateThemeResources( Xceed.Wpf.AvalonDock.Themes.Theme oldTheme = null ) - { - base.UpdateThemeResources(oldTheme); + internal override void UpdateThemeResources( Xceed.Wpf.AvalonDock.Themes.Theme oldTheme = null ) + { + base.UpdateThemeResources( oldTheme ); - if (_overlayWindow != null) - _overlayWindow.UpdateThemeResources(oldTheme); - } + if( _overlayWindow != null ) + _overlayWindow.UpdateThemeResources( oldTheme ); + } - LayoutAnchorableFloatingWindow _model; + LayoutAnchorableFloatingWindow _model; - public override ILayoutElement Model - { - get { return _model; } - } + public override ILayoutElement Model + { + get + { + return _model; + } + } - #region SingleContentLayoutItem - - /// - /// SingleContentLayoutItem Dependency Property - /// - public static readonly DependencyProperty SingleContentLayoutItemProperty = - DependencyProperty.Register("SingleContentLayoutItem", typeof(LayoutItem), typeof(LayoutAnchorableFloatingWindowControl), - new FrameworkPropertyMetadata((LayoutItem)null, - new PropertyChangedCallback(OnSingleContentLayoutItemChanged))); - - /// - /// Gets or sets the SingleContentLayoutItem property. This dependency property - /// indicates the layout item of the selected content when is shown a single anchorable pane. - /// - public LayoutItem SingleContentLayoutItem - { - get { return (LayoutItem)GetValue(SingleContentLayoutItemProperty); } - set { SetValue(SingleContentLayoutItemProperty, value); } - } + #region SingleContentLayoutItem + + /// + /// SingleContentLayoutItem Dependency Property + /// + public static readonly DependencyProperty SingleContentLayoutItemProperty = + DependencyProperty.Register( "SingleContentLayoutItem", typeof( LayoutItem ), typeof( LayoutAnchorableFloatingWindowControl ), + new FrameworkPropertyMetadata( ( LayoutItem )null, + new PropertyChangedCallback( OnSingleContentLayoutItemChanged ) ) ); + + /// + /// Gets or sets the SingleContentLayoutItem property. This dependency property + /// indicates the layout item of the selected content when is shown a single anchorable pane. + /// + public LayoutItem SingleContentLayoutItem + { + get + { + return ( LayoutItem )GetValue( SingleContentLayoutItemProperty ); + } + set + { + SetValue( SingleContentLayoutItemProperty, value ); + } + } + + /// + /// Handles changes to the SingleContentLayoutItem property. + /// + private static void OnSingleContentLayoutItemChanged( DependencyObject d, DependencyPropertyChangedEventArgs e ) + { + ( ( LayoutAnchorableFloatingWindowControl )d ).OnSingleContentLayoutItemChanged( e ); + } + + /// + /// Provides derived classes an opportunity to handle changes to the SingleContentLayoutItem property. + /// + protected virtual void OnSingleContentLayoutItemChanged( DependencyPropertyChangedEventArgs e ) + { + } + + #endregion - /// - /// Handles changes to the SingleContentLayoutItem property. - /// - private static void OnSingleContentLayoutItemChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - ((LayoutAnchorableFloatingWindowControl)d).OnSingleContentLayoutItemChanged(e); - } - /// - /// Provides derived classes an opportunity to handle changes to the SingleContentLayoutItem property. - /// - protected virtual void OnSingleContentLayoutItemChanged(DependencyPropertyChangedEventArgs e) - { - } - #endregion + protected override void OnInitialized( EventArgs e ) + { + base.OnInitialized( e ); + + var manager = _model.Root.Manager; + Content = manager.CreateUIElementForModel( _model.RootPanel ); + //SetBinding(VisibilityProperty, new Binding("IsVisible") { Source = _model, Converter = new BoolToVisibilityConverter(), Mode = BindingMode.OneWay, ConverterParameter = Visibility.Hidden }); - protected override void OnInitialized(EventArgs e) + //Issue: http://avalondock.codeplex.com/workitem/15036 + IsVisibleChanged += ( s, args ) => + { + var visibilityBinding = GetBindingExpression( VisibilityProperty ); + if( IsVisible && ( visibilityBinding == null ) ) { - base.OnInitialized(e); + SetBinding( VisibilityProperty, new Binding( "IsVisible" ) { Source = _model, Converter = new BoolToVisibilityConverter(), Mode = BindingMode.OneWay, ConverterParameter = Visibility.Hidden } ); + } + }; - var manager = _model.Root.Manager; + SetBinding( SingleContentLayoutItemProperty, new Binding( "Model.SinglePane.SelectedContent" ) { Source = this, Converter = new LayoutItemFromLayoutModelConverter() } ); - Content = manager.CreateUIElementForModel(_model.RootPanel); + _model.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler( _model_PropertyChanged ); + } - //SetBinding(VisibilityProperty, new Binding("IsVisible") { Source = _model, Converter = new BoolToVisibilityConverter(), Mode = BindingMode.OneWay, ConverterParameter = Visibility.Hidden }); - //Issue: http://avalondock.codeplex.com/workitem/15036 - IsVisibleChanged += (s, args) => - { - var visibilityBinding = GetBindingExpression(VisibilityProperty); - if (IsVisible && (visibilityBinding == null)) - { - SetBinding(VisibilityProperty, new Binding("IsVisible") { Source = _model, Converter = new BoolToVisibilityConverter(), Mode = BindingMode.OneWay, ConverterParameter = Visibility.Hidden }); - } - }; + void _model_PropertyChanged( object sender, System.ComponentModel.PropertyChangedEventArgs e ) + { + if( e.PropertyName == "RootPanel" && + _model.RootPanel == null ) + { + InternalClose(); + } + } - SetBinding(SingleContentLayoutItemProperty, new Binding("Model.SinglePane.SelectedContent") { Source = this, Converter = new LayoutItemFromLayoutModelConverter() }); - _model.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(_model_PropertyChanged); - } + bool IOverlayWindowHost.HitTest( Point dragPoint ) + { + Rect detectionRect = new Rect( this.PointToScreenDPIWithoutFlowDirection( new Point() ), this.TransformActualSizeToAncestor() ); + return detectionRect.Contains( dragPoint ); + } + DockingManager IOverlayWindowHost.Manager + { + get + { + return _model.Root.Manager; + } + } - void _model_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) - { - if (e.PropertyName == "RootPanel" && - _model.RootPanel == null) - { - InternalClose(); - } - } + OverlayWindow _overlayWindow = null; + void CreateOverlayWindow() + { + if( _overlayWindow == null ) + _overlayWindow = new OverlayWindow( this ); + Rect rectWindow = new Rect( this.PointToScreenDPIWithoutFlowDirection( new Point() ), this.TransformActualSizeToAncestor() ); + _overlayWindow.Left = rectWindow.Left; + _overlayWindow.Top = rectWindow.Top; + _overlayWindow.Width = rectWindow.Width; + _overlayWindow.Height = rectWindow.Height; + } + IOverlayWindow IOverlayWindowHost.ShowOverlayWindow( LayoutFloatingWindowControl draggingWindow ) + { + CreateOverlayWindow(); + _overlayWindow.Owner = draggingWindow; + _overlayWindow.EnableDropTargets(); + _overlayWindow.Show(); - bool IOverlayWindowHost.HitTest(Point dragPoint) - { - Rect detectionRect = new Rect(this.PointToScreenDPIWithoutFlowDirection(new Point()), this.TransformActualSizeToAncestor()); - return detectionRect.Contains(dragPoint); - } + return _overlayWindow; + } - DockingManager IOverlayWindowHost.Manager - { - get { return _model.Root.Manager; } - } + void IOverlayWindowHost.HideOverlayWindow() + { + _dropAreas = null; + _overlayWindow.Owner = null; + _overlayWindow.HideDropTargets(); + } - OverlayWindow _overlayWindow = null; - void CreateOverlayWindow() - { - if (_overlayWindow == null) - _overlayWindow = new OverlayWindow(this); - Rect rectWindow = new Rect(this.PointToScreenDPIWithoutFlowDirection(new Point()), this.TransformActualSizeToAncestor()); - _overlayWindow.Left = rectWindow.Left; - _overlayWindow.Top = rectWindow.Top; - _overlayWindow.Width = rectWindow.Width; - _overlayWindow.Height = rectWindow.Height; - } + List _dropAreas = null; + IEnumerable IOverlayWindowHost.GetDropAreas( LayoutFloatingWindowControl draggingWindow ) + { + if( _dropAreas != null ) + return _dropAreas; + + _dropAreas = new List(); + + if( draggingWindow.Model is LayoutDocumentFloatingWindow ) + return _dropAreas; + + var rootVisual = ( Content as FloatingWindowContentHost ).RootVisual; + + foreach( var areaHost in rootVisual.FindVisualChildren() ) + { + _dropAreas.Add( new DropArea( + areaHost, + DropAreaType.AnchorablePane ) ); + } + foreach( var areaHost in rootVisual.FindVisualChildren() ) + { + _dropAreas.Add( new DropArea( + areaHost, + DropAreaType.DocumentPane ) ); + } + + return _dropAreas; + } - IOverlayWindow IOverlayWindowHost.ShowOverlayWindow(LayoutFloatingWindowControl draggingWindow) - { - CreateOverlayWindow(); - _overlayWindow.Owner = draggingWindow; - _overlayWindow.EnableDropTargets(); - _overlayWindow.Show(); + protected override void OnClosed( EventArgs e ) + { + var root = Model.Root; + root.Manager.RemoveFloatingWindow( this ); + root.CollectGarbage(); + if( _overlayWindow != null ) + { + _overlayWindow.Close(); + _overlayWindow = null; + } + + base.OnClosed( e ); + + if( !CloseInitiatedByUser ) + { + root.FloatingWindows.Remove( _model ); + } + + _model.PropertyChanged -= new System.ComponentModel.PropertyChangedEventHandler( _model_PropertyChanged ); + } - return _overlayWindow; - } + protected override void OnClosing( System.ComponentModel.CancelEventArgs e ) + { + if( CloseInitiatedByUser && !KeepContentVisibleOnClose ) + { + e.Cancel = true; + _model.Descendents().OfType().ToArray().ForEach( ( a ) => a.Hide() ); + } - void IOverlayWindowHost.HideOverlayWindow() - { - _dropAreas = null; - _overlayWindow.Owner = null; - _overlayWindow.HideDropTargets(); - } + base.OnClosing( e ); + } - List _dropAreas = null; - IEnumerable IOverlayWindowHost.GetDropAreas(LayoutFloatingWindowControl draggingWindow) - { - if (_dropAreas != null) - return _dropAreas; - - _dropAreas = new List(); - - if (draggingWindow.Model is LayoutDocumentFloatingWindow) - return _dropAreas; - - var rootVisual = (Content as FloatingWindowContentHost).RootVisual; - - foreach (var areaHost in rootVisual.FindVisualChildren()) - { - _dropAreas.Add(new DropArea( - areaHost, - DropAreaType.AnchorablePane)); - } - foreach (var areaHost in rootVisual.FindVisualChildren()) - { - _dropAreas.Add(new DropArea( - areaHost, - DropAreaType.DocumentPane)); - } - - return _dropAreas; - } + protected override IntPtr FilterMessage( IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled ) + { + switch( msg ) + { + case Win32Helper.WM_NCLBUTTONDOWN: //Left button down on title -> start dragging over docking manager + if( wParam.ToInt32() == Win32Helper.HT_CAPTION ) + { + _model.Descendents().OfType().First( p => p.ChildrenCount > 0 && p.SelectedContent != null ).SelectedContent.IsActive = true; + handled = true; + } + break; + case Win32Helper.WM_NCRBUTTONUP: + if( wParam.ToInt32() == Win32Helper.HT_CAPTION ) + { + if( OpenContextMenu() ) + handled = true; + + if( _model.Root.Manager.ShowSystemMenu ) + WindowChrome.GetWindowChrome( this ).ShowSystemMenu = !handled; + else + WindowChrome.GetWindowChrome( this ).ShowSystemMenu = false; + } + break; + + } + + return base.FilterMessage( hwnd, msg, wParam, lParam, ref handled ); + } - protected override void OnClosed(EventArgs e) - { - var root = Model.Root; - root.Manager.RemoveFloatingWindow(this); - root.CollectGarbage(); - if (_overlayWindow != null) - { - _overlayWindow.Close(); - _overlayWindow = null; - } - - base.OnClosed(e); - - if (!CloseInitiatedByUser) - { - root.FloatingWindows.Remove(_model); - } - - _model.PropertyChanged -= new System.ComponentModel.PropertyChangedEventHandler(_model_PropertyChanged); - } + bool OpenContextMenu() + { + var ctxMenu = _model.Root.Manager.AnchorableContextMenu; + if( ctxMenu != null && SingleContentLayoutItem != null ) + { + ctxMenu.PlacementTarget = null; + ctxMenu.Placement = PlacementMode.MousePoint; + ctxMenu.DataContext = SingleContentLayoutItem; + ctxMenu.IsOpen = true; + return true; + } + + return false; + } - protected override void OnClosing(System.ComponentModel.CancelEventArgs e) - { - if (CloseInitiatedByUser && !KeepContentVisibleOnClose) - { - e.Cancel = true; - _model.Descendents().OfType().ToArray().ForEach((a) => a.Hide()); - } + bool IsContextMenuOpen() + { + var ctxMenu = _model.Root.Manager.AnchorableContextMenu; + if( ctxMenu != null && SingleContentLayoutItem != null ) + { + return ctxMenu.IsOpen; + } - base.OnClosing(e); - } + return false; + } - protected override IntPtr FilterMessage(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled) - { - switch (msg) - { - case Win32Helper.WM_NCLBUTTONDOWN: //Left button down on title -> start dragging over docking manager - if (wParam.ToInt32() == Win32Helper.HT_CAPTION) - { - _model.Descendents().OfType().First(p => p.ChildrenCount > 0 && p.SelectedContent != null).SelectedContent.IsActive = true; - handled = true; - } - break; - case Win32Helper.WM_NCRBUTTONUP: - if (wParam.ToInt32() == Win32Helper.HT_CAPTION) - { - if (OpenContextMenu()) - handled = true; - - if (_model.Root.Manager.ShowSystemMenu) - WindowChrome.GetWindowChrome(this).ShowSystemMenu = !handled; - else - WindowChrome.GetWindowChrome(this).ShowSystemMenu = false; - } - break; - - } - - return base.FilterMessage(hwnd, msg, wParam, lParam, ref handled); - } + #region HideWindowCommand + public ICommand HideWindowCommand + { + get; + private set; + } - bool OpenContextMenu() - { - var ctxMenu = _model.Root.Manager.AnchorableContextMenu; - if (ctxMenu != null && SingleContentLayoutItem != null) - { - ctxMenu.PlacementTarget = null; - ctxMenu.Placement = PlacementMode.MousePoint; - ctxMenu.DataContext = SingleContentLayoutItem; - ctxMenu.IsOpen = true; - return true; - } - - return false; - } + private bool CanExecuteHideWindowCommand( object parameter ) + { + if( Model == null ) + return false; - bool IsContextMenuOpen() - { - var ctxMenu = _model.Root.Manager.AnchorableContextMenu; - if (ctxMenu != null && SingleContentLayoutItem != null) - { - return ctxMenu.IsOpen; - } + var root = Model.Root; + if( root == null ) + return false; - return false; - } + var manager = root.Manager; + if( manager == null ) + return false; - #region HideWindowCommand - public ICommand HideWindowCommand + bool canExecute = false; + foreach( var anchorable in this.Model.Descendents().OfType().ToArray() ) + { + if( !anchorable.CanHide ) { - get; - private set; + canExecute = false; + break; } - private bool CanExecuteHideWindowCommand(object parameter) + var anchorableLayoutItem = manager.GetLayoutItemFromModel( anchorable ) as LayoutAnchorableItem; + if( anchorableLayoutItem == null || + anchorableLayoutItem.HideCommand == null || + !anchorableLayoutItem.HideCommand.CanExecute( parameter ) ) { - if (Model == null) - return false; - - var root = Model.Root; - if (root == null) - return false; - - var manager = root.Manager; - if (manager == null) - return false; - - bool canExecute = false; - foreach (var anchorable in this.Model.Descendents().OfType().ToArray()) - { - if (!anchorable.CanHide) - { - canExecute = false; - break; - } - - var anchorableLayoutItem = manager.GetLayoutItemFromModel(anchorable) as LayoutAnchorableItem; - if (anchorableLayoutItem == null || - anchorableLayoutItem.HideCommand == null || - !anchorableLayoutItem.HideCommand.CanExecute(parameter)) - { - canExecute = false; - break; - } - - canExecute = true; - } - - return canExecute; + canExecute = false; + break; } - private void OnExecuteHideWindowCommand(object parameter) - { - var manager = Model.Root.Manager; - foreach (var anchorable in this.Model.Descendents().OfType().ToArray()) - { - var anchorableLayoutItem = manager.GetLayoutItemFromModel(anchorable) as LayoutAnchorableItem; - anchorableLayoutItem.HideCommand.Execute(parameter); - } - } - #endregion + canExecute = true; + } + + return canExecute; + } + + private void OnExecuteHideWindowCommand( object parameter ) + { + var manager = Model.Root.Manager; + foreach( var anchorable in this.Model.Descendents().OfType().ToArray() ) + { + var anchorableLayoutItem = manager.GetLayoutItemFromModel( anchorable ) as LayoutAnchorableItem; + anchorableLayoutItem.HideCommand.Execute( parameter ); + } } + #endregion + } } diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutAutoHideWindowControl.cs b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutAutoHideWindowControl.cs index 7bb1ebe7..5310d66f 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutAutoHideWindowControl.cs +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutAutoHideWindowControl.cs @@ -99,7 +99,7 @@ namespace Xceed.Wpf.AvalonDock.Controls Height = 0, }); - _internalHost_ContentRendered = false; + //_internalHost_ContentRendered = false; _internalHwndSource.ContentRendered += _internalHwndSource_ContentRendered; _internalHwndSource.RootVisual = _internalHostPresenter; AddLogicalChild(_internalHostPresenter); @@ -107,22 +107,23 @@ namespace Xceed.Wpf.AvalonDock.Controls return new HandleRef(this, _internalHwndSource.Handle); } - private bool _internalHost_ContentRendered = false; + // private bool _internalHost_ContentRendered = false; void _internalHwndSource_ContentRendered(object sender, EventArgs e) { - _internalHost_ContentRendered = true; + // _internalHost_ContentRendered = true; } - protected override IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled) - { - if (msg == Win32Helper.WM_WINDOWPOSCHANGING) - { - if (_internalHost_ContentRendered) - Win32Helper.SetWindowPos(_internalHwndSource.Handle, Win32Helper.HWND_TOP, 0, 0, 0, 0, Win32Helper.SetWindowPosFlags.IgnoreMove | Win32Helper.SetWindowPosFlags.IgnoreResize); - } - return base.WndProc(hwnd, msg, wParam, lParam, ref handled); - } + + //protected override IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled) + //{ + // if (msg == Win32Helper.WM_WINDOWPOSCHANGING) + // { + // if (_internalHost_ContentRendered) + // Win32Helper.SetWindowPos(_internalHwndSource.Handle, Win32Helper.HWND_TOP, 0, 0, 0, 0, Win32Helper.SetWindowPosFlags.IgnoreMove | Win32Helper.SetWindowPosFlags.IgnoreResize); + // } + // return base.WndProc(hwnd, msg, wParam, lParam, ref handled); + //} protected override void DestroyWindowCore(System.Runtime.InteropServices.HandleRef hwnd) { diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutDocumentControl.cs b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutDocumentControl.cs index dbc03d68..d7edb46a 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutDocumentControl.cs +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutDocumentControl.cs @@ -14,143 +14,158 @@ ***********************************************************************************/ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; +using System.ComponentModel; 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; using Xceed.Wpf.AvalonDock.Layout; namespace Xceed.Wpf.AvalonDock.Controls { - public class LayoutDocumentControl : Control + public class LayoutDocumentControl : Control + { + static LayoutDocumentControl() { - static LayoutDocumentControl() - { - DefaultStyleKeyProperty.OverrideMetadata(typeof(LayoutDocumentControl), new FrameworkPropertyMetadata(typeof(LayoutDocumentControl))); - FocusableProperty.OverrideMetadata(typeof(LayoutDocumentControl), new FrameworkPropertyMetadata(false)); - } - - public LayoutDocumentControl() - { - //SetBinding(FlowDirectionProperty, new Binding("Model.Root.Manager.FlowDirection") { Source = this }); - } - - - #region Model - - /// - /// Model Dependency Property - /// - public static readonly DependencyProperty ModelProperty = - DependencyProperty.Register("Model", typeof(LayoutContent), typeof(LayoutDocumentControl), - new FrameworkPropertyMetadata((LayoutContent)null, - new PropertyChangedCallback(OnModelChanged))); - - /// - /// Gets or sets the Model property. This dependency property - /// indicates the model attached to this view. - /// - public LayoutContent Model - { - get { return (LayoutContent)GetValue(ModelProperty); } - set { SetValue(ModelProperty, value); } - } + DefaultStyleKeyProperty.OverrideMetadata( typeof( LayoutDocumentControl ), new FrameworkPropertyMetadata( typeof( LayoutDocumentControl ) ) ); + FocusableProperty.OverrideMetadata( typeof( LayoutDocumentControl ), new FrameworkPropertyMetadata( true ) ); + } - /// - /// Handles changes to the Model property. - /// - private static void OnModelChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - ((LayoutDocumentControl)d).OnModelChanged(e); - } + #region Model + + /// + /// Model Dependency Property + /// + public static readonly DependencyProperty ModelProperty = DependencyProperty.Register( "Model", + typeof( LayoutContent ), + typeof( LayoutDocumentControl ), + new FrameworkPropertyMetadata( null, OnModelChanged ) ); + + /// + /// Gets or sets the Model property. This dependency property + /// indicates the model attached to this view. + /// + public LayoutContent Model + { + get + { + return ( LayoutContent )GetValue( ModelProperty ); + } + set + { + SetValue( ModelProperty, value ); + } + } - /// - /// Provides derived classes an opportunity to handle changes to the Model property. - /// - protected virtual void OnModelChanged(DependencyPropertyChangedEventArgs e) - { - if( e.OldValue != null ) - { - ((LayoutContent)e.OldValue).PropertyChanged -= Model_PropertyChanged; - } + /// + /// Handles changes to the Model property. + /// + private static void OnModelChanged( DependencyObject d, DependencyPropertyChangedEventArgs e ) + { + ( ( LayoutDocumentControl )d ).OnModelChanged( e ); + } - if( Model != null ) - { - Model.PropertyChanged += Model_PropertyChanged; - SetLayoutItem( Model.Root.Manager.GetLayoutItemFromModel( Model ) ); - } - else - SetLayoutItem( null ); - } + /// + /// Provides derived classes an opportunity to handle changes to the Model property. + /// + protected virtual void OnModelChanged( DependencyPropertyChangedEventArgs e ) + { + if( e.OldValue != null ) + { + ( ( LayoutContent )e.OldValue ).PropertyChanged -= Model_PropertyChanged; + } + + if( Model != null ) + { + Model.PropertyChanged += Model_PropertyChanged; + SetLayoutItem( Model.Root.Manager.GetLayoutItemFromModel( Model ) ); + } + else + { + SetLayoutItem( null ); + } + } - private void Model_PropertyChanged( object sender, System.ComponentModel.PropertyChangedEventArgs e ) + private void Model_PropertyChanged( object sender, PropertyChangedEventArgs e ) + { + if( e.PropertyName == "IsEnabled" ) + { + if( Model != null ) { - if( e.PropertyName == "IsEnabled" ) + IsEnabled = Model.IsEnabled; + if( !IsEnabled && Model.IsActive ) { - if( Model != null ) + if( ( Model.Parent != null ) && ( Model.Parent is LayoutDocumentPane ) ) { - IsEnabled = Model.IsEnabled; - if( !IsEnabled && Model.IsActive ) - { - if( (Model.Parent != null) && (Model.Parent is LayoutDocumentPane) ) - { - ((LayoutDocumentPane)Model.Parent).SetNextSelectedIndex(); - } - } + ( ( LayoutDocumentPane )Model.Parent ).SetNextSelectedIndex(); } } } - #endregion + } + } - #region LayoutItem + #endregion - /// - /// LayoutItem Read-Only Dependency Property - /// - private static readonly DependencyPropertyKey LayoutItemPropertyKey - = DependencyProperty.RegisterReadOnly("LayoutItem", typeof(LayoutItem), typeof(LayoutDocumentControl), - new FrameworkPropertyMetadata((LayoutItem)null)); + #region LayoutItem - public static readonly DependencyProperty LayoutItemProperty - = LayoutItemPropertyKey.DependencyProperty; + /// + /// LayoutItem Read-Only Dependency Property + /// + private static readonly DependencyPropertyKey LayoutItemPropertyKey = DependencyProperty.RegisterReadOnly( "LayoutItem", + typeof( LayoutItem ), + typeof( LayoutDocumentControl ), + new FrameworkPropertyMetadata( + ( LayoutItem )null ) ); - /// - /// Gets the LayoutItem property. This dependency property - /// indicates the LayoutItem attached to this tag item. - /// - public LayoutItem LayoutItem - { - get { return (LayoutItem)GetValue(LayoutItemProperty); } - } + public static readonly DependencyProperty LayoutItemProperty = LayoutItemPropertyKey.DependencyProperty; - /// - /// Provides a secure method for setting the LayoutItem property. - /// This dependency property indicates the LayoutItem attached to this tag item. - /// - /// The new value for the property. - protected void SetLayoutItem(LayoutItem value) - { - SetValue(LayoutItemPropertyKey, value); - } + /// + /// Gets the LayoutItem property. This dependency property + /// indicates the LayoutItem attached to this tag item. + /// + public LayoutItem LayoutItem + { + get + { + return ( LayoutItem )GetValue( LayoutItemProperty ); + } + } - #endregion + /// + /// Provides a secure method for setting the LayoutItem property. + /// This dependency property indicates the LayoutItem attached to this tag item. + /// + /// The new value for the property. + protected void SetLayoutItem( LayoutItem value ) + { + SetValue( LayoutItemPropertyKey, value ); + } - protected override void OnPreviewGotKeyboardFocus(System.Windows.Input.KeyboardFocusChangedEventArgs e) - { - if (Model != null) - Model.IsActive = true; - base.OnPreviewGotKeyboardFocus(e); - } + #endregion + protected override void OnPreviewGotKeyboardFocus( KeyboardFocusChangedEventArgs e ) + { + this.SetIsActive(); + base.OnPreviewGotKeyboardFocus( e ); + } + protected override void OnMouseLeftButtonDown( MouseButtonEventArgs e ) + { + this.SetIsActive(); + base.OnMouseLeftButtonDown( e ); + } + + protected override void OnMouseRightButtonDown( MouseButtonEventArgs e ) + { + this.SetIsActive(); + base.OnMouseLeftButtonDown( e ); + } + + private void SetIsActive() + { + if( this.Model != null ) + { + this.Model.IsActive = true; + } } + } } diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutDocumentFloatingWindowControl.cs b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutDocumentFloatingWindowControl.cs index 3042d9a9..6d582e0d 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutDocumentFloatingWindowControl.cs +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutDocumentFloatingWindowControl.cs @@ -27,117 +27,124 @@ using Microsoft.Windows.Shell; namespace Xceed.Wpf.AvalonDock.Controls { - public class LayoutDocumentFloatingWindowControl : LayoutFloatingWindowControl + public class LayoutDocumentFloatingWindowControl : LayoutFloatingWindowControl + { + static LayoutDocumentFloatingWindowControl() { - static LayoutDocumentFloatingWindowControl() - { - DefaultStyleKeyProperty.OverrideMetadata(typeof(LayoutDocumentFloatingWindowControl), new FrameworkPropertyMetadata(typeof(LayoutDocumentFloatingWindowControl))); - } - - internal LayoutDocumentFloatingWindowControl(LayoutDocumentFloatingWindow model) - :base(model) - { - _model = model; - } - - - LayoutDocumentFloatingWindow _model; - - public override ILayoutElement Model - { - get { return _model; } - } - - public LayoutItem RootDocumentLayoutItem - { - get { return _model.Root.Manager.GetLayoutItemFromModel(_model.RootDocument); } - } - - protected override void OnInitialized(EventArgs e) - { - base.OnInitialized(e); - - if (_model.RootDocument == null) - { - InternalClose(); - } + DefaultStyleKeyProperty.OverrideMetadata( typeof( LayoutDocumentFloatingWindowControl ), new FrameworkPropertyMetadata( typeof( LayoutDocumentFloatingWindowControl ) ) ); + } + + internal LayoutDocumentFloatingWindowControl( LayoutDocumentFloatingWindow model ) + : base( model ) + { + _model = model; + UpdateThemeResources(); + } + + + LayoutDocumentFloatingWindow _model; + + public override ILayoutElement Model + { + get + { + return _model; + } + } + + public LayoutItem RootDocumentLayoutItem + { + get + { + return _model.Root.Manager.GetLayoutItemFromModel( _model.RootDocument ); + } + } + + protected override void OnInitialized( EventArgs e ) + { + base.OnInitialized( e ); + + if( _model.RootDocument == null ) + { + InternalClose(); + } + else + { + var manager = _model.Root.Manager; + + Content = manager.CreateUIElementForModel( _model.RootDocument ); + + _model.RootDocumentChanged += new EventHandler( _model_RootDocumentChanged ); + } + } + + void _model_RootDocumentChanged( object sender, EventArgs e ) + { + if( _model.RootDocument == null ) + { + InternalClose(); + } + } + + protected override IntPtr FilterMessage( IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled ) + { + switch( msg ) + { + case Win32Helper.WM_NCLBUTTONDOWN: //Left button down on title -> start dragging over docking manager + if( wParam.ToInt32() == Win32Helper.HT_CAPTION ) + { + if( _model.RootDocument != null ) + _model.RootDocument.IsActive = true; + } + break; + case Win32Helper.WM_NCRBUTTONUP: + if( wParam.ToInt32() == Win32Helper.HT_CAPTION ) + { + if( OpenContextMenu() ) + handled = true; + if( _model.Root.Manager.ShowSystemMenu ) + WindowChrome.GetWindowChrome( this ).ShowSystemMenu = !handled; else - { - var manager = _model.Root.Manager; - - Content = manager.CreateUIElementForModel(_model.RootDocument); - - _model.RootDocumentChanged += new EventHandler(_model_RootDocumentChanged); - } - } - - void _model_RootDocumentChanged(object sender, EventArgs e) - { - if (_model.RootDocument == null) - { - InternalClose(); - } - } - - protected override IntPtr FilterMessage(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled) - { - switch (msg) - { - case Win32Helper.WM_NCLBUTTONDOWN: //Left button down on title -> start dragging over docking manager - if (wParam.ToInt32() == Win32Helper.HT_CAPTION) - { - if (_model.RootDocument != null) - _model.RootDocument.IsActive = true; - } - break; - case Win32Helper.WM_NCRBUTTONUP: - if (wParam.ToInt32() == Win32Helper.HT_CAPTION) - { - if (OpenContextMenu()) - handled = true; - if (_model.Root.Manager.ShowSystemMenu) - WindowChrome.GetWindowChrome(this).ShowSystemMenu = !handled; - else - WindowChrome.GetWindowChrome(this).ShowSystemMenu = false; - } - break; - - } - - return base.FilterMessage(hwnd, msg, wParam, lParam, ref handled); - } - - bool OpenContextMenu() - { - var ctxMenu = _model.Root.Manager.DocumentContextMenu; - if (ctxMenu != null && RootDocumentLayoutItem != null) - { - ctxMenu.PlacementTarget = null; - ctxMenu.Placement = PlacementMode.MousePoint; - ctxMenu.DataContext = RootDocumentLayoutItem; - ctxMenu.IsOpen = true; - return true; - } - - return false; - } - - - protected override void OnClosed(EventArgs e) - { - var root = Model.Root; - root.Manager.RemoveFloatingWindow(this); - root.CollectGarbage(); - - base.OnClosed(e); - - if (!CloseInitiatedByUser) - { - root.FloatingWindows.Remove(_model); - } - - _model.RootDocumentChanged -= new EventHandler(_model_RootDocumentChanged); - } + WindowChrome.GetWindowChrome( this ).ShowSystemMenu = false; + } + break; + } + + return base.FilterMessage( hwnd, msg, wParam, lParam, ref handled ); + } + + bool OpenContextMenu() + { + var ctxMenu = _model.Root.Manager.DocumentContextMenu; + if( ctxMenu != null && RootDocumentLayoutItem != null ) + { + ctxMenu.PlacementTarget = null; + ctxMenu.Placement = PlacementMode.MousePoint; + ctxMenu.DataContext = RootDocumentLayoutItem; + ctxMenu.IsOpen = true; + return true; + } + + return false; } + + + protected override void OnClosed( EventArgs e ) + { + var root = Model.Root; + root.Manager.RemoveFloatingWindow( this ); + root.CollectGarbage(); + + base.OnClosed( e ); + + if( !CloseInitiatedByUser ) + { + root.FloatingWindows.Remove( _model ); + } + + _model.RootDocumentChanged -= new EventHandler( _model_RootDocumentChanged ); + } + + } } diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutFloatingWindowControl.cs b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutFloatingWindowControl.cs index 62b89456..d3063cad 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutFloatingWindowControl.cs +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutFloatingWindowControl.cs @@ -33,499 +33,515 @@ using Microsoft.Windows.Shell; namespace Xceed.Wpf.AvalonDock.Controls { - public abstract class LayoutFloatingWindowControl : Window, ILayoutControl + public abstract class LayoutFloatingWindowControl : Window, ILayoutControl + { + private ResourceDictionary currentThemeResourceDictionary; // = null + + static LayoutFloatingWindowControl() { - private ResourceDictionary currentThemeResourceDictionary; // = null + LayoutFloatingWindowControl.ContentProperty.OverrideMetadata( typeof( LayoutFloatingWindowControl ), new FrameworkPropertyMetadata( null, null, new CoerceValueCallback( CoerceContentValue ) ) ); + AllowsTransparencyProperty.OverrideMetadata( typeof( LayoutFloatingWindowControl ), new FrameworkPropertyMetadata( false ) ); + ShowInTaskbarProperty.OverrideMetadata( typeof( LayoutFloatingWindowControl ), new FrameworkPropertyMetadata( false ) ); + } + + static object CoerceContentValue( DependencyObject sender, object content ) + { + return new FloatingWindowContentHost( sender as LayoutFloatingWindowControl ) { Content = content as UIElement }; + } + + protected class FloatingWindowContentHost : HwndHost + { + LayoutFloatingWindowControl _owner; + public FloatingWindowContentHost( LayoutFloatingWindowControl owner ) + { + _owner = owner; + var manager = _owner.Model.Root.Manager; + } + + + HwndSource _wpfContentHost = null; + Border _rootPresenter = null; + DockingManager _manager = null; - static LayoutFloatingWindowControl() + protected override System.Runtime.InteropServices.HandleRef BuildWindowCore( System.Runtime.InteropServices.HandleRef hwndParent ) + { + _wpfContentHost = new HwndSource( new HwndSourceParameters() { - LayoutFloatingWindowControl.ContentProperty.OverrideMetadata(typeof(LayoutFloatingWindowControl), new FrameworkPropertyMetadata(null, null, new CoerceValueCallback(CoerceContentValue))); - AllowsTransparencyProperty.OverrideMetadata(typeof(LayoutFloatingWindowControl), new FrameworkPropertyMetadata(false)); - ShowInTaskbarProperty.OverrideMetadata(typeof(LayoutFloatingWindowControl), new FrameworkPropertyMetadata(false)); + ParentWindow = hwndParent.Handle, + WindowStyle = Win32Helper.WS_CHILD | Win32Helper.WS_VISIBLE | Win32Helper.WS_CLIPSIBLINGS | Win32Helper.WS_CLIPCHILDREN, + Width = 1, + Height = 1 + } ); + + _rootPresenter = new Border() { Child = new AdornerDecorator() { Child = Content }, Focusable = true }; + _rootPresenter.SetBinding( Border.BackgroundProperty, new Binding( "Background" ) { Source = _owner } ); + _wpfContentHost.RootVisual = _rootPresenter; + _wpfContentHost.SizeToContent = SizeToContent.Manual; + _manager = _owner.Model.Root.Manager; + _manager.InternalAddLogicalChild( _rootPresenter ); + + return new HandleRef( this, _wpfContentHost.Handle ); + } + + + protected override void DestroyWindowCore( HandleRef hwnd ) + { + _manager.InternalRemoveLogicalChild( _rootPresenter ); + if( _wpfContentHost != null ) + { + _wpfContentHost.Dispose(); + _wpfContentHost = null; } + } - static object CoerceContentValue( DependencyObject sender, object content ) + public Visual RootVisual + { + get + { + return _rootPresenter; + } + } + + protected override Size MeasureOverride( Size constraint ) + { + if( Content == null ) + return base.MeasureOverride( constraint ); + + Content.Measure( constraint ); + return Content.DesiredSize; + } + + #region Content + + /// + /// Content Dependency Property + /// + public static readonly DependencyProperty ContentProperty = + DependencyProperty.Register( "Content", typeof( UIElement ), typeof( FloatingWindowContentHost ), + new FrameworkPropertyMetadata( ( UIElement )null, + new PropertyChangedCallback( OnContentChanged ) ) ); + + /// + /// Gets or sets the Content property. This dependency property + /// indicates .... + /// + public UIElement Content + { + get + { + return ( UIElement )GetValue( ContentProperty ); + } + set { - return new FloatingWindowContentHost( sender as LayoutFloatingWindowControl ) { Content = content as UIElement }; + SetValue( ContentProperty, value ); } + } + + /// + /// Handles changes to the Content property. + /// + private static void OnContentChanged( DependencyObject d, DependencyPropertyChangedEventArgs e ) + { + ( ( FloatingWindowContentHost )d ).OnContentChanged( e ); + } + + /// + /// Provides derived classes an opportunity to handle changes to the Content property. + /// + protected virtual void OnContentChanged( DependencyPropertyChangedEventArgs e ) + { + if( _rootPresenter != null ) + _rootPresenter.Child = Content; + } + + #endregion + } - protected class FloatingWindowContentHost : HwndHost - { - LayoutFloatingWindowControl _owner; - public FloatingWindowContentHost(LayoutFloatingWindowControl owner) - { - _owner = owner; - var manager = _owner.Model.Root.Manager; - } - - - HwndSource _wpfContentHost = null; - Border _rootPresenter = null; - DockingManager _manager = null; - - protected override System.Runtime.InteropServices.HandleRef BuildWindowCore(System.Runtime.InteropServices.HandleRef hwndParent) - { - _wpfContentHost = new HwndSource(new HwndSourceParameters() - { - ParentWindow = hwndParent.Handle, - WindowStyle = Win32Helper.WS_CHILD | Win32Helper.WS_VISIBLE | Win32Helper.WS_CLIPSIBLINGS | Win32Helper.WS_CLIPCHILDREN, - Width = 1, - Height = 1 - }); - - _rootPresenter = new Border() { Child = new AdornerDecorator() { Child = Content }, Focusable = true }; - _rootPresenter.SetBinding(Border.BackgroundProperty, new Binding("Background") { Source = _owner }); - _wpfContentHost.RootVisual = _rootPresenter; - _wpfContentHost.SizeToContent = SizeToContent.Manual; - _manager = _owner.Model.Root.Manager; - _manager.InternalAddLogicalChild(_rootPresenter); - - return new HandleRef(this, _wpfContentHost.Handle); - } - - - protected override void DestroyWindowCore(HandleRef hwnd) - { - _manager.InternalRemoveLogicalChild(_rootPresenter); - if (_wpfContentHost != null) - { - _wpfContentHost.Dispose(); - _wpfContentHost = null; - } - } - - public Visual RootVisual - { - get { return _rootPresenter; } - } - - protected override Size MeasureOverride(Size constraint) - { - if (Content == null) - return base.MeasureOverride(constraint); - - Content.Measure(constraint); - return Content.DesiredSize; - } - - #region Content - - /// - /// Content Dependency Property - /// - public static readonly DependencyProperty ContentProperty = - DependencyProperty.Register("Content", typeof(UIElement), typeof(FloatingWindowContentHost), - new FrameworkPropertyMetadata((UIElement)null, - new PropertyChangedCallback(OnContentChanged))); - - /// - /// Gets or sets the Content property. This dependency property - /// indicates .... - /// - public UIElement Content - { - get { return (UIElement)GetValue(ContentProperty); } - set { SetValue(ContentProperty, value); } - } - - /// - /// Handles changes to the Content property. - /// - private static void OnContentChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - ((FloatingWindowContentHost)d).OnContentChanged(e); - } - - /// - /// Provides derived classes an opportunity to handle changes to the Content property. - /// - protected virtual void OnContentChanged(DependencyPropertyChangedEventArgs e) - { - if (_rootPresenter != null) - _rootPresenter.Child = Content; - } - - #endregion - } + ILayoutElement _model; - ILayoutElement _model; + protected LayoutFloatingWindowControl( ILayoutElement model ) + { + this.Loaded += new RoutedEventHandler( OnLoaded ); + this.Unloaded += new RoutedEventHandler( OnUnloaded ); + _model = model; + } - protected LayoutFloatingWindowControl(ILayoutElement model) + internal virtual void UpdateThemeResources( Theme oldTheme = null ) + { + if( oldTheme != null ) + { + if( oldTheme is DictionaryTheme ) { - this.Loaded += new RoutedEventHandler(OnLoaded); - this.Unloaded += new RoutedEventHandler(OnUnloaded); - _model = model; - UpdateThemeResources(); + if( currentThemeResourceDictionary != null ) + { + Resources.MergedDictionaries.Remove( currentThemeResourceDictionary ); + currentThemeResourceDictionary = null; + } } - - internal virtual void UpdateThemeResources(Theme oldTheme = null) + else { - if (oldTheme != null) - { - if( oldTheme is DictionaryTheme ) - { - if( currentThemeResourceDictionary != null ) - { - Resources.MergedDictionaries.Remove( currentThemeResourceDictionary ); - currentThemeResourceDictionary = null; - } - } - else - { - var resourceDictionaryToRemove = - Resources.MergedDictionaries.FirstOrDefault( r => r.Source == oldTheme.GetResourceUri() ); - if( resourceDictionaryToRemove != null ) - Resources.MergedDictionaries.Remove( - resourceDictionaryToRemove ); - } - } - - var manager = _model.Root.Manager; - if (manager.Theme != null) - { - if( manager.Theme is DictionaryTheme ) - { - currentThemeResourceDictionary = ( ( DictionaryTheme )manager.Theme ).ThemeResourceDictionary; - Resources.MergedDictionaries.Add( currentThemeResourceDictionary ); - } - else - { - Resources.MergedDictionaries.Add(new ResourceDictionary() { Source = manager.Theme.GetResourceUri() }); - } - } + var resourceDictionaryToRemove = + Resources.MergedDictionaries.FirstOrDefault( r => r.Source == oldTheme.GetResourceUri() ); + if( resourceDictionaryToRemove != null ) + Resources.MergedDictionaries.Remove( + resourceDictionaryToRemove ); } + } - protected override void OnClosed(EventArgs e) + var manager = _model.Root.Manager; + if( manager.Theme != null ) + { + if( manager.Theme is DictionaryTheme ) { - if (Content != null) - { - var host = Content as FloatingWindowContentHost; - if( host != null ) - { - host.Dispose(); - } - - if (_hwndSrc != null) - { - _hwndSrc.RemoveHook(_hwndSrcHook); - _hwndSrc.Dispose(); - _hwndSrc = null; - } - } - - base.OnClosed(e); + currentThemeResourceDictionary = ( ( DictionaryTheme )manager.Theme ).ThemeResourceDictionary; + Resources.MergedDictionaries.Add( currentThemeResourceDictionary ); } - - bool _attachDrag = false; - internal void AttachDrag(bool onActivated = true) + else { - if (onActivated) - { - _attachDrag = true; - this.Activated += new EventHandler(OnActivated); - } - else - { - IntPtr windowHandle = new WindowInteropHelper(this).Handle; - IntPtr lParam = new IntPtr(((int)Left & (int)0xFFFF) | (((int)Top) << 16)); - Win32Helper.SendMessage(windowHandle, Win32Helper.WM_NCLBUTTONDOWN, new IntPtr(Win32Helper.HT_CAPTION), lParam); - } + Resources.MergedDictionaries.Add( new ResourceDictionary() { Source = manager.Theme.GetResourceUri() } ); } + } + } - HwndSource _hwndSrc; - HwndSourceHook _hwndSrcHook; + protected override void OnClosed( EventArgs e ) + { + if( Content != null ) + { + var host = Content as FloatingWindowContentHost; + host.Dispose(); - void OnLoaded(object sender, RoutedEventArgs e) + if( _hwndSrc != null ) { - this.Loaded -= new RoutedEventHandler(OnLoaded); + _hwndSrc.RemoveHook( _hwndSrcHook ); + _hwndSrc.Dispose(); + _hwndSrc = null; + } + } - this.SetParentToMainWindowOf(Model.Root.Manager); + base.OnClosed( e ); + } - _hwndSrc = HwndSource.FromDependencyObject(this) as HwndSource; - _hwndSrcHook = new HwndSourceHook(FilterMessage); - _hwndSrc.AddHook(_hwndSrcHook); + bool _attachDrag = false; + internal void AttachDrag( bool onActivated = true ) + { + if( onActivated ) + { + _attachDrag = true; + this.Activated += new EventHandler( OnActivated ); + } + else + { + IntPtr windowHandle = new WindowInteropHelper( this ).Handle; + IntPtr lParam = new IntPtr( ( ( int )Left & ( int )0xFFFF ) | ( ( ( int )Top ) << 16 ) ); + Win32Helper.SendMessage( windowHandle, Win32Helper.WM_NCLBUTTONDOWN, new IntPtr( Win32Helper.HT_CAPTION ), lParam ); + } + } - // Restore maximize state - var maximized = Model.Descendents().OfType().Any(l => l.IsMaximized); - UpdateMaximizedState(maximized); - } + HwndSource _hwndSrc; + HwndSourceHook _hwndSrcHook; - void OnUnloaded(object sender, RoutedEventArgs e) - { - this.Unloaded -= new RoutedEventHandler(OnUnloaded); + void OnLoaded( object sender, RoutedEventArgs e ) + { + this.Loaded -= new RoutedEventHandler( OnLoaded ); - if (_hwndSrc != null) - { - _hwndSrc.RemoveHook(_hwndSrcHook); - InternalClose(); - } - } + this.SetParentToMainWindowOf( Model.Root.Manager ); - void OnActivated(object sender, EventArgs e) - { - this.Activated -= new EventHandler(OnActivated); + _hwndSrc = HwndSource.FromDependencyObject( this ) as HwndSource; + _hwndSrcHook = new HwndSourceHook( FilterMessage ); + _hwndSrc.AddHook( _hwndSrcHook ); - if (_attachDrag && Mouse.LeftButton == MouseButtonState.Pressed) - { - IntPtr windowHandle = new WindowInteropHelper(this).Handle; - var mousePosition = this.PointToScreenDPI(Mouse.GetPosition(this)); - var clientArea = Win32Helper.GetClientRect(windowHandle); - var windowArea = Win32Helper.GetWindowRect(windowHandle); + // Restore maximize state + var maximized = Model.Descendents().OfType().Any( l => l.IsMaximized ); + UpdateMaximizedState( maximized ); + } - Left = mousePosition.X - windowArea.Width / 2.0; - Top = mousePosition.Y - (windowArea.Height - clientArea.Height) / 2.0; - _attachDrag = false; + void OnUnloaded( object sender, RoutedEventArgs e ) + { + this.Unloaded -= new RoutedEventHandler( OnUnloaded ); - IntPtr lParam = new IntPtr(((int)mousePosition.X & (int)0xFFFF) | (((int)mousePosition.Y) << 16)); - Win32Helper.SendMessage(windowHandle, Win32Helper.WM_NCLBUTTONDOWN, new IntPtr(Win32Helper.HT_CAPTION), lParam); - } - } + if( _hwndSrc != null ) + { + _hwndSrc.RemoveHook( _hwndSrcHook ); + InternalClose(); + } + } + void OnActivated( object sender, EventArgs e ) + { + this.Activated -= new EventHandler( OnActivated ); + + if( _attachDrag && Mouse.LeftButton == MouseButtonState.Pressed ) + { + IntPtr windowHandle = new WindowInteropHelper( this ).Handle; + var mousePosition = this.PointToScreenDPI( Mouse.GetPosition( this ) ); + var clientArea = Win32Helper.GetClientRect( windowHandle ); + var windowArea = Win32Helper.GetWindowRect( windowHandle ); + + Left = mousePosition.X - windowArea.Width / 2.0; + Top = mousePosition.Y - ( windowArea.Height - clientArea.Height ) / 2.0; + _attachDrag = false; + + IntPtr lParam = new IntPtr( ( ( int )mousePosition.X & ( int )0xFFFF ) | ( ( ( int )mousePosition.Y ) << 16 ) ); + Win32Helper.SendMessage( windowHandle, Win32Helper.WM_NCLBUTTONDOWN, new IntPtr( Win32Helper.HT_CAPTION ), lParam ); + } + } - protected override void OnInitialized(EventArgs e) - { - CommandBindings.Add(new CommandBinding(Microsoft.Windows.Shell.SystemCommands.CloseWindowCommand, - new ExecutedRoutedEventHandler((s, args) => Microsoft.Windows.Shell.SystemCommands.CloseWindow((Window)args.Parameter)))); - CommandBindings.Add(new CommandBinding(Microsoft.Windows.Shell.SystemCommands.MaximizeWindowCommand, - new ExecutedRoutedEventHandler((s, args) => Microsoft.Windows.Shell.SystemCommands.MaximizeWindow((Window)args.Parameter)))); - CommandBindings.Add(new CommandBinding(Microsoft.Windows.Shell.SystemCommands.MinimizeWindowCommand, - new ExecutedRoutedEventHandler((s, args) => Microsoft.Windows.Shell.SystemCommands.MinimizeWindow((Window)args.Parameter)))); - CommandBindings.Add(new CommandBinding(Microsoft.Windows.Shell.SystemCommands.RestoreWindowCommand, - new ExecutedRoutedEventHandler((s, args) => Microsoft.Windows.Shell.SystemCommands.RestoreWindow((Window)args.Parameter)))); - //Debug.Assert(this.Owner != null); - base.OnInitialized(e); - } - public abstract ILayoutElement Model { get; } + protected override void OnInitialized( EventArgs e ) + { + CommandBindings.Add( new CommandBinding( Microsoft.Windows.Shell.SystemCommands.CloseWindowCommand, + new ExecutedRoutedEventHandler( ( s, args ) => Microsoft.Windows.Shell.SystemCommands.CloseWindow( ( Window )args.Parameter ) ) ) ); + CommandBindings.Add( new CommandBinding( Microsoft.Windows.Shell.SystemCommands.MaximizeWindowCommand, + new ExecutedRoutedEventHandler( ( s, args ) => Microsoft.Windows.Shell.SystemCommands.MaximizeWindow( ( Window )args.Parameter ) ) ) ); + CommandBindings.Add( new CommandBinding( Microsoft.Windows.Shell.SystemCommands.MinimizeWindowCommand, + new ExecutedRoutedEventHandler( ( s, args ) => Microsoft.Windows.Shell.SystemCommands.MinimizeWindow( ( Window )args.Parameter ) ) ) ); + CommandBindings.Add( new CommandBinding( Microsoft.Windows.Shell.SystemCommands.RestoreWindowCommand, + new ExecutedRoutedEventHandler( ( s, args ) => Microsoft.Windows.Shell.SystemCommands.RestoreWindow( ( Window )args.Parameter ) ) ) ); + //Debug.Assert(this.Owner != null); + base.OnInitialized( e ); + } + public abstract ILayoutElement Model + { + get; + } - #region IsDragging - /// - /// IsDragging Read-Only Dependency Property - /// - private static readonly DependencyPropertyKey IsDraggingPropertyKey - = DependencyProperty.RegisterReadOnly("IsDragging", typeof(bool), typeof(LayoutFloatingWindowControl), - new FrameworkPropertyMetadata((bool)false, - new PropertyChangedCallback(OnIsDraggingChanged))); + #region IsDragging - public static readonly DependencyProperty IsDraggingProperty - = IsDraggingPropertyKey.DependencyProperty; + /// + /// IsDragging Read-Only Dependency Property + /// + private static readonly DependencyPropertyKey IsDraggingPropertyKey + = DependencyProperty.RegisterReadOnly( "IsDragging", typeof( bool ), typeof( LayoutFloatingWindowControl ), + new FrameworkPropertyMetadata( ( bool )false, + new PropertyChangedCallback( OnIsDraggingChanged ) ) ); - /// - /// Gets the IsDragging property. This dependency property - /// indicates that this floating window is being dragged. - /// - public bool IsDragging - { - get { return (bool)GetValue(IsDraggingProperty); } - } + public static readonly DependencyProperty IsDraggingProperty + = IsDraggingPropertyKey.DependencyProperty; - /// - /// Provides a secure method for setting the IsDragging property. - /// This dependency property indicates that this floating window is being dragged. - /// - /// The new value for the property. - protected void SetIsDragging(bool value) - { - SetValue(IsDraggingPropertyKey, value); - } + /// + /// Gets the IsDragging property. This dependency property + /// indicates that this floating window is being dragged. + /// + public bool IsDragging + { + get + { + return ( bool )GetValue( IsDraggingProperty ); + } + } - /// - /// Handles changes to the IsDragging property. - /// - private static void OnIsDraggingChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - ((LayoutFloatingWindowControl)d).OnIsDraggingChanged(e); - } + /// + /// Provides a secure method for setting the IsDragging property. + /// This dependency property indicates that this floating window is being dragged. + /// + /// The new value for the property. + protected void SetIsDragging( bool value ) + { + SetValue( IsDraggingPropertyKey, value ); + } - /// - /// Provides derived classes an opportunity to handle changes to the IsDragging property. - /// - protected virtual void OnIsDraggingChanged(DependencyPropertyChangedEventArgs e) - { - if( ( bool )e.NewValue ) - { - CaptureMouse(); - } - else - { - ReleaseMouseCapture(); - } - } + /// + /// Handles changes to the IsDragging property. + /// + private static void OnIsDraggingChanged( DependencyObject d, DependencyPropertyChangedEventArgs e ) + { + ( ( LayoutFloatingWindowControl )d ).OnIsDraggingChanged( e ); + } - #endregion + /// + /// Provides derived classes an opportunity to handle changes to the IsDragging property. + /// + protected virtual void OnIsDraggingChanged( DependencyPropertyChangedEventArgs e ) + { + if( ( bool )e.NewValue ) + { + CaptureMouse(); + } + else + { + ReleaseMouseCapture(); + } + } - DragService _dragService = null; + #endregion - void UpdatePositionAndSizeOfPanes() - { - foreach (var posElement in Model.Descendents().OfType()) - { - posElement.FloatingLeft = Left; - posElement.FloatingTop = Top; - posElement.FloatingWidth = Width; - posElement.FloatingHeight = Height; - } - } + DragService _dragService = null; - void UpdateMaximizedState( bool isMaximized ) - { - foreach( var posElement in Model.Descendents().OfType() ) - { - posElement.IsMaximized = isMaximized; - } - IsMaximized = isMaximized; - WindowState = isMaximized ? WindowState.Maximized : WindowState.Normal; - } + void UpdatePositionAndSizeOfPanes() + { + foreach( var posElement in Model.Descendents().OfType() ) + { + posElement.FloatingLeft = Left; + posElement.FloatingTop = Top; + posElement.FloatingWidth = Width; + posElement.FloatingHeight = Height; + } + } + void UpdateMaximizedState( bool isMaximized ) + { + foreach( var posElement in Model.Descendents().OfType() ) + { + posElement.IsMaximized = isMaximized; + } + IsMaximized = isMaximized; + WindowState = isMaximized ? WindowState.Maximized : WindowState.Normal; + } - protected virtual IntPtr FilterMessage( - IntPtr hwnd, - int msg, - IntPtr wParam, - IntPtr lParam, - ref bool handled - ) - { - handled = false; - switch (msg) + protected virtual IntPtr FilterMessage( + IntPtr hwnd, + int msg, + IntPtr wParam, + IntPtr lParam, + ref bool handled + ) + { + handled = false; + + switch( msg ) + { + case Win32Helper.WM_ACTIVATE: + if( ( ( int )wParam & 0xFFFF ) == Win32Helper.WA_INACTIVE ) + { + if( lParam == this.GetParentWindowHandle() ) { - case Win32Helper.WM_ACTIVATE: - if (((int)wParam & 0xFFFF) == Win32Helper.WA_INACTIVE) - { - if (lParam == this.GetParentWindowHandle()) - { - Win32Helper.SetActiveWindow(_hwndSrc.Handle); - handled = true; - } - } - break; - case Win32Helper.WM_EXITSIZEMOVE: - UpdatePositionAndSizeOfPanes(); - - if (_dragService != null) - { - bool dropFlag; - var mousePosition = this.TransformToDeviceDPI(Win32Helper.GetMousePosition()); - _dragService.Drop(mousePosition, out dropFlag); - _dragService = null; - SetIsDragging(false); - - if (dropFlag) - InternalClose(); - } - - break; - case Win32Helper.WM_MOVING: - { - UpdateDragPosition(); - } - break; - case Win32Helper.WM_LBUTTONUP: //set as handled right button click on title area (after showing context menu) - if (_dragService != null && Mouse.LeftButton == MouseButtonState.Released) - { - _dragService.Abort(); - _dragService = null; - SetIsDragging(false); - } - break; - case Win32Helper.WM_SYSCOMMAND: - int command = (int)wParam & 0xFFF0; - if (command == Win32Helper.SC_MAXIMIZE || command == Win32Helper.SC_RESTORE) - { - UpdateMaximizedState( command == Win32Helper.SC_MAXIMIZE ); - } - break; + Win32Helper.SetActiveWindow( _hwndSrc.Handle ); + handled = true; } + } + break; + case Win32Helper.WM_EXITSIZEMOVE: + UpdatePositionAndSizeOfPanes(); + if( _dragService != null ) + { + bool dropFlag; + var mousePosition = this.TransformToDeviceDPI( Win32Helper.GetMousePosition() ); + _dragService.Drop( mousePosition, out dropFlag ); + _dragService = null; + SetIsDragging( false ); + + if( dropFlag ) + InternalClose(); + } - - return IntPtr.Zero; - } - - private void UpdateDragPosition() - { - if (_dragService == null) + break; + case Win32Helper.WM_MOVING: + { + UpdateDragPosition(); + if( this.IsMaximized ) { - _dragService = new DragService(this); - SetIsDragging(true); + this.UpdateMaximizedState( false ); } + } + break; + case Win32Helper.WM_LBUTTONUP: //set as handled right button click on title area (after showing context menu) + if( _dragService != null && Mouse.LeftButton == MouseButtonState.Released ) + { + _dragService.Abort(); + _dragService = null; + SetIsDragging( false ); + } + break; + case Win32Helper.WM_SYSCOMMAND: + int command = ( int )wParam & 0xFFF0; + if( command == Win32Helper.SC_MAXIMIZE || command == Win32Helper.SC_RESTORE ) + { + UpdateMaximizedState( command == Win32Helper.SC_MAXIMIZE ); + } + break; + } - var mousePosition = this.TransformToDeviceDPI(Win32Helper.GetMousePosition()); - _dragService.UpdateMouseLocation(mousePosition); - } - bool _internalCloseFlag = false; - internal void InternalClose() - { - _internalCloseFlag = true; - Close(); - } + return IntPtr.Zero; + } + private void UpdateDragPosition() + { + if( _dragService == null ) + { + _dragService = new DragService( this ); + SetIsDragging( true ); + } + + var mousePosition = this.TransformToDeviceDPI( Win32Helper.GetMousePosition() ); + _dragService.UpdateMouseLocation( mousePosition ); + } - protected bool CloseInitiatedByUser - { - get { return !_internalCloseFlag; } - } + bool _internalCloseFlag = false; - internal bool KeepContentVisibleOnClose - { - get; - set; - } + internal void InternalClose() + { + _internalCloseFlag = true; + Close(); + } - protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e) - { - base.OnMouseLeftButtonUp(e); - } - #region IsMaximized + protected bool CloseInitiatedByUser + { + get + { + return !_internalCloseFlag; + } + } - /// - /// IsMaximized Dependency Property - /// - public static readonly DependencyProperty IsMaximizedProperty - = DependencyProperty.Register( "IsMaximized", typeof( bool ), typeof( LayoutFloatingWindowControl ), - new FrameworkPropertyMetadata( (bool)false ) ); + internal bool KeepContentVisibleOnClose + { + get; + set; + } - /// - /// Gets/sets the IsMaximized property. This dependency property - /// indicates if the window is maximized. - /// - public bool IsMaximized - { - get { return (bool)GetValue(IsMaximizedProperty); } - private set - { - SetValue(IsMaximizedProperty, value); - UpdatePositionAndSizeOfPanes(); - } - } + #region IsMaximized - /// - /// Provides a secure method for setting the IsMaximized property. - /// This dependency property indicates if the window is maximized. - /// - /// The new value for the property. + /// + /// IsMaximized Dependency Property + /// + public static readonly DependencyProperty IsMaximizedProperty + = DependencyProperty.Register( "IsMaximized", typeof( bool ), typeof( LayoutFloatingWindowControl ), + new FrameworkPropertyMetadata( ( bool )false ) ); - protected override void OnStateChanged(EventArgs e) - { - //Windows sometimes send unwanted state changes (when minimizing application for instance) - //We force internal state to be used - WindowState = IsMaximized ? WindowState.Maximized : WindowState.Normal; - base.OnStateChanged(e); - } + /// + /// Gets/sets the IsMaximized property. This dependency property + /// indicates if the window is maximized. + /// + public bool IsMaximized + { + get + { + return ( bool )GetValue( IsMaximizedProperty ); + } + private set + { + SetValue( IsMaximizedProperty, value ); + UpdatePositionAndSizeOfPanes(); + } + } + + /// + /// Provides a secure method for setting the IsMaximized property. + /// This dependency property indicates if the window is maximized. + /// + /// The new value for the property. - #endregion + protected override void OnStateChanged( EventArgs e ) + { + //Windows sometimes send unwanted state changes (when minimizing application for instance) + //We force internal state to be used + WindowState = IsMaximized ? WindowState.Maximized : WindowState.Normal; + base.OnStateChanged( e ); + } + #endregion - } + + } } diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutItem.cs b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutItem.cs index 9f5fd9bf..c2aa7836 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutItem.cs +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutItem.cs @@ -189,6 +189,11 @@ namespace Xceed.Wpf.AvalonDock.Controls SetDefaultBindings(); } + internal bool IsViewExists() + { + return (_view != null); + } + ContentPresenter _view = null; public ContentPresenter View { @@ -199,9 +204,9 @@ namespace Xceed.Wpf.AvalonDock.Controls _view = new ContentPresenter(); _view.SetBinding(ContentPresenter.ContentProperty, new Binding("Content") { Source = LayoutElement }); - _view.SetBinding(ContentPresenter.ContentTemplateProperty, new Binding("LayoutItemTemplate") { Source = LayoutElement.Root.Manager}); - _view.SetBinding(ContentPresenter.ContentTemplateSelectorProperty, new Binding("LayoutItemTemplateSelector") { Source = LayoutElement.Root.Manager }); - LayoutElement.Root.Manager.InternalAddLogicalChild(_view); + _view.SetBinding( ContentPresenter.ContentTemplateProperty, new Binding( "LayoutItemTemplate" ) { Source = LayoutElement.Root.Manager } ); + _view.SetBinding( ContentPresenter.ContentTemplateSelectorProperty, new Binding( "LayoutItemTemplateSelector" ) { Source = LayoutElement.Root.Manager } ); + LayoutElement.Root.Manager.InternalAddLogicalChild( _view ); } return _view; diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/DockingManager.cs b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/DockingManager.cs index 13195377..2ed4f6c1 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/DockingManager.cs +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/DockingManager.cs @@ -2579,7 +2579,10 @@ namespace Xceed.Wpf.AvalonDock var layoutItem = this.GetLayoutItemFromModel( layoutContent ); if( layoutItem != null ) { - this.InternalRemoveLogicalChild( layoutItem.View ); + if( layoutItem.IsViewExists() ) + { + this.InternalRemoveLogicalChild( layoutItem.View ); + } } } diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Themes/generic.xaml b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Themes/generic.xaml index 07bd42fa..b3237473 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Themes/generic.xaml +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Themes/generic.xaml @@ -823,6 +823,9 @@ + + + @@ -930,9 +933,9 @@ - - - + + + diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.DataGrid/AssemblyVersionInfo.cs b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.DataGrid/AssemblyVersionInfo.cs index 35aedd63..42f3494f 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.DataGrid/AssemblyVersionInfo.cs +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.DataGrid/AssemblyVersionInfo.cs @@ -19,7 +19,7 @@ internal static class _XceedVersionInfo { [System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )] - public const string BaseVersion = "3.0"; + public const string BaseVersion = "3.1"; [System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )] public const string Version = BaseVersion + ".0.0"; [System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )] diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/AutoSelectTextboxView.xaml.txt b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/AutoSelectTextboxView.xaml.txt index 3f84a275..1d7a3c92 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/AutoSelectTextboxView.xaml.txt +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/AutoSelectTextboxView.xaml.txt @@ -24,7 +24,7 @@ The AutoSelectTextBox allows the text content to be selected when the control get the focus. It also allows the Focus navigation behavior within the control to be affected. - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartSeriesDataPointsBindingView.xaml.cs.txt b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartSeriesDataPointsBindingView.xaml.cs.txt index d8372a4c..34d193c6 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartSeriesDataPointsBindingView.xaml.cs.txt +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartSeriesDataPointsBindingView.xaml.cs.txt @@ -14,6 +14,9 @@ ************************************************************************************/ +#if !OPEN_SOURCE +using Xceed.Wpf.Toolkit.Chart; +#endif using System.Windows.Media; using System; using System.Collections.ObjectModel; diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartSeriesDataPointsBindingView.xaml.txt b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartSeriesDataPointsBindingView.xaml.txt index fcd6c9f2..3eb9ddd4 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartSeriesDataPointsBindingView.xaml.txt +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartSeriesDataPointsBindingView.xaml.txt @@ -26,17 +26,57 @@ The DataPoint objects of a chart's series can be set by binding with the Series.DataPointsSource property. From there, a DataPointBinding can be set on the X, Y, or Label property of a DataPoint. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingAxesGridView.xaml.cs.txt b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingAxesGridView.xaml.cs.txt index 4864490d..a78475e2 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingAxesGridView.xaml.cs.txt +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingAxesGridView.xaml.cs.txt @@ -14,6 +14,9 @@ ************************************************************************************/ +#if !OPEN_SOURCE +using Xceed.Wpf.Toolkit.Chart; +#endif using System.Windows.Media; using System.Windows.Controls; using System; diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingAxesGridView.xaml.txt b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingAxesGridView.xaml.txt index f2d86a44..1350727e 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingAxesGridView.xaml.txt +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingAxesGridView.xaml.txt @@ -24,32 +24,178 @@ This sample shows how AxesGrid elements can be styled using a DataTemplate. + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingColumnSeriesView.xaml.cs.txt b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingColumnSeriesView.xaml.cs.txt index 971cddae..3ff2ac56 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingColumnSeriesView.xaml.cs.txt +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingColumnSeriesView.xaml.cs.txt @@ -14,6 +14,9 @@ *************************************************************************************/ +#if !OPEN_SOURCE +using Xceed.Wpf.Toolkit.Chart; +#endif using System.Windows.Media; using System.Windows.Controls; using System.Diagnostics; diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingColumnSeriesView.xaml.txt b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingColumnSeriesView.xaml.txt index ca2fe617..16aa5efa 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingColumnSeriesView.xaml.txt +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingColumnSeriesView.xaml.txt @@ -25,26 +25,175 @@ This sample shows how a series with a column layout type and a legend can be styled using DataTemplates. - + + Please move mouse on line and markers to see simple effects. + + + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingLineSeriesView.xaml.cs.txt b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingLineSeriesView.xaml.cs.txt index 42191573..a46ed469 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingLineSeriesView.xaml.cs.txt +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingLineSeriesView.xaml.cs.txt @@ -14,6 +14,9 @@ *************************************************************************************/ +#if !OPEN_SOURCE +using Xceed.Wpf.Toolkit.Chart; +#endif using System.Windows.Media; using System.Windows.Controls; using System.Windows; @@ -31,7 +34,16 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Chart.Views InitializeComponent(); } +#if !OPEN_SOURCE + #region Event Handler + private void LegendButtonClick( object sender, RoutedEventArgs e ) + { + Random r = new Random(); + _series.DataPoints.Add( new DataPoint( _series.DataPoints.Count, r.NextDouble() ) ); + } + #endregion +#endif } } diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingLineSeriesView.xaml.txt b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingLineSeriesView.xaml.txt index debe4076..94fc0dcf 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingLineSeriesView.xaml.txt +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingLineSeriesView.xaml.txt @@ -24,23 +24,144 @@ This sample demonstrates how a series with a line layout type and a legend can be styled via DataTemplates. The legend contains a button to add new DataPoints. - + + Please move mouse along the line and over the markers to see simple effects. + + + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingPieSeriesView.xaml.cs.txt b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingPieSeriesView.xaml.cs.txt index 2e22ccc9..44ccffeb 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingPieSeriesView.xaml.cs.txt +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingPieSeriesView.xaml.cs.txt @@ -14,6 +14,9 @@ *************************************************************************************/ +#if !OPEN_SOURCE +using Xceed.Wpf.Toolkit.Chart; +#endif using System.Windows.Media; using System.Windows.Controls; using System; diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingPieSeriesView.xaml.txt b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingPieSeriesView.xaml.txt index 4916d504..b43180a5 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingPieSeriesView.xaml.txt +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingPieSeriesView.xaml.txt @@ -24,26 +24,175 @@ This sample demonstrates how a series with a pie layout type can be styled via DataTemplates. The series, hint line, and hint label are all styled. + + Please move the mouse over the pie slices to view the tooltips of the pie layout DataTemplate. + + - - - - - - - - - - - - + + + + Mary + Brad + Anne + Eric + Lisa + Carl + Whole Team + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/CheckListsView.xaml.txt b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/CheckListsView.xaml.txt index 038fd94c..15d7ed74 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/CheckListsView.xaml.txt +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/CheckListsView.xaml.txt @@ -26,7 +26,7 @@ The CheckListBox and CheckComboBox controls represent a list of selected items that are displayed as CheckBoxes. Besides the common SelectedItem and SelectedItems properties, these controls give developers more alternatives for managing and handling selections. - + ID @@ -34,7 +34,7 @@ LastName - + @@ -56,7 +56,7 @@ - + @@ -98,7 +98,7 @@ HorizontalAlignment="Left" IsEnabled="False" Text="IsSelected" /> - + @@ -149,12 +149,12 @@ - + - + diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChildWindowView.xaml.txt b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChildWindowView.xaml.txt index 662fdea0..6ceeb819 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChildWindowView.xaml.txt +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChildWindowView.xaml.txt @@ -25,6 +25,7 @@ The ChildWindow control can be used to create a window that is displayed within the bounds of a specific parent container. + - + @@ -52,7 +54,7 @@ - + @@ -82,7 +84,7 @@ - + diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ColorView.xaml.txt b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ColorView.xaml.txt index d92dac73..65cc2687 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ColorView.xaml.txt +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ColorView.xaml.txt @@ -39,7 +39,7 @@ - + @@ -219,6 +219,7 @@ + @@ -297,21 +298,29 @@ IsChecked="{Binding ElementName=_colorPicker, Path=UsingAlphaChannel, Mode=TwoWay}" /> + + diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/DataGridView.xaml.txt b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/DataGridView.xaml.txt index 22ecdffe..40e13ff5 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/DataGridView.xaml.txt +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/DataGridView.xaml.txt @@ -33,12 +33,12 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -148,7 +148,7 @@ - + @@ -156,7 +156,7 @@ - + diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/DateTimeView.xaml.txt b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/DateTimeView.xaml.txt index 7e0b8d54..aa693294 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/DateTimeView.xaml.txt +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/DateTimeView.xaml.txt @@ -27,7 +27,7 @@ The DateTimePicker and TimePicker controls let you select the date and the time in several ways. The TimePicker is used in the DateTimePicker. - + @@ -83,6 +83,7 @@ + @@ -105,12 +106,14 @@ - - - - - - + + + + + + + + @@ -147,6 +150,7 @@ Maximum="{Binding Value, ElementName=_maximum}" Kind="{Binding SelectedItem, ElementName=_kind}" CalendarDisplayMode="{Binding SelectedItem, ElementName=_calendarDisplayMode}" + CalendarWidth="{Binding Value, ElementName=_calendarWidth}" ShowDropDownButton="{Binding IsChecked, ElementName=_showDropDownButton}" CurrentDateTimePart="{Binding SelectedItem, ElementName=_currentDateTimePart, Mode=TwoWay}"/> diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/DisplayLocalizationRes.Designer.cs.txt b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/DisplayLocalizationRes.Designer.cs.txt index 667ee531..34a83eec 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/DisplayLocalizationRes.Designer.cs.txt +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/DisplayLocalizationRes.Designer.cs.txt @@ -10,8 +10,8 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views { using System; - - + + /// /// A strongly-typed resource class, for looking up localized strings, etc. /// @@ -23,15 +23,15 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class DisplayLocalizationRes { - + private static global::System.Resources.ResourceManager resourceMan; - + private static global::System.Globalization.CultureInfo resourceCulture; - + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal DisplayLocalizationRes() { } - + /// /// Returns the cached ResourceManager instance used by this class. /// @@ -45,7 +45,7 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views { return resourceMan; } } - + /// /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. @@ -59,7 +59,7 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views { resourceCulture = value; } } - + /// /// Looks up a localized string similar to Details. /// @@ -68,7 +68,7 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views { return ResourceManager.GetString("DetailsCategory", resourceCulture); } } - + /// /// Looks up a localized string similar to Favorite actor 1 (no DisplayName). /// @@ -77,7 +77,7 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views { return ResourceManager.GetString("FavoriteActor1", resourceCulture); } } - + /// /// Looks up a localized string similar to This property's type is an enum whose values have no DisplayName attributes. These values displayed are provided by the ToString() method.. /// @@ -86,7 +86,7 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views { return ResourceManager.GetString("FavoriteActor1Desc", resourceCulture); } } - + /// /// Looks up a localized string similar to Favorite actor 2 (with DisplayName). /// @@ -95,7 +95,7 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views { return ResourceManager.GetString("FavoriteActor2", resourceCulture); } } - + /// /// Looks up a localized string similar to This property's type is an enum whose values are decorated with the ExtendedDisplayName attribute. Combined with the EnumDisplayNameConverter, this allows display values to be customized.. /// @@ -104,7 +104,7 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views { return ResourceManager.GetString("FavoriteActor2Desc", resourceCulture); } } - + /// /// Looks up a localized string similar to Favorite actor 3. /// @@ -113,7 +113,7 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views { return ResourceManager.GetString("FavoriteActor3", resourceCulture); } } - + /// /// Looks up a localized string similar to "(Not listed)" enum value shows that enum values can also be localized.. /// @@ -122,7 +122,7 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views { return ResourceManager.GetString("FavoriteActor3Desc", resourceCulture); } } - + /// /// Looks up a localized string similar to First name. /// @@ -131,7 +131,7 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views { return ResourceManager.GetString("FirstName", resourceCulture); } } - + /// /// Looks up a localized string similar to First name of that person. /// @@ -140,7 +140,7 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views { return ResourceManager.GetString("FirstNameDesc", resourceCulture); } } - + /// /// Looks up a localized string similar to Information. /// @@ -149,7 +149,7 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views { return ResourceManager.GetString("InfoCategory", resourceCulture); } } - + /// /// Looks up a localized string similar to Last name. /// @@ -158,7 +158,7 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views { return ResourceManager.GetString("LastName", resourceCulture); } } - + /// /// Looks up a localized string similar to Usually the familly name of the person. /// @@ -167,7 +167,7 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views { return ResourceManager.GetString("LastNameDesc", resourceCulture); } } - + /// /// Looks up a localized string similar to (Not listed). /// diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/DisplayLocalizationRes.fr.resx.txt b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/DisplayLocalizationRes.fr.resx.txt deleted file mode 100644 index c162964d..00000000 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/DisplayLocalizationRes.fr.resx.txt +++ /dev/null @@ -1,159 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Détails - - - Acteur favori 1 (aucun DisplayName) - - - Le type de cette propriété est un enum où les valeurs n'ont aucun attribut "DisplayName". Les valeurs affichées sont retournées par la méthode ToString(). - - - Acteur favori 2 (avec DisplayName) - - - Le type de cette propriété est un enum où les valeurs sont décorés avec l'attribut "DisplayName". Les valeurs affichées sont celles spécifiées par l'attribut ExtendedDisplayName. - - - Acteur favori 3 - - - La valeur "(Non proposé)" démontre que les valeurs des enums peuvent aussi être localisées. - - - Prénom - - - Prénom de la personne - - - Information - - - Nom de famille - - - Le nom de famille de la personne - - - (Non proposé) - - \ No newline at end of file diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/DisplayLocalizationRes.resx.txt b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/DisplayLocalizationRes.resx.txt deleted file mode 100644 index d4a8948e..00000000 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/DisplayLocalizationRes.resx.txt +++ /dev/null @@ -1,159 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Details - - - Favorite actor 1 (no DisplayName) - - - This property's type is an enum whose values have no DisplayName attributes. These values displayed are provided by the ToString() method. - - - Favorite actor 2 (with DisplayName) - - - This property's type is an enum whose values are decorated with the ExtendedDisplayName attribute. Combined with the EnumDisplayNameConverter, this allows display values to be customized. - - - Favorite actor 3 - - - "(Not listed)" enum value shows that enum values can also be localized. - - - First name - - - First name of that person - - - Information - - - Last name - - - Usually the familly name of the person - - - (Not listed) - - \ No newline at end of file diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/FilePickerView.xaml.cs.txt b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/FilePickerView.xaml.cs.txt index 53bd8cdb..81539c11 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/FilePickerView.xaml.cs.txt +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/FilePickerView.xaml.cs.txt @@ -28,7 +28,18 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.FilePicker.Views public FilePickerView() { InitializeComponent(); +#if !OPEN_SOURCE + _filePicker.SelectedFiles.CollectionChanged += this.SelectedFiles_CollectionChanged; +#endif } +#if !OPEN_SOURCE + private void SelectedFiles_CollectionChanged( object sender, NotifyCollectionChangedEventArgs e ) + { + //Refresh PrimitiveTypeCollectionControl.ItemsSource to be up to date with FilePicker.SelectedFiles. + _primitiveTypeCollectionControl.ItemsSource = null; + _primitiveTypeCollectionControl.ItemsSource = _filePicker.SelectedFiles; + } +#endif } -} +} \ No newline at end of file diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/FilePickerView.xaml.txt b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/FilePickerView.xaml.txt index af502785..42b66f1c 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/FilePickerView.xaml.txt +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/FilePickerView.xaml.txt @@ -26,6 +26,7 @@ The FilePicker is a control that can be used to select one or more files in a browsing window. + - - - - - - - - - - - - - - - - - - + + + + All files |*.* + Text Files |*.txt + Office Files |*.docx;*.xlsx;*.pptx + Image files |*.jpg;*.jpeg + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ListBoxView.xaml.cs.txt b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ListBoxView.xaml.cs.txt index 43c427f1..896d994b 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ListBoxView.xaml.cs.txt +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ListBoxView.xaml.cs.txt @@ -32,9 +32,17 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.ListBox.Views public ListBoxView() { +#if !OPEN_SOURCE + this.DataContext = SampleDataProvider.GetOrders(); +#endif InitializeComponent(); +#if !OPEN_SOURCE + //Add the default GroupDescriptions to the ListBox's GroupDescriptions collection. + _listBox.GroupDescriptions.Add( this.Resources[ "shipCountryGroupDescription" ] as GroupDescription ); + _listBox.GroupDescriptions.Add( this.Resources[ "shipCityGroupDescription" ] as GroupDescription ); +#endif } #endregion diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ListBoxView.xaml.txt b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ListBoxView.xaml.txt index 09566105..456a2e24 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ListBoxView.xaml.txt +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ListBoxView.xaml.txt @@ -29,6 +29,7 @@ Supports implicit styles, so the entire listbox can be styled in minutes with a couple of lines of code. Also supports explicit styles and Expression Blend. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ShipName + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaskedTextboxView.xaml.txt b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaskedTextboxView.xaml.txt index 43b235de..0479ffed 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaskedTextboxView.xaml.txt +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaskedTextboxView.xaml.txt @@ -25,7 +25,7 @@ The MaskedTextBox control lets you display and edit values based on a mask. - + diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialButtonView.xaml.cs.txt b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialButtonView.xaml.cs.txt index c14c6ab4..4e281da5 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialButtonView.xaml.cs.txt +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialButtonView.xaml.cs.txt @@ -31,5 +31,13 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.MaterialControls.Views InitializeComponent(); } +#if !OPEN_SOURCE + private void ModeComboBox_SelectionChanged( object sender, SelectionChangedEventArgs e ) + { + materialButton.Content = e.AddedItems[ 0 ].Equals( MaterialButtonModeEnum.Circle ) + ? ((ComboBoxItem)contentComboBox.Items.GetItemAt( 1 )).Tag + : ((ComboBoxItem)contentComboBox.Items.GetItemAt( 0 )).Tag; + } +#endif } } diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialButtonView.xaml.txt b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialButtonView.xaml.txt index ea6df55f..5314c036 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialButtonView.xaml.txt +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialButtonView.xaml.txt @@ -25,6 +25,7 @@ A Button with a raised animation on mouse over and a customizable ink animation on MousePress. It uses the Material Brushes. + - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialCheckBoxView.xaml.txt b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialCheckBoxView.xaml.txt index 24d054e0..fbebe6a1 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialCheckBoxView.xaml.txt +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialCheckBoxView.xaml.txt @@ -24,6 +24,7 @@ A CheckBox with transition animations when the checked state is changed. It uses the Material Brushes. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialComboBoxView.xaml.txt b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialComboBoxView.xaml.txt index e8d34ce2..431d839d 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialComboBoxView.xaml.txt +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialComboBoxView.xaml.txt @@ -26,6 +26,7 @@ MaterialComboBox is a ComboBox that is using the Material Brushes and contains MaterialComboBoxItems. MaterialComboBoxItems are ComboBoxItems that are using the Material Brushes. They use an ink animation when they are selected. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialControlsView.xaml.cs.txt b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialControlsView.xaml.cs.txt index 53fed7ff..1c12f905 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialControlsView.xaml.cs.txt +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialControlsView.xaml.cs.txt @@ -19,6 +19,12 @@ using System; using System.Collections.Generic; using System.Windows; using System.Windows.Controls; +#if !OPEN_SOURCE +using System.Windows.Input; +using System.Windows.Media.Animation; +using System.Windows.Threading; +using Xceed.Wpf.Toolkit.MaterialControls; +#endif namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.MaterialControls.Views { /// @@ -26,8 +32,15 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.MaterialControls.Views /// public partial class MaterialControlsView : MaterialDemoView { +#if !OPEN_SOURCE + #region Members + private Storyboard _toastStoryboard = new Storyboard(); + private Random _rand = new Random(); + private List _toastList = new List(); + #endregion +#endif #region Constructors @@ -38,22 +51,130 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.MaterialControls.Views #endregion +#if !OPEN_SOURCE + #region Private Methods + private int GetRandomInteger( int max ) + { + return _rand.Next( max ); + } + private void PopToast() + { + MaterialAccentEnum accent; + MaterialToastLocationEnum location; + string text; + + switch( this.GetRandomInteger( 8 ) ) + { + case 0: accent = MaterialAccentEnum.Blue; break; + case 1: accent = MaterialAccentEnum.LightBlue; break; + case 2: accent = MaterialAccentEnum.Cyan; break; + case 3: accent = MaterialAccentEnum.Teal; break; + case 4: accent = MaterialAccentEnum.Green; break; + case 5: accent = MaterialAccentEnum.LightGreen; break; + case 6: accent = MaterialAccentEnum.Lime; break; + default: accent = MaterialAccentEnum.Yellow; break; + } + switch( this.GetRandomInteger( 6 ) ) + { + case 0: location = MaterialToastLocationEnum.Bottom; break; + case 1: location = MaterialToastLocationEnum.BottomLeft; break; + case 2: location = MaterialToastLocationEnum.BottomRight; break; + case 3: location = MaterialToastLocationEnum.Top; break; + case 4: location = MaterialToastLocationEnum.TopLeft; break; + default: location = MaterialToastLocationEnum.TopRight; break; + } + switch( this.GetRandomInteger( 6 ) ) + { + case 0: text = "Warning"; break; + case 1: text = "New Appointments"; break; + case 2: text = "New Mail"; break; + case 3: text = "New Message"; break; + case 4: text = "Times Up!"; break; + default: text = "Task Completed!";break; + } + var materialToast = new MaterialToast( _toastGrid ); + materialToast.MaterialAccent = accent; + materialToast.Location = location; + materialToast.Content = text; + materialToast.DisplayTime = System.TimeSpan.FromMilliseconds( 3000 ); + materialToast.HideCompleted += this.MaterialToast_HideCompleted; + _toastList.Add( materialToast ); + materialToast.ShowToast(); + } + private void StartToastCircularProgressBar() + { + Storyboard storyboard = new Storyboard(); + var valueAnim = new DoubleAnimation( 0d, 100d, System.TimeSpan.FromMilliseconds( 3000 ) ); + Storyboard.SetTarget( valueAnim, _toastProgressBarCircular ); + Storyboard.SetTargetProperty( valueAnim, new PropertyPath( MaterialProgressBarCircular.ValueProperty ) ); + storyboard.Children.Add( valueAnim ); + storyboard.Completed += this.ToastCircularPropgressBarAnimation_Completed; + storyboard.Begin( _toastProgressBarCircular ); + } + #endregion + #region Event Handlers + private void MaterialProgressBar_MouseLeftButtonDown( object sender, MouseButtonEventArgs e ) + { + var progressBar = sender as MaterialProgressBarBase; + if( progressBar != null ) + { + var storyboard = new Storyboard(); + + // Animate ProgressBar + var valueAnim = new DoubleAnimation( progressBar.Minimum, progressBar.Maximum, System.TimeSpan.FromMilliseconds( 4000 ) ); + Storyboard.SetTarget( valueAnim, progressBar ); + Storyboard.SetTargetProperty( valueAnim, new PropertyPath( MaterialProgressBarBase.ValueProperty ) ); + storyboard.Children.Add( valueAnim ); + + storyboard.Begin( this ); + } + } + private void MaterialTabControl_SelectionChanged( object sender, SelectionChangedEventArgs e ) + { + var materialTabItem = e.AddedItems[ 0 ] as MaterialTabItem; + if( (materialTabItem != null) && materialTabItem.Equals( _materialTabItem5 ) ) + { + this.StartToastCircularProgressBar(); + } + else + { + foreach( var toast in _toastList ) + { + toast.HideToast(); + } + } + } + private void MaterialToast_HideCompleted( object sender, RoutedEventArgs e ) + { + _toastList.Remove( sender as MaterialToast ); + } + private void MaterialToastButton_Click( object sender, RoutedEventArgs e ) + { + this.PopToast(); + } + private void ToastCircularPropgressBarAnimation_Completed( object sender, EventArgs e ) + { + if( _materialTabControl.SelectedItem.Equals( _materialTabItem5 ) ) + { + this.PopToast(); + this.StartToastCircularProgressBar(); + } + } - - - + #endregion +#endif } } diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialControlsView.xaml.txt b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialControlsView.xaml.txt index 8bc7107c..2a609163 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialControlsView.xaml.txt +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialControlsView.xaml.txt @@ -27,6 +27,7 @@ The Material controls include a set of complimentary accent brush and foreground. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialDropDownView.xaml.txt b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialDropDownView.xaml.txt index a1917554..d11c5ecb 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialDropDownView.xaml.txt +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialDropDownView.xaml.txt @@ -24,6 +24,7 @@ A DropDownButton from the Xceed Wpf Toolkit with animations when opening the popup. It uses the MaterialButton animations and the Material Brushes. + - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialFrameView.xaml.txt b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialFrameView.xaml.txt index 6b87ebdc..06ea15a7 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialFrameView.xaml.txt +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialFrameView.xaml.txt @@ -26,6 +26,7 @@ A ContentControl with a fully customizable shadow that can be modified through Shadow properties or with a Z property that enables predefined shadows. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialListBoxView.xaml.txt b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialListBoxView.xaml.txt index d641473c..84e9cfb2 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialListBoxView.xaml.txt +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialListBoxView.xaml.txt @@ -27,6 +27,7 @@ MaterialListBox is a ListBox that is using the Material Brushes and contains MaterialListBoxItems. MaterialListBoxItems are ListBoxItems that are using the Material Brushes. They use an ink animation when they are selected. + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialProgressBarCircularView.xaml.cs.txt b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialProgressBarCircularView.xaml.cs.txt index 81e27e05..b349681f 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialProgressBarCircularView.xaml.cs.txt +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialProgressBarCircularView.xaml.cs.txt @@ -33,18 +33,45 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.MaterialControls.Views { InitializeComponent(); +#if !OPEN_SOURCE + this.Loaded += this.MaterialProgressBarCircularView_Loaded; +#endif } #endregion +#if !OPEN_SOURCE + #region Private Methods + private void AnimateDeterminateProgressBar() + { + var storyboard = new Storyboard(); + // Animate Determinate Circular ProgressBar + DoubleAnimation valueAnim = new DoubleAnimation( materialDeterminateProgressBarCircular.Minimum, materialDeterminateProgressBarCircular.Maximum, System.TimeSpan.FromMilliseconds( 4000 ) ); + Storyboard.SetTarget( valueAnim, materialDeterminateProgressBarCircular ); + Storyboard.SetTargetProperty( valueAnim, new PropertyPath( MaterialProgressBarCircular.ValueProperty ) ); + storyboard.Children.Add( valueAnim ); + storyboard.Begin( this ); + } + #endregion + #region Event Handlers + private void MaterialProgressBarCircularView_Loaded( object sender, RoutedEventArgs e ) + { + this.AnimateDeterminateProgressBar(); + } + private void ResetButton_Click( object sender, RoutedEventArgs e ) + { + this.AnimateDeterminateProgressBar(); + } + #endregion +#endif } } diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialProgressBarCircularView.xaml.txt b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialProgressBarCircularView.xaml.txt index 2b959a9f..ab1b5d57 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialProgressBarCircularView.xaml.txt +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialProgressBarCircularView.xaml.txt @@ -25,6 +25,7 @@ A circular ProgressBar that uses the Material Brushes. It contains properties to animate the indeterminate state. + @@ -43,18 +45,181 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +