Xaml 使用EventToCommand会破坏Visual Studio 2015中的DesignView
我正在使用最新的Visual Studio:Xaml 使用EventToCommand会破坏Visual Studio 2015中的DesignView,xaml,visual-studio-2015,mvvm-light,Xaml,Visual Studio 2015,Mvvm Light,我正在使用最新的Visual Studio: Microsoft Visual Studio Professional 2015 Version 14.0.24720.00 Update 1 Microsoft .NET Framework Version 4.6.01038 当我创建一个新的WPF项目(TargetFrameworkVersion:v4.5.2)并通过NuGet在以下XAML中添加MvvmLightLibs(最新版本:5.2.0.0)时 <UserControl x:C
Microsoft Visual Studio Professional 2015
Version 14.0.24720.00 Update 1
Microsoft .NET Framework
Version 4.6.01038
当我创建一个新的WPF项目(TargetFrameworkVersion:v4.5.2)并通过NuGet在以下XAML中添加MvvmLightLibs
(最新版本:5.2.0.0)时
<UserControl x:Class="MergedDirectoriesTest.Views.SubView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="clr-namespace:MergedDirectoriesTest.ViewModels"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:command="http://www.galasoft.ch/mvvmlight">
...
<TextBox Style="{StaticResource FormTextBoxStyle}" Text="{Binding LastName, UpdateSourceTrigger=PropertyChanged}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="KeyUp">
<command:EventToCommand Command="{Binding TextEnteredCommand}" />
</i:EventTrigger>
</i:Interaction.Triggers>
</TextBox>
</UserControl>
如果将XML名称空间更改为
<UserControl ...
xmlns:command="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Platform">
供您参考:我使用MVVMLight提供的System.Windows.Interactivity
。据我所知,这是最新版本:
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\MvvmLightLibs.5.2.0.0\lib\net45\System.Windows.Interactivity.dll</HintPath>
<Private>True</Private>
</Reference>
..\packages\MvvmLightLibs.5.2.0.0\lib\net45\System.Windows.Interactivity.dll
真的
这正是我的问题。你是怎么解决的?(还是你没有?)
The type 'EventToCommand' from assembly 'GalaSoft.MvvmLight.Platform' is built with an older version of the Blend SDK, and is not supported in a Windows Presentation Framework 4 project.
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\MvvmLightLibs.5.2.0.0\lib\net45\System.Windows.Interactivity.dll</HintPath>
<Private>True</Private>
</Reference>