Родитель
7ce5f6c104
Коммит
a9de65afed
|
@ -23,7 +23,7 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="MSBuild.Sdk.Extras" Version="1.2.0" PrivateAssets="All" />
|
||||
<PackageReference Include="MSBuild.Sdk.Extras" Version="1.2.1" PrivateAssets="All" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(IsTestProject)' != 'true' and '$(SourceLinkEnabled)' != 'false'">
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
|
||||
<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
|
||||
<Compile Include="Platform\Net461\**\*.cs" />
|
||||
<Compile Include="Platform\Wpf\**\*.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(TargetFramework)'!='netstandard2.0'">
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
|
||||
<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
|
||||
<Compile Include="Platform\Net461\**\*.cs" />
|
||||
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(TargetFramework)'!='netstandard2.0'">
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
|
||||
<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
|
||||
<Compile Include="Platform\Net461\**\*.cs" />
|
||||
<Compile Include="Platform\Wpf\**\*.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(TargetFramework)'!='netstandard2.0'">
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
|
||||
<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
|
||||
<Compile Include="Platform\Net461\**\*.cs" />
|
||||
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(TargetFramework)'!='netstandard2.0'">
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
|
||||
<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
|
||||
<Compile Include="Platform\Net461\**\*.cs" />
|
||||
<Compile Include="Platform\Wpf\**\*.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(TargetFramework)'!='netstandard2.0'">
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Plugin.cs
|
||||
// Plugin.cs
|
||||
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
|
||||
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
|
||||
// Contributions and inspirations noted in readme.md and license.txt
|
||||
|
@ -9,7 +9,7 @@ using System;
|
|||
using System.IO;
|
||||
using MvvmCross.Platform;
|
||||
using MvvmCross.Platform.Exceptions;
|
||||
using MvvmCross.Platform.Platform;
|
||||
using MvvmCross.Platform.Logging;
|
||||
using MvvmCross.Platform.Plugins;
|
||||
|
||||
namespace MvvmCross.Plugins.File.Wpf
|
||||
|
@ -49,4 +49,4 @@ namespace MvvmCross.Plugins.File.Wpf
|
|||
_configuration = fileConfiguration;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,6 +20,10 @@
|
|||
|
||||
<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
|
||||
<Compile Include="Platform\Net461\**\*.cs" />
|
||||
<Compile Include="Platform\Wpf\**\*.cs" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Device" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(TargetFramework)'!='netstandard2.0'">
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
|
||||
<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
|
||||
<Compile Include="Platform\Net461\**\*.cs" />
|
||||
<Compile Include="Platform\Wpf\**\*.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(TargetFramework)'!='netstandard2.0'">
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
|
||||
<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
|
||||
<Compile Include="Platform\Net461\**\*.cs" />
|
||||
<Compile Include="Platform\Wpf\**\*.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(TargetFramework)'!='netstandard2.0'">
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
|
||||
<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
|
||||
<Compile Include="Platform\Net461\**\*.cs" />
|
||||
<Compile Include="Platform\Wpf\**\*.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(TargetFramework)'!='netstandard2.0'">
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
|
||||
<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
|
||||
<Compile Include="Platform\Net461\**\*.cs" />
|
||||
<Compile Include="Platform\Wpf\**\*.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(TargetFramework)'!='netstandard2.0'">
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
|
||||
<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
|
||||
<Compile Include="Platform\Net461\**\*.cs" />
|
||||
<Compile Include="Platform\Wpf\**\*.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(TargetFramework)'!='netstandard2.0'">
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
|
||||
<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
|
||||
<Compile Include="Platform\Net461\**\*.cs" />
|
||||
<Compile Include="Platform\Console\**\*.cs" />
|
||||
<Compile Include="Platform\Wpf\**\*.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(TargetFramework)'!='netstandard2.0'">
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
//
|
||||
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
|
||||
|
||||
using MvvmCross.Platform;
|
||||
using MvvmCross.Platform.UI;
|
||||
|
||||
namespace MvvmCross.Plugins.Visibility.Console
|
||||
|
@ -21,4 +22,4 @@ namespace MvvmCross.Plugins.Visibility.Console
|
|||
|
||||
#endregion Implementation of IMvxNativeVisibility
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,4 +20,4 @@ namespace MvvmCross.Plugins.Visibility.Console
|
|||
Mvx.RegisterSingleton<IMvxNativeVisibility>(new MvxConsoleVisibility());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
|
||||
<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
|
||||
<Compile Include="Platform\Net461\**\*.cs" />
|
||||
<Compile Include="Platform\Wpf\**\*.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(TargetFramework)'!='netstandard2.0'">
|
||||
|
|
|
@ -1,75 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{666EB95D-7CD8-48B6-A2F8-395DECC84140}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>MvvmCross.Platform.Test</RootNamespace>
|
||||
<AssemblyName>MvvmCross.Platform.Test</AssemblyName>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\..\</SolutionDir>
|
||||
<RestorePackages>true</RestorePackages>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="nunit.framework, Version=3.8.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\NUnit.3.8.1\lib\net45\nunit.framework.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="..\..\..\AssemblyInfo.cs">
|
||||
<Link>Properties\AssemblyInfo.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Converters\MvxDictionaryValueConverterTests.cs" />
|
||||
<Compile Include="Mocks\MockBootstrapAction.cs" />
|
||||
<Compile Include="MvxBootstrapTest.cs" />
|
||||
<Compile Include="MvxIoCPropertyInjectionTest.cs" />
|
||||
<Compile Include="MvxIoCTest.cs" />
|
||||
<Compile Include="MvxParserTest.cs" />
|
||||
<Compile Include="MvxPropertyParsingExpressionTest.cs" />
|
||||
<Compile Include="ReflectionExtensionsTests.cs" />
|
||||
<Compile Include="UI\MvxColorTests.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Platform\MvvmCross.Platform.csproj">
|
||||
<Project>{CFF6F25A-3C3B-44EE-A54C-2ED4AAFF3ADB}</Project>
|
||||
<Name>MvvmCross.Platform</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
|
@ -1,4 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="NUnit" version="3.8.1" targetFramework="net45" />
|
||||
</packages>
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
|
@ -70,20 +70,20 @@ namespace MvvmCross.Platform.Logging.LogProviders
|
|||
|
||||
if (Colors.TryGetValue(logLevel, out var color))
|
||||
{
|
||||
var originalColor = Console.ForegroundColor;
|
||||
var originalColor = System.Console.ForegroundColor;
|
||||
try
|
||||
{
|
||||
Console.ForegroundColor = color;
|
||||
Console.WriteLine(formattedMessage);
|
||||
System.Console.ForegroundColor = color;
|
||||
System.Console.WriteLine(formattedMessage);
|
||||
}
|
||||
finally
|
||||
{
|
||||
Console.ForegroundColor = originalColor;
|
||||
System.Console.ForegroundColor = originalColor;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine(formattedMessage);
|
||||
System.Console.WriteLine(formattedMessage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,10 @@
|
|||
|
||||
<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
|
||||
<Compile Include="Platform\Net461\**\*.cs" />
|
||||
<Compile Include="Platform\Wpf\**\*.cs" />
|
||||
<Compile Include="Platform\Console\**\*.cs" />
|
||||
<PackageReference Include="System.Console" Version="4.3.0" />
|
||||
<PackageReference Include="Expression.Blend.Sdk.WPF" Version="1.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(TargetFramework)'!='netstandard2.0'">
|
||||
|
|
|
@ -9,6 +9,7 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using MvvmCross.Core.ViewModels;
|
||||
using MvvmCross.Core.Views;
|
||||
using MvvmCross.Platform.Logging;
|
||||
using MvvmCross.Platform.Platform;
|
||||
|
||||
namespace MvvmCross.Console.Views
|
||||
|
@ -52,4 +53,4 @@ namespace MvvmCross.Console.Views
|
|||
|
||||
public abstract void Close(IMvxViewModel toClose);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ using System.Collections.Generic;
|
|||
using MvvmCross.Core.ViewModels;
|
||||
using MvvmCross.Platform;
|
||||
using MvvmCross.Platform.Exceptions;
|
||||
using MvvmCross.Platform.Logging;
|
||||
using MvvmCross.Platform.Platform;
|
||||
|
||||
namespace MvvmCross.Console.Views
|
||||
|
@ -107,4 +108,4 @@ namespace MvvmCross.Console.Views
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// MvxNativeValueConverter.cs
|
||||
// MvxNativeValueConverter.cs
|
||||
|
||||
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
|
||||
// Contributions and inspirations noted in readme.md and license.txt
|
||||
|
@ -42,7 +42,7 @@ namespace MvvmCross.Platform.Wpf.Converters
|
|||
{
|
||||
if (toReturn == MvxBindingConstant.DoNothing)
|
||||
{
|
||||
return Binding.DoNothing;
|
||||
return System.Windows.Data.Binding.DoNothing;
|
||||
}
|
||||
|
||||
if (toReturn == MvxBindingConstant.UnsetValue)
|
||||
|
@ -70,4 +70,4 @@ namespace MvvmCross.Platform.Wpf.Converters
|
|||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,13 +5,6 @@
|
|||
//
|
||||
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
|
||||
|
||||
#if WINDOWS_COMMON
|
||||
using Windows.UI.Xaml;
|
||||
|
||||
namespace MvvmCross.BindingEx.WindowsCommon
|
||||
#endif
|
||||
|
||||
#if WINDOWS_WPF
|
||||
using System.Collections.Generic;
|
||||
using System.Windows;
|
||||
using MvvmCross.Binding.Bindings;
|
||||
|
@ -20,7 +13,6 @@ using MvvmCross.Platform.Core;
|
|||
using MvvmCross.Platform.Exceptions;
|
||||
|
||||
namespace MvvmCross.Binding.Wpf
|
||||
#endif
|
||||
{
|
||||
// ReSharper disable InconsistentNaming
|
||||
public static class Bi
|
||||
|
@ -91,4 +83,4 @@ namespace MvvmCross.Binding.Wpf
|
|||
return MvxSingleton<IMvxBindingSingletonCache>.Instance.BindingDescriptionParser.Parse(bindingText);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,20 +5,12 @@
|
|||
//
|
||||
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
|
||||
|
||||
#if WINDOWS_COMMON
|
||||
using Windows.UI.Xaml;
|
||||
|
||||
namespace MvvmCross.BindingEx.WindowsCommon
|
||||
#endif
|
||||
|
||||
#if WINDOWS_WPF
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows;
|
||||
using MvvmCross.Binding.Bindings;
|
||||
|
||||
namespace MvvmCross.Binding.Wpf
|
||||
#endif
|
||||
{
|
||||
public interface IMvxBindingCreator
|
||||
{
|
||||
|
@ -27,4 +19,4 @@ namespace MvvmCross.Binding.Wpf
|
|||
DependencyPropertyChangedEventArgs args,
|
||||
Func<string, IEnumerable<MvxBindingDescription>> parseBindingDescriptions);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,16 +8,10 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
|
||||
#if WINDOWS_COMMON
|
||||
namespace MvvmCross.BindingEx.WindowsCommon
|
||||
#endif
|
||||
|
||||
#if WINDOWS_WPF
|
||||
namespace MvvmCross.Binding.Wpf
|
||||
#endif
|
||||
{
|
||||
public interface IMvxWindowsAssemblyCache
|
||||
{
|
||||
IList<Assembly> Assemblies { get; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,13 +12,7 @@ using MvvmCross.Platform.Converters;
|
|||
using MvvmCross.Platform.Core;
|
||||
using MvvmCross.Platform.IoC;
|
||||
|
||||
#if WINDOWS_COMMON
|
||||
namespace MvvmCross.BindingEx.WindowsCommon
|
||||
#endif
|
||||
|
||||
#if WINDOWS_WPF
|
||||
namespace MvvmCross.Binding.Wpf
|
||||
#endif
|
||||
{
|
||||
public class Import
|
||||
{
|
||||
|
@ -40,11 +34,7 @@ namespace MvvmCross.Binding.Wpf
|
|||
_from = value;
|
||||
if (_from != null)
|
||||
{
|
||||
#if WINDOWS_COMMON
|
||||
RegisterAssembly(_from.GetType().GetTypeInfo().Assembly);
|
||||
#else
|
||||
RegisterAssembly(_from.GetType().Assembly);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -71,4 +61,4 @@ namespace MvvmCross.Binding.Wpf
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,23 +5,14 @@
|
|||
//
|
||||
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
|
||||
|
||||
#if WINDOWS_COMMON
|
||||
using Windows.UI.Xaml;
|
||||
|
||||
namespace MvvmCross.BindingEx.WindowsCommon
|
||||
#endif
|
||||
|
||||
#if WINDOWS_WPF
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using MvvmCross.Binding.Bindings;
|
||||
using MvvmCross.Platform;
|
||||
using MvvmCross.Platform.Core;
|
||||
|
||||
namespace MvvmCross.Binding.Wpf
|
||||
#endif
|
||||
{
|
||||
// ReSharper disable InconsistentNaming
|
||||
public static class La
|
||||
|
@ -83,4 +74,4 @@ namespace MvvmCross.Binding.Wpf
|
|||
return MvxSingleton<IMvxBindingSingletonCache>.Instance.BindingDescriptionParser.LanguageParse(languageText);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,14 +5,6 @@
|
|||
//
|
||||
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
|
||||
|
||||
#if WINDOWS_COMMON
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Data;
|
||||
|
||||
namespace MvvmCross.BindingEx.WindowsCommon.MvxBinding
|
||||
#endif
|
||||
|
||||
#if WINDOWS_WPF
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
@ -21,7 +13,6 @@ using System.Windows.Data;
|
|||
using MvvmCross.Binding.Bindings;
|
||||
|
||||
namespace MvvmCross.Binding.Wpf.MvxBinding
|
||||
#endif
|
||||
{
|
||||
|
||||
|
||||
|
@ -60,12 +51,7 @@ namespace MvvmCross.Binding.Wpf.MvxBinding
|
|||
attachedObject.SetValue(BindingsListProperty, newList);
|
||||
|
||||
// create a binding watcher for the list
|
||||
#if WINDOWS_WPF
|
||||
var binding = new System.Windows.Data.Binding();
|
||||
#endif
|
||||
#if WINDOWS_COMMON
|
||||
var binding = new Windows.UI.Xaml.Data.Binding();
|
||||
#endif
|
||||
bool attached = false;
|
||||
Action attachAction = () =>
|
||||
{
|
||||
|
@ -79,11 +65,8 @@ namespace MvvmCross.Binding.Wpf.MvxBinding
|
|||
{
|
||||
if (!attached)
|
||||
return;
|
||||
#if WINDOWS_COMMON
|
||||
attachedObject.ClearValue(DataContextWatcherProperty);
|
||||
#else
|
||||
|
||||
BindingOperations.ClearBinding(attachedObject, DataContextWatcherProperty);
|
||||
#endif
|
||||
attached = false;
|
||||
};
|
||||
attachAction();
|
||||
|
@ -145,4 +128,4 @@ namespace MvvmCross.Binding.Wpf.MvxBinding
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,16 +10,7 @@ using MvvmCross.Binding.Bindings.Target.Construction;
|
|||
using MvvmCross.Binding.Wpf.MvxBinding.Target;
|
||||
using MvvmCross.Platform.Platform;
|
||||
|
||||
#if WINDOWS_COMMON
|
||||
using MvvmCross.BindingEx.WindowsCommon.MvxBinding.Target;
|
||||
|
||||
namespace MvvmCross.BindingEx.WindowsCommon.MvxBinding
|
||||
#endif
|
||||
|
||||
#if WINDOWS_WPF
|
||||
|
||||
namespace MvvmCross.Binding.Wpf.MvxBinding
|
||||
#endif
|
||||
{
|
||||
public class MvxWindowsTargetBindingFactoryRegistry : MvxTargetBindingFactoryRegistry
|
||||
{
|
||||
|
@ -65,4 +56,4 @@ namespace MvvmCross.Binding.Wpf.MvxBinding
|
|||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,13 +5,7 @@
|
|||
//
|
||||
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
|
||||
|
||||
#if WINDOWS_COMMON
|
||||
namespace MvvmCross.BindingEx.WindowsCommon.MvxBinding.Target
|
||||
#endif
|
||||
|
||||
#if WINDOWS_WPF
|
||||
namespace MvvmCross.Binding.Wpf.MvxBinding.Target
|
||||
#endif
|
||||
{
|
||||
public class MvxCollapsedTargetBinding : MvxVisibleTargetBinding
|
||||
{
|
||||
|
@ -28,4 +22,4 @@ namespace MvvmCross.Binding.Wpf.MvxBinding.Target
|
|||
base.SetValue(!boolValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,14 +5,6 @@
|
|||
//
|
||||
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
|
||||
|
||||
#if WINDOWS_COMMON
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Media;
|
||||
|
||||
namespace MvvmCross.BindingEx.WindowsCommon.MvxBinding.Target
|
||||
#endif
|
||||
|
||||
#if WINDOWS_WPF
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Windows;
|
||||
|
@ -22,16 +14,13 @@ using MvvmCross.Binding.ExtensionMethods;
|
|||
using MvvmCross.Platform.Platform;
|
||||
|
||||
namespace MvvmCross.Binding.Wpf.MvxBinding.Target
|
||||
#endif
|
||||
{
|
||||
public class MvxDependencyPropertyTargetBinding : MvxConvertingTargetBinding
|
||||
{
|
||||
private readonly string _targetName;
|
||||
private readonly DependencyProperty _targetDependencyProperty;
|
||||
private readonly Type _actualPropertyType;
|
||||
#if WINDOWS_WPF
|
||||
private readonly TypeConverter _typeConverter;
|
||||
#endif
|
||||
|
||||
public MvxDependencyPropertyTargetBinding(object target, string targetName, DependencyProperty targetDependencyProperty, Type actualPropertyType)
|
||||
: base(target)
|
||||
|
@ -39,9 +28,8 @@ namespace MvvmCross.Binding.Wpf.MvxBinding.Target
|
|||
_targetDependencyProperty = targetDependencyProperty;
|
||||
_actualPropertyType = actualPropertyType;
|
||||
_targetName = targetName;
|
||||
#if WINDOWS_WPF
|
||||
_typeConverter = _actualPropertyType.TypeConverter();
|
||||
#endif
|
||||
|
||||
// if we return TwoWay for ImageSource then we end up in
|
||||
// problems with WP7 not doing the auto-conversion
|
||||
// see some of my angst in http://stackoverflow.com/questions/16752242/how-does-xaml-create-the-string-to-bitmapimage-value-conversion-when-binding-to/16753488#16753488
|
||||
|
@ -57,18 +45,9 @@ namespace MvvmCross.Binding.Wpf.MvxBinding.Target
|
|||
var frameworkElement = Target as FrameworkElement;
|
||||
if (frameworkElement == null)
|
||||
return;
|
||||
|
||||
#if WINDOWS_WPF
|
||||
var listenerBinding = new System.Windows.Data.Binding(_targetName)
|
||||
{ Source = frameworkElement };
|
||||
#endif
|
||||
#if WINDOWS_COMMON
|
||||
var listenerBinding = new Windows.UI.Xaml.Data.Binding()
|
||||
{
|
||||
Path = new PropertyPath(_targetName),
|
||||
Source = frameworkElement
|
||||
};
|
||||
#endif
|
||||
|
||||
var attachedProperty = DependencyProperty.RegisterAttached(
|
||||
"ListenAttached" + _targetName + Guid.NewGuid().ToString("N")
|
||||
, typeof(object)
|
||||
|
@ -109,7 +88,6 @@ namespace MvvmCross.Binding.Wpf.MvxBinding.Target
|
|||
|
||||
protected override object MakeSafeValue(object value)
|
||||
{
|
||||
#if WINDOWS_WPF
|
||||
if (_actualPropertyType.IsInstanceOfType(value))
|
||||
return value;
|
||||
|
||||
|
@ -122,10 +100,6 @@ namespace MvvmCross.Binding.Wpf.MvxBinding.Target
|
|||
return null; // TODO - is this correct? Do we need to do more here? See #297
|
||||
|
||||
return _typeConverter.ConvertFrom(value);
|
||||
#endif
|
||||
#if WINDOWS_COMMON
|
||||
return _actualPropertyType.MakeSafeValue(value);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,18 +5,10 @@
|
|||
//
|
||||
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
|
||||
|
||||
#if WINDOWS_COMMON
|
||||
using Windows.UI.Xaml;
|
||||
|
||||
namespace MvvmCross.BindingEx.WindowsCommon.MvxBinding.Target
|
||||
#endif
|
||||
|
||||
#if WINDOWS_WPF
|
||||
using System;
|
||||
using System.Windows;
|
||||
|
||||
namespace MvvmCross.Binding.Wpf.MvxBinding.Target
|
||||
#endif
|
||||
{
|
||||
public class MvxVisibleTargetBinding : MvxDependencyPropertyTargetBinding
|
||||
{
|
||||
|
@ -37,4 +29,4 @@ namespace MvvmCross.Binding.Wpf.MvxBinding.Target
|
|||
base.SetValue(boolValue ? Visibility.Visible : Visibility.Collapsed);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,21 +5,14 @@
|
|||
//
|
||||
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
|
||||
|
||||
#if WINDOWS_COMMON
|
||||
using Windows.UI.Xaml;
|
||||
|
||||
namespace MvvmCross.BindingEx.WindowsCommon
|
||||
#endif
|
||||
|
||||
#if WINDOWS_WPF
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows;
|
||||
using MvvmCross.Binding.Bindings;
|
||||
using MvvmCross.Platform;
|
||||
using MvvmCross.Platform.Logging;
|
||||
|
||||
namespace MvvmCross.Binding.Wpf
|
||||
#endif
|
||||
{
|
||||
public abstract class MvxBindingCreator : IMvxBindingCreator
|
||||
{
|
||||
|
@ -47,4 +40,4 @@ namespace MvvmCross.Binding.Wpf
|
|||
protected abstract void ApplyBindings(FrameworkElement attachedObject,
|
||||
IEnumerable<MvxBindingDescription> bindingDescriptions);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,13 +5,6 @@
|
|||
//
|
||||
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
|
||||
|
||||
#if WINDOWS_COMMON
|
||||
using Windows.UI.Xaml;
|
||||
|
||||
namespace MvvmCross.BindingEx.WindowsCommon
|
||||
#endif
|
||||
|
||||
#if WINDOWS_WPF
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
|
@ -19,12 +12,9 @@ using System.Reflection;
|
|||
using System.Windows;
|
||||
|
||||
namespace MvvmCross.Binding.Wpf
|
||||
#endif
|
||||
{
|
||||
public static class MvxDependencyPropertyExtensionMethods
|
||||
{
|
||||
#if WINDOWS_WPF
|
||||
|
||||
public static TypeConverter TypeConverter(this Type type)
|
||||
{
|
||||
var typeConverter =
|
||||
|
@ -71,49 +61,6 @@ namespace MvvmCross.Binding.Wpf
|
|||
return null;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if WINDOWS_COMMON
|
||||
|
||||
public static PropertyInfo FindActualProperty(this Type type, string name)
|
||||
{
|
||||
if (string.IsNullOrEmpty(name))
|
||||
return null;
|
||||
|
||||
var property = type.GetRuntimeProperty(name);
|
||||
return property;
|
||||
}
|
||||
|
||||
private static PropertyInfo FindDependencyPropertyInfo(Type type, string dependencyPropertyName)
|
||||
{
|
||||
if (string.IsNullOrEmpty(dependencyPropertyName))
|
||||
return null;
|
||||
|
||||
if (!EnsureIsDependencyPropertyName(ref dependencyPropertyName))
|
||||
return null;
|
||||
|
||||
var typeInfo = type.GetTypeInfo();
|
||||
while (typeInfo != null)
|
||||
{
|
||||
var propertyInfo = typeInfo.GetDeclaredProperty(dependencyPropertyName);
|
||||
if (propertyInfo != null)
|
||||
{
|
||||
return propertyInfo;
|
||||
}
|
||||
|
||||
if (typeInfo.BaseType == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
typeInfo = typeInfo.BaseType.GetTypeInfo();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
public static DependencyProperty FindDependencyProperty(this Type type, string name)
|
||||
{
|
||||
if (string.IsNullOrEmpty(name))
|
||||
|
@ -134,4 +81,4 @@ namespace MvvmCross.Binding.Wpf
|
|||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,11 +5,6 @@
|
|||
//
|
||||
// Project Lead - Stuart Lodge, @slodge, me@slodge.com\
|
||||
|
||||
#if WINDOWS_COMMON
|
||||
namespace MvvmCross.BindingEx.WindowsCommon
|
||||
#endif
|
||||
|
||||
#if WINDOWS_WPF
|
||||
using System.ComponentModel;
|
||||
using System.Windows;
|
||||
using MvvmCross.Binding.Parse.Binding;
|
||||
|
@ -18,7 +13,6 @@ using MvvmCross.Platform.Core;
|
|||
using MvvmCross.Platform.IoC;
|
||||
|
||||
namespace MvvmCross.Binding.Wpf
|
||||
#endif
|
||||
{
|
||||
public static class MvxDesignTimeChecker
|
||||
{
|
||||
|
@ -31,14 +25,8 @@ namespace MvvmCross.Binding.Wpf
|
|||
|
||||
_checked = true;
|
||||
|
||||
#if WINDOWS_WPF
|
||||
if (!(bool)DesignerProperties.IsInDesignModeProperty.GetMetadata(typeof(DependencyObject)).DefaultValue)
|
||||
return;
|
||||
#endif
|
||||
#if WINDOWS_COMMON
|
||||
if (!Windows.ApplicationModel.DesignMode.DesignModeEnabled)
|
||||
return;
|
||||
#endif
|
||||
|
||||
if (MvxSingleton<IMvxIoCProvider>.Instance == null)
|
||||
{
|
||||
|
@ -53,4 +41,4 @@ namespace MvvmCross.Binding.Wpf
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,13 +10,7 @@ using System.Reflection;
|
|||
using MvvmCross.Platform.Core;
|
||||
using MvvmCross.Platform.Exceptions;
|
||||
|
||||
#if WINDOWS_COMMON
|
||||
namespace MvvmCross.BindingEx.WindowsCommon
|
||||
#endif
|
||||
|
||||
#if WINDOWS_WPF
|
||||
namespace MvvmCross.Binding.Wpf
|
||||
#endif
|
||||
{
|
||||
public class MvxWindowsAssemblyCache
|
||||
: MvxSingleton<IMvxWindowsAssemblyCache>
|
||||
|
@ -40,4 +34,4 @@ namespace MvvmCross.Binding.Wpf
|
|||
|
||||
public IList<Assembly> Assemblies { get; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,16 +5,6 @@
|
|||
//
|
||||
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
|
||||
|
||||
#if WINDOWS_COMMON
|
||||
using Windows.UI.Xaml;
|
||||
using MvvmCross.BindingEx.WindowsCommon.MvxBinding;
|
||||
using MvvmCross.BindingEx.WindowsCommon.MvxBinding.Target;
|
||||
using MvvmCross.BindingEx.WindowsCommon.WindowsBinding;
|
||||
|
||||
namespace MvvmCross.BindingEx.WindowsCommon
|
||||
#endif
|
||||
|
||||
#if WINDOWS_WPF
|
||||
using System;
|
||||
using System.Windows;
|
||||
using MvvmCross.Binding.Binders;
|
||||
|
@ -28,7 +18,6 @@ using MvvmCross.Platform.Converters;
|
|||
using MvvmCross.Platform.Core;
|
||||
|
||||
namespace MvvmCross.Binding.Wpf
|
||||
#endif
|
||||
{
|
||||
public class MvxWindowsBindingBuilder : MvxBindingBuilder
|
||||
{
|
||||
|
|
|
@ -5,13 +5,7 @@
|
|||
//
|
||||
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
|
||||
|
||||
#if WINDOWS_COMMON
|
||||
namespace MvvmCross.BindingEx.WindowsCommon
|
||||
#endif
|
||||
|
||||
#if WINDOWS_WPF
|
||||
namespace MvvmCross.Binding.Wpf
|
||||
#endif
|
||||
{
|
||||
internal static class MvxWindowsPropertyBinding
|
||||
{
|
||||
|
|
|
@ -7,13 +7,7 @@
|
|||
|
||||
using System.Windows;
|
||||
|
||||
#if WINDOWS_COMMON
|
||||
namespace MvvmCross.BindingEx.WindowsCommon
|
||||
#endif
|
||||
|
||||
#if WINDOWS_WPF
|
||||
namespace MvvmCross.Binding.Wpf
|
||||
#endif
|
||||
{
|
||||
public static class MvxWindowsPropertyBindingExtensions
|
||||
{
|
||||
|
|
|
@ -5,17 +5,6 @@
|
|||
//
|
||||
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
|
||||
|
||||
#if WINDOWS_COMMON
|
||||
using MvvmCross.Platform.WindowsCommon.Converters;
|
||||
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Data;
|
||||
using Windows.UI.Xaml.Media;
|
||||
|
||||
namespace MvvmCross.BindingEx.WindowsCommon.WindowsBinding
|
||||
#endif
|
||||
|
||||
#if WINDOWS_WPF
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows;
|
||||
|
@ -25,10 +14,10 @@ using MvvmCross.Binding.Bindings;
|
|||
using MvvmCross.Binding.Bindings.SourceSteps;
|
||||
using MvvmCross.Platform;
|
||||
using MvvmCross.Platform.Converters;
|
||||
using MvvmCross.Platform.Logging;
|
||||
using MvvmCross.Platform.Wpf.Converters;
|
||||
|
||||
namespace MvvmCross.Binding.Wpf.WindowsBinding
|
||||
#endif
|
||||
{
|
||||
public class MvxWindowsBindingCreator : MvxBindingCreator
|
||||
{
|
||||
|
@ -55,20 +44,12 @@ namespace MvvmCross.Binding.Wpf.WindowsBinding
|
|||
return;
|
||||
}
|
||||
|
||||
#if WINDOWS_WPF
|
||||
var newBinding = new System.Windows.Data.Binding
|
||||
#endif
|
||||
#if WINDOWS_COMMON
|
||||
var newBinding = new Windows.UI.Xaml.Data.Binding
|
||||
#endif
|
||||
{
|
||||
Path = new PropertyPath(sourceStep.SourcePropertyPath),
|
||||
Mode = ConvertMode(bindingDescription.Mode, property?.PropertyType ?? typeof(object)),
|
||||
Converter = GetConverter(sourceStep.Converter),
|
||||
ConverterParameter = sourceStep.ConverterParameter,
|
||||
#if WINDOWS_COMMON
|
||||
FallbackValue = sourceStep.FallbackValue
|
||||
#endif
|
||||
};
|
||||
|
||||
BindingOperations.SetBinding(attachedObject, dependencyProperty, newBinding);
|
||||
|
@ -125,4 +106,4 @@ namespace MvvmCross.Binding.Wpf.WindowsBinding
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// MvxBaseWpfViewPresenter.cs
|
||||
// MvxBaseWpfViewPresenter.cs
|
||||
|
||||
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
|
||||
// Contributions and inspirations noted in readme.md and license.txt
|
||||
|
@ -11,6 +11,7 @@ using MvvmCross.Core.ViewModels;
|
|||
using MvvmCross.Core.Views;
|
||||
using MvvmCross.Platform;
|
||||
using MvvmCross.Platform.Exceptions;
|
||||
using MvvmCross.Platform.Logging;
|
||||
using MvvmCross.Platform.Platform;
|
||||
|
||||
namespace MvvmCross.Wpf.Views.Presenters
|
||||
|
@ -42,4 +43,4 @@ namespace MvvmCross.Wpf.Views.Presenters
|
|||
MvxLog.Instance.Warn("Hint ignored {0}", hint.GetType().Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ using MvvmCross.Core.ViewModels;
|
|||
using MvvmCross.Platform.Platform;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using MvvmCross.Platform.Logging;
|
||||
|
||||
namespace MvvmCross.Wpf.Views.Presenters
|
||||
{
|
||||
|
@ -64,4 +65,4 @@ namespace MvvmCross.Wpf.Views.Presenters
|
|||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// MvxWpfViewPresenter.cs
|
||||
// MvxWpfViewPresenter.cs
|
||||
|
||||
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
|
||||
// Contributions and inspirations noted in readme.md and license.txt
|
||||
|
@ -8,6 +8,7 @@
|
|||
using MvvmCross.Core.ViewModels;
|
||||
using MvvmCross.Core.Views;
|
||||
using MvvmCross.Platform;
|
||||
using MvvmCross.Platform.Logging;
|
||||
using MvvmCross.Platform.Platform;
|
||||
using MvvmCross.Wpf.Views.Presenters.Attributes;
|
||||
using System;
|
||||
|
@ -227,4 +228,4 @@ namespace MvvmCross.Wpf.Views.Presenters
|
|||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче