Browse Source

Merge pull request #620 from jogibear9988/FixXamlDesignerInSD

Fix xaml designer in SD
pull/623/head
Siegfried Pammer 11 years ago
parent
commit
992dc62d2d
  1. 17
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Controls/EnumBar.xaml.cs
  2. 137
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Controls/GridUnitSelector.xaml.cs
  3. 18
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/ArrangeItemsContextMenu.xaml.cs
  4. 24
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/DefaultCommandsContextMenu.xaml.cs
  5. 17
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/EditStyleContextMenu.xaml.cs
  6. 17
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/RightClickContextMenu.xaml.cs
  7. 17
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/TextBlockRightClickContextMenu.xaml.cs
  8. 24
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/WrapItemContextMenu.xaml.cs
  9. 18
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/WrapItemsContextMenu.xaml.cs
  10. 17
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/OutlineView/Outline.xaml.cs
  11. 27
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/PropertyGrid/Editors/BoolEditor.xaml.cs
  12. 31
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/PropertyGrid/Editors/BrushEditor/BrushEditorPopup.xaml.cs
  13. 17
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/PropertyGrid/Editors/BrushEditor/BrushEditorView.xaml.cs
  14. 17
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/PropertyGrid/Editors/BrushEditor/BrushTypeEditor.xaml.cs
  15. 27
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/PropertyGrid/Editors/BrushEditor/GradientBrushEditor.xaml.cs
  16. 16
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/PropertyGrid/Editors/BrushEditor/GradientSlider.xaml.cs
  17. 26
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/PropertyGrid/Editors/BrushEditor/SolidBrushEditor.xaml.cs
  18. 17
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/PropertyGrid/Editors/CollectionEditor.xaml.cs
  19. 26
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/PropertyGrid/Editors/ColorEditor.xaml.cs
  20. 2
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/PropertyGrid/Editors/ComboBoxEditor.xaml
  21. 19
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/PropertyGrid/Editors/ComboBoxEditor.xaml.cs
  22. 25
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/PropertyGrid/Editors/EventEditor.xaml.cs
  23. 17
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/PropertyGrid/Editors/FlatCollectionEditor.xaml.cs
  24. 18
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/PropertyGrid/Editors/FormatedTextEditor/FormatedTextEditor.xaml.cs
  25. 26
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/PropertyGrid/Editors/NumberEditor.xaml.cs
  26. 17
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/PropertyGrid/Editors/OpenCollectionEditor.xaml.cs
  27. 2
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/PropertyGrid/Editors/TextBoxEditor.xaml
  28. 19
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/PropertyGrid/Editors/TextBoxEditor.xaml.cs
  29. 17
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/PropertyGrid/Editors/TimeSpanEditor.xaml.cs
  30. 17
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/PropertyGrid/PropertyContextMenu.xaml.cs
  31. 17
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Services/ChooseClassDialog.xaml.cs
  32. 15
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/WpfDesign.Designer.csproj
  33. 20
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Xaml/XamlDesignContext.cs
  34. 52
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/themes/VersionedAssemblyResourceDictionary.cs
  35. 17
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/themes/generic.xaml
  36. 2
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlParser.cs
  37. 31
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/PropertyGrid/EditorManager.cs
  38. 16
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/WpfDesign.csproj

17
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Controls/EnumBar.xaml.cs

@ -30,6 +30,7 @@ using System.Windows.Media.Imaging; @@ -30,6 +30,7 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Controls.Primitives;
using ICSharpCode.WpfDesign.Designer.themes;
namespace ICSharpCode.WpfDesign.Designer.Controls
{
@ -37,7 +38,21 @@ namespace ICSharpCode.WpfDesign.Designer.Controls @@ -37,7 +38,21 @@ namespace ICSharpCode.WpfDesign.Designer.Controls
{
public EnumBar()
{
InitializeComponent();
SpecialInitializeComponent();
}
/// <summary>
/// Fixes InitializeComponent with multiple Versions of same Assembly loaded
/// </summary>
public void SpecialInitializeComponent()
{
if (!this._contentLoaded) {
this._contentLoaded = true;
Uri resourceLocator = new Uri(VersionedAssemblyResourceDictionary.GetXamlNameForType(this.GetType()), UriKind.Relative);
Application.LoadComponent(this, resourceLocator);
}
this.InitializeComponent();
}
Type currentEnumType;

137
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Controls/GridUnitSelector.xaml.cs

@ -25,83 +25,98 @@ using System.Windows.Data; @@ -25,83 +25,98 @@ using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using ICSharpCode.WpfDesign.Designer.themes;
namespace ICSharpCode.WpfDesign.Designer.Controls
{
/// <summary>
/// Interaction logic for GridUnitSelector.xaml
/// </summary>
public partial class GridUnitSelector : UserControl
{
GridRailAdorner rail;
public partial class GridUnitSelector : UserControl
{
GridRailAdorner rail;
public GridUnitSelector(GridRailAdorner rail)
{
InitializeComponent();
public GridUnitSelector(GridRailAdorner rail)
{
SpecialInitializeComponent();
this.rail = rail;
}
this.rail = rail;
}
/// <summary>
/// Fixes InitializeComponent with multiple Versions of same Assembly loaded
/// </summary>
public void SpecialInitializeComponent()
{
if (!this._contentLoaded) {
this._contentLoaded = true;
Uri resourceLocator = new Uri(VersionedAssemblyResourceDictionary.GetXamlNameForType(this.GetType()), UriKind.Relative);
Application.LoadComponent(this, resourceLocator);
}
this.InitializeComponent();
}
void FixedChecked(object sender, RoutedEventArgs e)
{
this.rail.SetGridLengthUnit(Unit);
}
void FixedChecked(object sender, RoutedEventArgs e)
{
this.rail.SetGridLengthUnit(Unit);
}
void StarChecked(object sender, RoutedEventArgs e)
{
this.rail.SetGridLengthUnit(Unit);
}
void StarChecked(object sender, RoutedEventArgs e)
{
this.rail.SetGridLengthUnit(Unit);
}
void AutoChecked(object sender, RoutedEventArgs e)
{
this.rail.SetGridLengthUnit(Unit);
}
void AutoChecked(object sender, RoutedEventArgs e)
{
this.rail.SetGridLengthUnit(Unit);
}
public static readonly DependencyProperty OrientationProperty =
DependencyProperty.Register("Orientation", typeof(Orientation), typeof(GridUnitSelector),
new FrameworkPropertyMetadata());
public static readonly DependencyProperty OrientationProperty =
DependencyProperty.Register("Orientation", typeof(Orientation), typeof(GridUnitSelector),
new FrameworkPropertyMetadata());
public Orientation Orientation
{
get { return (Orientation)GetValue(OrientationProperty); }
set { SetValue(OrientationProperty, value); }
}
public Orientation Orientation
{
get { return (Orientation)GetValue(OrientationProperty); }
set { SetValue(OrientationProperty, value); }
}
public DesignItem SelectedItem { get; set; }
public DesignItem SelectedItem { get; set; }
public GridUnitType Unit
{
get
{
if (auto.IsChecked == true)
return GridUnitType.Auto;
if (star.IsChecked == true)
return GridUnitType.Star;
public GridUnitType Unit
{
get
{
if (auto.IsChecked == true)
return GridUnitType.Auto;
if (star.IsChecked == true)
return GridUnitType.Star;
return GridUnitType.Pixel;
}
set
{
switch (value)
{
case GridUnitType.Auto:
auto.IsChecked = true;
break;
case GridUnitType.Star:
star.IsChecked = true;
break;
default:
@fixed.IsChecked = true;
break;
}
}
return GridUnitType.Pixel;
}
set
{
switch (value)
{
case GridUnitType.Auto:
auto.IsChecked = true;
break;
case GridUnitType.Star:
star.IsChecked = true;
break;
default:
@fixed.IsChecked = true;
break;
}
}
}
protected override void OnMouseLeave(MouseEventArgs e)
{
base.OnMouseLeave(e);
this.Visibility = Visibility.Hidden;
}
}
}
protected override void OnMouseLeave(MouseEventArgs e)
{
base.OnMouseLeave(e);
this.Visibility = Visibility.Hidden;
}
}
}

18
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/ArrangeItemsContextMenu.xaml.cs

@ -18,6 +18,8 @@ @@ -18,6 +18,8 @@
using System;
using System.Linq;
using System.Windows;
using ICSharpCode.WpfDesign.Designer.themes;
namespace ICSharpCode.WpfDesign.Designer.Extensions
{
@ -29,7 +31,21 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions @@ -29,7 +31,21 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
{
this.designItem = designItem;
InitializeComponent();
SpecialInitializeComponent();
}
/// <summary>
/// Fixes InitializeComponent with multiple Versions of same Assembly loaded
/// </summary>
public void SpecialInitializeComponent()
{
if (!this._contentLoaded) {
this._contentLoaded = true;
Uri resourceLocator = new Uri(VersionedAssemblyResourceDictionary.GetXamlNameForType(this.GetType()), UriKind.Relative);
Application.LoadComponent(this, resourceLocator);
}
this.InitializeComponent();
}
void Click_ArrangeLeft(object sender, System.Windows.RoutedEventArgs e)

24
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/DefaultCommandsContextMenu.xaml.cs

@ -17,15 +17,9 @@ @@ -17,15 +17,9 @@
// DEALINGS IN THE SOFTWARE.
using System;
using System.IO;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Markup;
using System.Xml;
using ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors.FormatedTextEditor;
using ICSharpCode.WpfDesign.Designer.Xaml;
using ICSharpCode.WpfDesign.XamlDom;
using ICSharpCode.WpfDesign.Designer.themes;
namespace ICSharpCode.WpfDesign.Designer.Extensions
{
@ -37,7 +31,21 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions @@ -37,7 +31,21 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
{
this.designItem = designItem;
InitializeComponent();
SpecialInitializeComponent();
}
/// <summary>
/// Fixes InitializeComponent with multiple Versions of same Assembly loaded
/// </summary>
public void SpecialInitializeComponent()
{
if (!this._contentLoaded) {
this._contentLoaded = true;
Uri resourceLocator = new Uri(VersionedAssemblyResourceDictionary.GetXamlNameForType(this.GetType()), UriKind.Relative);
Application.LoadComponent(this, resourceLocator);
}
this.InitializeComponent();
}
}
}

17
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/EditStyleContextMenu.xaml.cs

@ -26,6 +26,7 @@ using System.Xml; @@ -26,6 +26,7 @@ using System.Xml;
using ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors.FormatedTextEditor;
using ICSharpCode.WpfDesign.Designer.Xaml;
using ICSharpCode.WpfDesign.XamlDom;
using ICSharpCode.WpfDesign.Designer.themes;
namespace ICSharpCode.WpfDesign.Designer.Extensions
{
@ -37,7 +38,21 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions @@ -37,7 +38,21 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
{
this.designItem = designItem;
InitializeComponent();
SpecialInitializeComponent();
}
/// <summary>
/// Fixes InitializeComponent with multiple Versions of same Assembly loaded
/// </summary>
public void SpecialInitializeComponent()
{
if (!this._contentLoaded) {
this._contentLoaded = true;
Uri resourceLocator = new Uri(VersionedAssemblyResourceDictionary.GetXamlNameForType(this.GetType()), UriKind.Relative);
Application.LoadComponent(this, resourceLocator);
}
this.InitializeComponent();
}
void Click_EditStyle(object sender, RoutedEventArgs e)

17
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/RightClickContextMenu.xaml.cs

@ -20,6 +20,7 @@ using System; @@ -20,6 +20,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using ICSharpCode.WpfDesign.Designer.themes;
namespace ICSharpCode.WpfDesign.Designer.Extensions
{
@ -31,7 +32,21 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions @@ -31,7 +32,21 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
{
this.designItem = designItem;
InitializeComponent();
SpecialInitializeComponent();
}
/// <summary>
/// Fixes InitializeComponent with multiple Versions of same Assembly loaded
/// </summary>
public void SpecialInitializeComponent()
{
if (!this._contentLoaded) {
this._contentLoaded = true;
Uri resourceLocator = new Uri(VersionedAssemblyResourceDictionary.GetXamlNameForType(this.GetType()), UriKind.Relative);
Application.LoadComponent(this, resourceLocator);
}
this.InitializeComponent();
}
void Click_BringToFront(object sender, RoutedEventArgs e)

17
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/TextBlockRightClickContextMenu.xaml.cs

@ -21,6 +21,7 @@ using System.Linq; @@ -21,6 +21,7 @@ using System.Linq;
using System.Windows;
using ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors.FormatedTextEditor;
using ICSharpCode.WpfDesign.Designer.UIExtensions;
using ICSharpCode.WpfDesign.Designer.themes;
namespace ICSharpCode.WpfDesign.Designer.Extensions
{
@ -32,7 +33,21 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions @@ -32,7 +33,21 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
{
this.designItem = designItem;
InitializeComponent();
SpecialInitializeComponent();
}
/// <summary>
/// Fixes InitializeComponent with multiple Versions of same Assembly loaded
/// </summary>
public void SpecialInitializeComponent()
{
if (!this._contentLoaded) {
this._contentLoaded = true;
Uri resourceLocator = new Uri(VersionedAssemblyResourceDictionary.GetXamlNameForType(this.GetType()), UriKind.Relative);
Application.LoadComponent(this, resourceLocator);
}
this.InitializeComponent();
}
void Click_EditFormatedText(object sender, RoutedEventArgs e)

24
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/WrapItemContextMenu.xaml.cs

@ -18,7 +18,9 @@ @@ -18,7 +18,9 @@
using System;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using ICSharpCode.WpfDesign.Designer.themes;
namespace ICSharpCode.WpfDesign.Designer.Extensions
{
@ -26,16 +28,30 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions @@ -26,16 +28,30 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
{
private DesignItem designItem;
public WrapItemContextMenu(DesignItem designItem)
public WrapItemContextMenu(DesignItem designItem)
{
this.designItem = designItem;
InitializeComponent();
SpecialInitializeComponent();
}
/// <summary>
/// Fixes InitializeComponent with multiple Versions of same Assembly loaded
/// </summary>
public void SpecialInitializeComponent()
{
if (!this._contentLoaded) {
this._contentLoaded = true;
Uri resourceLocator = new Uri(VersionedAssemblyResourceDictionary.GetXamlNameForType(this.GetType()), UriKind.Relative);
Application.LoadComponent(this, resourceLocator);
}
this.InitializeComponent();
}
void Click_WrapInViewbox(object sender, System.Windows.RoutedEventArgs e)
void Click_WrapInViewbox(object sender, System.Windows.RoutedEventArgs e)
{
ModelTools.WrapItemsNewContainer(this.designItem.Services.Selection.SelectedItems, typeof(Viewbox));
}
}
}
}

18
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/WrapItemsContextMenu.xaml.cs

@ -18,7 +18,9 @@ @@ -18,7 +18,9 @@
using System;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using ICSharpCode.WpfDesign.Designer.themes;
namespace ICSharpCode.WpfDesign.Designer.Extensions
{
@ -30,7 +32,21 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions @@ -30,7 +32,21 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
{
this.designItem = designItem;
InitializeComponent();
SpecialInitializeComponent();
}
/// <summary>
/// Fixes InitializeComponent with multiple Versions of same Assembly loaded
/// </summary>
public void SpecialInitializeComponent()
{
if (!this._contentLoaded) {
this._contentLoaded = true;
Uri resourceLocator = new Uri(VersionedAssemblyResourceDictionary.GetXamlNameForType(this.GetType()), UriKind.Relative);
Application.LoadComponent(this, resourceLocator);
}
this.InitializeComponent();
}
void Click_WrapInCanvas(object sender, System.Windows.RoutedEventArgs e)

17
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/OutlineView/Outline.xaml.cs

@ -29,6 +29,7 @@ using System.Windows.Media; @@ -29,6 +29,7 @@ using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using ICSharpCode.WpfDesign.Designer.themes;
namespace ICSharpCode.WpfDesign.Designer.OutlineView
{
@ -36,7 +37,21 @@ namespace ICSharpCode.WpfDesign.Designer.OutlineView @@ -36,7 +37,21 @@ namespace ICSharpCode.WpfDesign.Designer.OutlineView
{
public Outline()
{
InitializeComponent();
SpecialInitializeComponent();
}
/// <summary>
/// Fixes InitializeComponent with multiple Versions of same Assembly loaded
/// </summary>
public void SpecialInitializeComponent()
{
if (!this._contentLoaded) {
this._contentLoaded = true;
Uri resourceLocator = new Uri(VersionedAssemblyResourceDictionary.GetXamlNameForType(this.GetType()), UriKind.Relative);
Application.LoadComponent(this, resourceLocator);
}
this.InitializeComponent();
}
public static readonly DependencyProperty RootProperty =

27
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/PropertyGrid/Editors/BoolEditor.xaml.cs

@ -17,19 +17,10 @@ @@ -17,19 +17,10 @@
// DEALINGS IN THE SOFTWARE.
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 ICSharpCode.WpfDesign.PropertyGrid;
using ICSharpCode.WpfDesign.Designer.themes;
namespace ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors
{
@ -38,7 +29,21 @@ namespace ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors @@ -38,7 +29,21 @@ namespace ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors
{
public BoolEditor()
{
InitializeComponent();
SpecialInitializeComponent();
}
/// <summary>
/// Fixes InitializeComponent with multiple Versions of same Assembly loaded
/// </summary>
public void SpecialInitializeComponent()
{
if (!this._contentLoaded) {
this._contentLoaded = true;
Uri resourceLocator = new Uri(VersionedAssemblyResourceDictionary.GetXamlNameForType(this.GetType()), UriKind.Relative);
Application.LoadComponent(this, resourceLocator);
}
this.InitializeComponent();
}
}
}

31
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/PropertyGrid/Editors/BrushEditor/BrushEditorPopup.xaml.cs

@ -17,19 +17,10 @@ @@ -17,19 +17,10 @@
// DEALINGS IN THE SOFTWARE.
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.Diagnostics;
using ICSharpCode.WpfDesign.Designer.themes;
namespace ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors.BrushEditor
{
@ -37,13 +28,27 @@ namespace ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors.BrushEditor @@ -37,13 +28,27 @@ namespace ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors.BrushEditor
{
public BrushEditorPopup()
{
InitializeComponent();
SpecialInitializeComponent();
}
/// <summary>
/// Fixes InitializeComponent with multiple Versions of same Assembly loaded
/// </summary>
public void SpecialInitializeComponent()
{
if (!this._contentLoaded) {
this._contentLoaded = true;
Uri resourceLocator = new Uri(VersionedAssemblyResourceDictionary.GetXamlNameForType(this.GetType()), UriKind.Relative);
Application.LoadComponent(this, resourceLocator);
}
this.InitializeComponent();
}
protected override void OnClosed(EventArgs e)
{
base.OnClosed(e);
BrushEditorView.BrushEditor.Commit();
base.OnClosed(e);
BrushEditorView.BrushEditor.Commit();
}
protected override void OnKeyDown(KeyEventArgs e)

17
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/PropertyGrid/Editors/BrushEditor/BrushEditorView.xaml.cs

@ -31,6 +31,7 @@ using System.Windows.Navigation; @@ -31,6 +31,7 @@ using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Diagnostics;
using System.Globalization;
using ICSharpCode.WpfDesign.Designer.themes;
namespace ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors.BrushEditor
{
@ -41,12 +42,26 @@ namespace ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors.BrushEditor @@ -41,12 +42,26 @@ namespace ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors.BrushEditor
BrushEditor = new BrushEditor();
DataContext = BrushEditor;
InitializeComponent();
SpecialInitializeComponent();
SetBinding(HeightProperty, new Binding("Brush") {
Converter = HeightConverter.Instance
});
}
/// <summary>
/// Fixes InitializeComponent with multiple Versions of same Assembly loaded
/// </summary>
public void SpecialInitializeComponent()
{
if (!this._contentLoaded) {
this._contentLoaded = true;
Uri resourceLocator = new Uri(VersionedAssemblyResourceDictionary.GetXamlNameForType(this.GetType()), UriKind.Relative);
Application.LoadComponent(this, resourceLocator);
}
this.InitializeComponent();
}
public BrushEditor BrushEditor { get; private set; }

17
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/PropertyGrid/Editors/BrushEditor/BrushTypeEditor.xaml.cs

@ -31,6 +31,7 @@ using System.Windows.Navigation; @@ -31,6 +31,7 @@ using System.Windows.Navigation;
using System.Windows.Shapes;
using ICSharpCode.WpfDesign.PropertyGrid;
using System.Windows.Controls.Primitives;
using ICSharpCode.WpfDesign.Designer.themes;
namespace ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors.BrushEditor
{
@ -39,7 +40,21 @@ namespace ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors.BrushEditor @@ -39,7 +40,21 @@ namespace ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors.BrushEditor
{
public BrushTypeEditor()
{
InitializeComponent();
SpecialInitializeComponent();
}
/// <summary>
/// Fixes InitializeComponent with multiple Versions of same Assembly loaded
/// </summary>
public void SpecialInitializeComponent()
{
if (!this._contentLoaded) {
this._contentLoaded = true;
Uri resourceLocator = new Uri(VersionedAssemblyResourceDictionary.GetXamlNameForType(this.GetType()), UriKind.Relative);
Application.LoadComponent(this, resourceLocator);
}
this.InitializeComponent();
}
static BrushEditorPopup brushEditorPopup = new BrushEditorPopup();

27
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/PropertyGrid/Editors/BrushEditor/GradientBrushEditor.xaml.cs

@ -17,18 +17,9 @@ @@ -17,18 +17,9 @@
// DEALINGS IN THE SOFTWARE.
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 ICSharpCode.WpfDesign.Designer.themes;
namespace ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors.BrushEditor
{
@ -36,7 +27,21 @@ namespace ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors.BrushEditor @@ -36,7 +27,21 @@ namespace ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors.BrushEditor
{
public GradientBrushEditor()
{
InitializeComponent();
SpecialInitializeComponent();
}
/// <summary>
/// Fixes InitializeComponent with multiple Versions of same Assembly loaded
/// </summary>
public void SpecialInitializeComponent()
{
if (!this._contentLoaded) {
this._contentLoaded = true;
Uri resourceLocator = new Uri(VersionedAssemblyResourceDictionary.GetXamlNameForType(this.GetType()), UriKind.Relative);
Application.LoadComponent(this, resourceLocator);
}
this.InitializeComponent();
}
}
}

16
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/PropertyGrid/Editors/BrushEditor/GradientSlider.xaml.cs

@ -31,6 +31,7 @@ using System.Windows.Navigation; @@ -31,6 +31,7 @@ using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Controls.Primitives;
using System.ComponentModel;
using ICSharpCode.WpfDesign.Designer.themes;
namespace ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors.BrushEditor
{
@ -38,7 +39,7 @@ namespace ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors.BrushEditor @@ -38,7 +39,7 @@ namespace ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors.BrushEditor
{
public GradientSlider()
{
InitializeComponent();
SpecialInitializeComponent();
BindingOperations.SetBinding(this, SelectedStopProperty, new Binding("SelectedItem") {
Source = itemsControl,
@ -49,6 +50,19 @@ namespace ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors.BrushEditor @@ -49,6 +50,19 @@ namespace ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors.BrushEditor
strip.DragDelta += new DragDeltaEventHandler(strip_DragDelta);
}
/// <summary>
/// Fixes InitializeComponent with multiple Versions of same Assembly loaded
/// </summary>
public void SpecialInitializeComponent()
{
if (!this._contentLoaded) {
this._contentLoaded = true;
Uri resourceLocator = new Uri(VersionedAssemblyResourceDictionary.GetXamlNameForType(this.GetType()), UriKind.Relative);
Application.LoadComponent(this, resourceLocator);
}
this.InitializeComponent();
}
static GradientSlider()
{
EventManager.RegisterClassHandler(typeof(GradientSlider),

26
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/PropertyGrid/Editors/BrushEditor/SolidBrushEditor.xaml.cs

@ -17,18 +17,10 @@ @@ -17,18 +17,10 @@
// DEALINGS IN THE SOFTWARE.
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 ICSharpCode.WpfDesign.Designer.themes;
namespace ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors.BrushEditor
{
@ -36,7 +28,21 @@ namespace ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors.BrushEditor @@ -36,7 +28,21 @@ namespace ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors.BrushEditor
{
public SolidBrushEditor()
{
InitializeComponent();
SpecialInitializeComponent();
}
/// <summary>
/// Fixes InitializeComponent with multiple Versions of same Assembly loaded
/// </summary>
public void SpecialInitializeComponent()
{
if (!this._contentLoaded) {
this._contentLoaded = true;
Uri resourceLocator = new Uri(VersionedAssemblyResourceDictionary.GetXamlNameForType(this.GetType()), UriKind.Relative);
Application.LoadComponent(this, resourceLocator);
}
this.InitializeComponent();
}
public static readonly DependencyProperty ColorProperty =

17
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/PropertyGrid/Editors/CollectionEditor.xaml.cs

@ -28,6 +28,7 @@ using System.Windows.Documents; @@ -28,6 +28,7 @@ using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using ICSharpCode.WpfDesign.Designer.OutlineView;
using ICSharpCode.WpfDesign.Designer.themes;
namespace ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors
{
@ -49,11 +50,25 @@ namespace ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors @@ -49,11 +50,25 @@ namespace ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors
private IComponentService _componentService;
public CollectionEditor()
{
InitializeComponent();
SpecialInitializeComponent();
this.Owner = Application.Current.MainWindow;
}
/// <summary>
/// Fixes InitializeComponent with multiple Versions of same Assembly loaded
/// </summary>
public void SpecialInitializeComponent()
{
if (!this._contentLoaded) {
this._contentLoaded = true;
Uri resourceLocator = new Uri(VersionedAssemblyResourceDictionary.GetXamlNameForType(this.GetType()), UriKind.Relative);
Application.LoadComponent(this, resourceLocator);
}
this.InitializeComponent();
}
public void LoadItemsCollection(DesignItem item)
{
Debug.Assert(item.View is ItemsControl);

26
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/PropertyGrid/Editors/ColorEditor.xaml.cs

@ -2,19 +2,11 @@ @@ -2,19 +2,11 @@
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
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 ICSharpCode.WpfDesign.PropertyGrid;
using ICSharpCode.WpfDesign.Designer.themes;
namespace ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors
{
@ -23,7 +15,21 @@ namespace ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors @@ -23,7 +15,21 @@ namespace ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors
{
public ColorEditor()
{
InitializeComponent();
SpecialInitializeComponent();
}
/// <summary>
/// Fixes InitializeComponent with multiple Versions of same Assembly loaded
/// </summary>
public void SpecialInitializeComponent()
{
if (!this._contentLoaded) {
this._contentLoaded = true;
Uri resourceLocator = new Uri(VersionedAssemblyResourceDictionary.GetXamlNameForType(this.GetType()), UriKind.Relative);
Application.LoadComponent(this, resourceLocator);
}
this.InitializeComponent();
}
}
}

2
src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/PropertyGrid/Editors/ComboBoxEditor.xaml → src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/PropertyGrid/Editors/ComboBoxEditor.xaml

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
<ComboBox
x:Class="ICSharpCode.WpfDesign.PropertyGrid.Editors.ComboBoxEditor"
x:Class="ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors.ComboBoxEditor"
xmlns="http://schemas.microsoft.com/netfx/2007/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
BorderThickness="0"

19
src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/PropertyGrid/Editors/ComboBoxEditor.xaml.cs → src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/PropertyGrid/Editors/ComboBoxEditor.xaml.cs

@ -31,8 +31,9 @@ using System.Windows.Navigation; @@ -31,8 +31,9 @@ using System.Windows.Navigation;
using System.Windows.Shapes;
using ICSharpCode.WpfDesign.PropertyGrid;
using System.Windows.Controls.Primitives;
using ICSharpCode.WpfDesign.Designer.themes;
namespace ICSharpCode.WpfDesign.PropertyGrid.Editors
namespace ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors
{
[TypeEditor(typeof(Enum))]
public partial class ComboBoxEditor
@ -42,9 +43,23 @@ namespace ICSharpCode.WpfDesign.PropertyGrid.Editors @@ -42,9 +43,23 @@ namespace ICSharpCode.WpfDesign.PropertyGrid.Editors
/// </summary>
public ComboBoxEditor()
{
InitializeComponent();
SpecialInitializeComponent();
}
/// <summary>
/// Fixes InitializeComponent with multiple Versions of same Assembly loaded
/// </summary>
public void SpecialInitializeComponent()
{
if (!this._contentLoaded) {
this._contentLoaded = true;
Uri resourceLocator = new Uri(VersionedAssemblyResourceDictionary.GetXamlNameForType(this.GetType()), UriKind.Relative);
Application.LoadComponent(this, resourceLocator);
}
this.InitializeComponent();
}
/// <inheritdoc/>
public override void OnApplyTemplate()
{

25
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/PropertyGrid/Editors/EventEditor.xaml.cs

@ -17,19 +17,12 @@ @@ -17,19 +17,12 @@
// DEALINGS IN THE SOFTWARE.
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 ICSharpCode.WpfDesign.PropertyGrid;
using ICSharpCode.WpfDesign.Designer.themes;
namespace ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors
{
@ -38,7 +31,21 @@ namespace ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors @@ -38,7 +31,21 @@ namespace ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors
{
public EventEditor()
{
InitializeComponent();
SpecialInitializeComponent();
}
/// <summary>
/// Fixes InitializeComponent with multiple Versions of same Assembly loaded
/// </summary>
public void SpecialInitializeComponent()
{
if (!this._contentLoaded) {
this._contentLoaded = true;
Uri resourceLocator = new Uri(VersionedAssemblyResourceDictionary.GetXamlNameForType(this.GetType()), UriKind.Relative);
Application.LoadComponent(this, resourceLocator);
}
this.InitializeComponent();
}
public PropertyNode PropertyNode {

17
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/PropertyGrid/Editors/FlatCollectionEditor.xaml.cs

@ -30,6 +30,7 @@ using System.Windows.Input; @@ -30,6 +30,7 @@ using System.Windows.Input;
using System.Windows.Media;
using System.Linq;
using ICSharpCode.WpfDesign.Designer.OutlineView;
using ICSharpCode.WpfDesign.Designer.themes;
namespace ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors
{
@ -52,11 +53,25 @@ namespace ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors @@ -52,11 +53,25 @@ namespace ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors
public FlatCollectionEditor()
{
InitializeComponent();
SpecialInitializeComponent();
this.Owner = Application.Current.MainWindow;
}
/// <summary>
/// Fixes InitializeComponent with multiple Versions of same Assembly loaded
/// </summary>
public void SpecialInitializeComponent()
{
if (!this._contentLoaded) {
this._contentLoaded = true;
Uri resourceLocator = new Uri(VersionedAssemblyResourceDictionary.GetXamlNameForType(this.GetType()), UriKind.Relative);
Application.LoadComponent(this, resourceLocator);
}
this.InitializeComponent();
}
public Type GetItemsSourceType(Type t)
{
Type tp = t.GetInterfaces().FirstOrDefault(x => x.IsGenericType && x.GetGenericTypeDefinition() == typeof(ICollection<>));

18
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/PropertyGrid/Editors/FormatedTextEditor/FormatedTextEditor.xaml.cs

@ -16,6 +16,7 @@ @@ -16,6 +16,7 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
@ -24,6 +25,7 @@ using System.Windows.Documents; @@ -24,6 +25,7 @@ using System.Windows.Documents;
using System.Windows.Media;
using ICSharpCode.WpfDesign.Designer.Xaml;
using ICSharpCode.WpfDesign.Designer.UIExtensions;
using ICSharpCode.WpfDesign.Designer.themes;
namespace ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors.FormatedTextEditor
{
@ -36,7 +38,7 @@ namespace ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors.FormatedTextEditor @@ -36,7 +38,7 @@ namespace ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors.FormatedTextEditor
public FormatedTextEditor(DesignItem designItem)
{
InitializeComponent();
SpecialInitializeComponent();
this.designItem = designItem;
@ -53,6 +55,20 @@ namespace ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors.FormatedTextEditor @@ -53,6 +55,20 @@ namespace ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors.FormatedTextEditor
richTextBox.Foreground = tb.Foreground;
richTextBox.Background = tb.Background;
}
/// <summary>
/// Fixes InitializeComponent with multiple Versions of same Assembly loaded
/// </summary>
public void SpecialInitializeComponent()
{
if (!this._contentLoaded) {
this._contentLoaded = true;
Uri resourceLocator = new Uri(VersionedAssemblyResourceDictionary.GetXamlNameForType(this.GetType()), UriKind.Relative);
Application.LoadComponent(this, resourceLocator);
}
this.InitializeComponent();
}
private void GetDesignItems(TextElementCollection<Block> blocks, List<DesignItem> list)
{

26
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/PropertyGrid/Editors/NumberEditor.xaml.cs

@ -19,18 +19,11 @@ @@ -19,18 +19,11 @@
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 ICSharpCode.WpfDesign.PropertyGrid;
using System.Reflection;
using ICSharpCode.WpfDesign.Designer.themes;
namespace ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors
{
@ -76,10 +69,23 @@ namespace ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors @@ -76,10 +69,23 @@ namespace ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors
public NumberEditor()
{
InitializeComponent();
SpecialInitializeComponent();
DataContextChanged += new DependencyPropertyChangedEventHandler(NumberEditor_DataContextChanged);
}
/// <summary>
/// Fixes InitializeComponent with multiple Versions of same Assembly loaded
/// </summary>
public void SpecialInitializeComponent()
{
if (!this._contentLoaded) {
this._contentLoaded = true;
Uri resourceLocator = new Uri(VersionedAssemblyResourceDictionary.GetXamlNameForType(this.GetType()), UriKind.Relative);
Application.LoadComponent(this, resourceLocator);
}
this.InitializeComponent();
}
static Dictionary<Type, double> minimums = new Dictionary<Type, double>();
static Dictionary<Type, double> maximums = new Dictionary<Type, double>();

17
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/PropertyGrid/Editors/OpenCollectionEditor.xaml.cs

@ -14,6 +14,7 @@ using System.Windows.Navigation; @@ -14,6 +14,7 @@ using System.Windows.Navigation;
using System.Windows.Shapes;
using ICSharpCode.WpfDesign.PropertyGrid;
using ICSharpCode.WpfDesign.Designer.themes;
//using Xceed.Wpf.Toolkit;
namespace ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors
@ -23,7 +24,21 @@ namespace ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors @@ -23,7 +24,21 @@ namespace ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors
{
public OpenCollectionEditor()
{
InitializeComponent();
SpecialInitializeComponent();
}
/// <summary>
/// Fixes InitializeComponent with multiple Versions of same Assembly loaded
/// </summary>
public void SpecialInitializeComponent()
{
if (!this._contentLoaded) {
this._contentLoaded = true;
Uri resourceLocator = new Uri(VersionedAssemblyResourceDictionary.GetXamlNameForType(this.GetType()), UriKind.Relative);
Application.LoadComponent(this, resourceLocator);
}
this.InitializeComponent();
}
void open_Click(object sender, RoutedEventArgs e)

2
src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/PropertyGrid/Editors/TextBoxEditor.xaml → src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/PropertyGrid/Editors/TextBoxEditor.xaml

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
<TextBox
x:Class="ICSharpCode.WpfDesign.PropertyGrid.Editors.TextBoxEditor"
x:Class="ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors.TextBoxEditor"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Text="{Binding ValueString}"

19
src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/PropertyGrid/Editors/TextBoxEditor.xaml.cs → src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/PropertyGrid/Editors/TextBoxEditor.xaml.cs

@ -29,8 +29,9 @@ using System.Windows.Media; @@ -29,8 +29,9 @@ using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using ICSharpCode.WpfDesign.Designer.themes;
namespace ICSharpCode.WpfDesign.PropertyGrid.Editors
namespace ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors
{
public partial class TextBoxEditor
{
@ -39,7 +40,21 @@ namespace ICSharpCode.WpfDesign.PropertyGrid.Editors @@ -39,7 +40,21 @@ namespace ICSharpCode.WpfDesign.PropertyGrid.Editors
/// </summary>
public TextBoxEditor()
{
InitializeComponent();
SpecialInitializeComponent();
}
/// <summary>
/// Fixes InitializeComponent with multiple Versions of same Assembly loaded
/// </summary>
public void SpecialInitializeComponent()
{
if (!this._contentLoaded) {
this._contentLoaded = true;
Uri resourceLocator = new Uri(VersionedAssemblyResourceDictionary.GetXamlNameForType(this.GetType()), UriKind.Relative);
Application.LoadComponent(this, resourceLocator);
}
this.InitializeComponent();
}
/// <inheritdoc/>

17
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/PropertyGrid/Editors/TimeSpanEditor.xaml.cs

@ -15,6 +15,7 @@ using System.Windows.Media.Imaging; @@ -15,6 +15,7 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using ICSharpCode.WpfDesign.PropertyGrid;
using ICSharpCode.WpfDesign.Designer.themes;
namespace ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors
@ -24,7 +25,21 @@ namespace ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors @@ -24,7 +25,21 @@ namespace ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors
{
public TimeSpanEditor()
{
InitializeComponent();
SpecialInitializeComponent();
}
/// <summary>
/// Fixes InitializeComponent with multiple Versions of same Assembly loaded
/// </summary>
public void SpecialInitializeComponent()
{
if (!this._contentLoaded) {
this._contentLoaded = true;
Uri resourceLocator = new Uri(VersionedAssemblyResourceDictionary.GetXamlNameForType(this.GetType()), UriKind.Relative);
Application.LoadComponent(this, resourceLocator);
}
this.InitializeComponent();
}
}
}

17
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/PropertyGrid/PropertyContextMenu.xaml.cs

@ -30,6 +30,7 @@ using System.Windows.Media.Imaging; @@ -30,6 +30,7 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using ICSharpCode.WpfDesign.PropertyGrid;
using ICSharpCode.WpfDesign.Designer.themes;
namespace ICSharpCode.WpfDesign.Designer.PropertyGrid
{
@ -37,9 +38,23 @@ namespace ICSharpCode.WpfDesign.Designer.PropertyGrid @@ -37,9 +38,23 @@ namespace ICSharpCode.WpfDesign.Designer.PropertyGrid
{
public PropertyContextMenu()
{
InitializeComponent();
SpecialInitializeComponent();
}
/// <summary>
/// Fixes InitializeComponent with multiple Versions of same Assembly loaded
/// </summary>
public void SpecialInitializeComponent()
{
if (!this._contentLoaded) {
this._contentLoaded = true;
Uri resourceLocator = new Uri(VersionedAssemblyResourceDictionary.GetXamlNameForType(this.GetType()), UriKind.Relative);
Application.LoadComponent(this, resourceLocator);
}
this.InitializeComponent();
}
public PropertyNode PropertyNode {
get { return DataContext as PropertyNode; }
}

17
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Services/ChooseClassDialog.xaml.cs

@ -25,6 +25,7 @@ using System.Windows.Controls; @@ -25,6 +25,7 @@ using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data;
using System.Windows.Input;
using ICSharpCode.WpfDesign.Designer.themes;
namespace ICSharpCode.WpfDesign.Designer.Services
{
@ -33,7 +34,7 @@ namespace ICSharpCode.WpfDesign.Designer.Services @@ -33,7 +34,7 @@ namespace ICSharpCode.WpfDesign.Designer.Services
public ChooseClassDialog(ChooseClass core)
{
DataContext = core;
InitializeComponent();
SpecialInitializeComponent();
uxFilter.Focus();
uxList.MouseDoubleClick += uxList_MouseDoubleClick;
@ -46,6 +47,20 @@ namespace ICSharpCode.WpfDesign.Designer.Services @@ -46,6 +47,20 @@ namespace ICSharpCode.WpfDesign.Designer.Services
true);
}
/// <summary>
/// Fixes InitializeComponent with multiple Versions of same Assembly loaded
/// </summary>
public void SpecialInitializeComponent()
{
if (!this._contentLoaded) {
this._contentLoaded = true;
Uri resourceLocator = new Uri(VersionedAssemblyResourceDictionary.GetXamlNameForType(this.GetType()), UriKind.Relative);
Application.LoadComponent(this, resourceLocator);
}
this.InitializeComponent();
}
//HACK: listbox is always highlighted
public static DependencyPropertyKey IsSelectionActivePropertyKey =
(DependencyPropertyKey)typeof(Selector).GetField("IsSelectionActivePropertyKey",

15
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/WpfDesign.Designer.csproj

@ -124,6 +124,9 @@ @@ -124,6 +124,9 @@
<Compile Include="PropertyGrid\Editors\ColorEditor.xaml.cs">
<DependentUpon>ColorEditor.xaml</DependentUpon>
</Compile>
<Compile Include="PropertyGrid\Editors\ComboBoxEditor.xaml.cs">
<DependentUpon>ComboBoxEditor.xaml</DependentUpon>
</Compile>
<Compile Include="PropertyGrid\Editors\FlatCollectionEditor.xaml.cs">
<DependentUpon>FlatCollectionEditor.xaml</DependentUpon>
<SubType>Code</SubType>
@ -134,9 +137,13 @@ @@ -134,9 +137,13 @@
<Compile Include="PropertyGrid\Editors\OpenCollectionEditor.xaml.cs">
<DependentUpon>OpenCollectionEditor.xaml</DependentUpon>
</Compile>
<Compile Include="PropertyGrid\Editors\TextBoxEditor.xaml.cs">
<DependentUpon>TextBoxEditor.xaml</DependentUpon>
</Compile>
<Compile Include="PropertyGrid\Editors\TimeSpanEditor.xaml.cs">
<DependentUpon>TimeSpanEditor.xaml</DependentUpon>
</Compile>
<Compile Include="themes\VersionedAssemblyResourceDictionary.cs" />
<Compile Include="Translations.cs" />
<Compile Include="Configuration\AssemblyInfo.cs" />
<Compile Include="Controls\AdornerLayer.cs" />
@ -312,12 +319,20 @@ @@ -312,12 +319,20 @@
<SubType>Designer</SubType>
</Page>
<Page Include="PropertyGrid\Editors\ColorEditor.xaml" />
<Page Include="PropertyGrid\Editors\ComboBoxEditor.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="PropertyGrid\Editors\FlatCollectionEditor.xaml" />
<Page Include="PropertyGrid\Editors\FormatedTextEditor\FormatedTextEditor.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="PropertyGrid\Editors\OpenCollectionEditor.xaml" />
<Page Include="PropertyGrid\Editors\TextBoxEditor.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="PropertyGrid\Editors\TimeSpanEditor.xaml" />
<Page Include="ThumbnailView\ThumbnailView.xaml" />
<ProjectReference Include="..\..\..\..\..\Main\ICSharpCode.SharpDevelop.Widgets\Project\ICSharpCode.SharpDevelop.Widgets.csproj">

20
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Xaml/XamlDesignContext.cs

@ -27,6 +27,7 @@ using ICSharpCode.WpfDesign.Extensions; @@ -27,6 +27,7 @@ using ICSharpCode.WpfDesign.Extensions;
using ICSharpCode.WpfDesign.PropertyGrid;
using System.Threading;
using System.Globalization;
using ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors;
namespace ICSharpCode.WpfDesign.Designer.Xaml
{
@ -91,6 +92,9 @@ namespace ICSharpCode.WpfDesign.Designer.Xaml @@ -91,6 +92,9 @@ namespace ICSharpCode.WpfDesign.Designer.Xaml
this.Services.AddService(typeof(ITopLevelWindowService), new WpfTopLevelWindowService());
}
EditorManager.SetDefaultTextBoxEditorType(typeof(TextBoxEditor));
EditorManager.SetDefaultComboBoxEditorType(typeof(ComboBoxEditor));
// register extensions from the designer assemblies:
foreach (Assembly designerAssembly in loadSettings.DesignerAssemblies) {
this.Services.ExtensionManager.RegisterAssembly(designerAssembly);
@ -113,16 +117,16 @@ namespace ICSharpCode.WpfDesign.Designer.Xaml @@ -113,16 +117,16 @@ namespace ICSharpCode.WpfDesign.Designer.Xaml
message = "Could not load document.";
throw new XamlLoadException(message);
}
_rootItem = _componentService.RegisterXamlComponentRecursive(_doc.RootElement);
if(_rootItem!=null){
var rootBehavior=new RootItemBehavior();
if (_rootItem != null) {
var rootBehavior = new RootItemBehavior();
rootBehavior.Intialize(this);
}
_xamlEditOperations = new XamlEditOperations(this, _parserSettings);
_xamlEditOperations=new XamlEditOperations(this,_parserSettings);
}
@ -145,8 +149,8 @@ namespace ICSharpCode.WpfDesign.Designer.Xaml @@ -145,8 +149,8 @@ namespace ICSharpCode.WpfDesign.Designer.Xaml
/// Gets the parser Settings being used
/// </summary>
public XamlParserSettings ParserSettings {
get { return _parserSettings; }
}
get { return _parserSettings; }
}
/// <summary>
/// Opens a new change group used to batch several changes.

52
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/themes/VersionedAssemblyResourceDictionary.cs

@ -0,0 +1,52 @@ @@ -0,0 +1,52 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.ComponentModel;
using System.Windows;
namespace ICSharpCode.WpfDesign.Designer.themes
{
public class VersionedAssemblyResourceDictionary : ResourceDictionary, ISupportInitialize
{
private static readonly string _uriStart;
private static readonly int _subLength;
static VersionedAssemblyResourceDictionary()
{
var nm = typeof(VersionedAssemblyResourceDictionary).Assembly.GetName();
_uriStart = string.Format( @"{0};v{1};component/", nm.Name, nm.Version);
_subLength = "ICSharpCode.WpfDesign.Designer.".Length;
}
public string RelativePath {get;set;}
void ISupportInitialize.EndInit()
{
this.Source = new Uri(_uriStart + this.RelativePath, UriKind.Relative);
base.EndInit();
}
public static string GetXamlNameForType(Type t)
{
return _uriStart + t.FullName.Substring(_subLength).Replace(".","/").ToLower() + ".xaml";
}
}
}

17
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/themes/generic.xaml

@ -1,10 +1,13 @@ @@ -1,10 +1,13 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:v="clr-namespace:ICSharpCode.WpfDesign.Designer.themes"
>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/ICSharpCode.WpfDesign.Designer;component/Controls/ControlStyles.xaml" />
<ResourceDictionary Source="/ICSharpCode.WpfDesign.Designer;component/OutlineView/OutlineView.xaml" />
<ResourceDictionary Source="/ICSharpCode.WpfDesign.Designer;component/DesignSurface.xaml" />
<ResourceDictionary Source="/ICSharpCode.WpfDesign.Designer;component/PropertyGrid/PropertyGridView.xaml" />
<ResourceDictionary Source="/ICSharpCode.WpfDesign.Designer;component/ThumbnailView/ThumbnailView.xaml" />
<v:VersionedAssemblyResourceDictionary RelativePath="Controls/ControlStyles.xaml" />
<v:VersionedAssemblyResourceDictionary RelativePath="OutlineView/OutlineView.xaml" />
<v:VersionedAssemblyResourceDictionary RelativePath="DesignSurface.xaml" />
<v:VersionedAssemblyResourceDictionary RelativePath="PropertyGrid/PropertyGridView.xaml" />
<v:VersionedAssemblyResourceDictionary RelativePath="ThumbnailView/ThumbnailView.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>

2
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlParser.cs

@ -585,6 +585,8 @@ namespace ICSharpCode.WpfDesign.XamlDom @@ -585,6 +585,8 @@ namespace ICSharpCode.WpfDesign.XamlDom
return FindAttachedProperty(typeof(DesignTimeProperties), attribute.LocalName);
} else if (attribute.LocalName == "LayoutRounding" && attribute.NamespaceURI == XamlConstants.DesignTimeNamespace) {
return FindAttachedProperty(typeof(DesignTimeProperties), attribute.LocalName);
} else if (attribute.LocalName == "DataContext" && attribute.NamespaceURI == XamlConstants.DesignTimeNamespace) {
return FindAttachedProperty(typeof(DesignTimeProperties), attribute.LocalName);
}

31
src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/PropertyGrid/EditorManager.cs

@ -17,13 +17,10 @@ @@ -17,13 +17,10 @@
// DEALINGS IN THE SOFTWARE.
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Collections.Generic;
using System.Reflection;
using System.Windows;
using System.Windows.Input;
using ICSharpCode.WpfDesign.PropertyGrid.Editors;
using System.Windows.Controls;
namespace ICSharpCode.WpfDesign.PropertyGrid
{
@ -37,6 +34,10 @@ namespace ICSharpCode.WpfDesign.PropertyGrid @@ -37,6 +34,10 @@ namespace ICSharpCode.WpfDesign.PropertyGrid
// property full name => editor type
static Dictionary<string, Type> propertyEditors = new Dictionary<string, Type>();
static Type defaultComboboxEditor;
static Type defaultTextboxEditor;
/// <summary>
/// Creates a property editor for the specified <paramref name="property"/>
/// </summary>
@ -61,14 +62,32 @@ namespace ICSharpCode.WpfDesign.PropertyGrid @@ -61,14 +62,32 @@ namespace ICSharpCode.WpfDesign.PropertyGrid
if (editorType == null) {
var standardValues = Metadata.GetStandardValues(property.ReturnType);
if (standardValues != null) {
return new ComboBoxEditor() { ItemsSource = standardValues };
var itemsControl = (ItemsControl)Activator.CreateInstance(defaultComboboxEditor);
itemsControl.ItemsSource = standardValues;
return itemsControl;
}
return new TextBoxEditor();
return (FrameworkElement)Activator.CreateInstance(defaultTextboxEditor);
}
}
return (FrameworkElement)Activator.CreateInstance(editorType);
}
/// <summary>
/// Registers the Textbox Editor.
/// </summary>
public static void SetDefaultTextBoxEditorType(Type type)
{
defaultTextboxEditor = type;
}
/// <summary>
/// Registers the Combobox Editor.
/// </summary>
public static void SetDefaultComboBoxEditorType(Type type)
{
defaultComboboxEditor = type;
}
/// <summary>
/// Registers property editors defined in the specified assembly.
/// </summary>

16
src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/WpfDesign.csproj

@ -103,12 +103,6 @@ @@ -103,12 +103,6 @@
<Compile Include="PlacementAlignment.cs" />
<Compile Include="PropertyGrid\Category.cs" />
<Compile Include="PropertyGrid\EditorManager.cs" />
<Compile Include="PropertyGrid\Editors\ComboBoxEditor.xaml.cs">
<DependentUpon>ComboBoxEditor.xaml</DependentUpon>
</Compile>
<Compile Include="PropertyGrid\Editors\TextBoxEditor.xaml.cs">
<DependentUpon>TextBoxEditor.xaml</DependentUpon>
</Compile>
<Compile Include="PropertyGrid\PropertyEditorAttribute.cs" />
<Compile Include="PropertyGrid\PropertyNode.cs" />
<Compile Include="PropertyGrid\SortedObservableCollection.cs" />
@ -120,16 +114,6 @@ @@ -120,16 +114,6 @@
<Compile Include="Services.cs" />
<Compile Include="Tools.cs" />
</ItemGroup>
<ItemGroup>
<Page Include="PropertyGrid\Editors\ComboBoxEditor.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="PropertyGrid\Editors\TextBoxEditor.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<ItemGroup>
<CodeAnalysisDictionary Include="Configuration\CodeAnalysisDictionary.xml" />
</ItemGroup>

Loading…
Cancel
Save