Skip to content

Commit

Permalink
Merge pull request #110 from MihailRomanov/add_specialInitializecompo…
Browse files Browse the repository at this point in the history
…nent_to_colorpicker

Add SpecialInitializeComponent() to ColorPicker
  • Loading branch information
jogibear9988 authored Jan 16, 2024
2 parents 18b92a7 + c2e7625 commit fc189bc
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
19 changes: 18 additions & 1 deletion WpfDesign.Designer/Project/Controls/ColorPicker.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.

using ICSharpCode.WpfDesign.Designer.themes;
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
Expand All @@ -28,7 +30,22 @@ public partial class ColorPicker
{
public ColorPicker()
{
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 =
Expand Down
4 changes: 2 additions & 2 deletions WpfDesign.Designer/Tests/WpfDesign.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<AssemblyName>ICSharpCode.WpfDesign.Tests</AssemblyName>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="NUnit" Version="3.13.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.2.0" />
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="RhinoMocks" Version="3.6.1" />
</ItemGroup>
<ItemGroup>
Expand Down

0 comments on commit fc189bc

Please sign in to comment.