Browse Source

fixed designer mode

flabbet 2 years ago
parent
commit
7a0c27e124

+ 4 - 2
src/PixiEditor/Models/Commands/XAML/Command.cs

@@ -1,4 +1,6 @@
-using System.Windows.Input;
+using System.ComponentModel;
+using System.Windows;
+using System.Windows.Input;
 using System.Windows.Markup;
 using System.Windows.Markup;
 using PixiEditor.Helpers;
 using PixiEditor.Helpers;
 
 
@@ -20,7 +22,7 @@ internal class Command : MarkupExtension
 
 
     public override object ProvideValue(IServiceProvider serviceProvider)
     public override object ProvideValue(IServiceProvider serviceProvider)
     {
     {
-        if (Windows.ApplicationModel.DesignMode.DesignModeEnabled)
+        if ((bool)(DesignerProperties.IsInDesignModeProperty.GetMetadata(typeof(DependencyObject)).DefaultValue))
         {
         {
             var attribute = DesignCommandHelpers.GetCommandAttribute(Name);
             var attribute = DesignCommandHelpers.GetCommandAttribute(Name);
             return GetICommand(
             return GetICommand(

+ 0 - 1
src/PixiEditor/PixiEditor.csproj

@@ -19,7 +19,6 @@
         <ImplicitUsings>true</ImplicitUsings>
         <ImplicitUsings>true</ImplicitUsings>
         <AssemblyVersion></AssemblyVersion>
         <AssemblyVersion></AssemblyVersion>
         <LangVersion>11</LangVersion>
         <LangVersion>11</LangVersion>
-        <SupportedOSPlatformVersion>7.0</SupportedOSPlatformVersion>
 	</PropertyGroup>
 	</PropertyGroup>
 
 
 	<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='MSIX|AnyCPU'">
 	<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='MSIX|AnyCPU'">