我是WPF的新手,当我使用MVVM和Prism编写我的第一个WPF应用程序时,遇到异常,异常发生在以下代码中:
I'am a newer to WPF, when i use MVVM and Prism to write my first WPF application, i meet an exception, the exception happend from the below code:
的xmlns:I =" HTTP://schemas.microsoft/expression/2010/interactivity" xmlns:ei = schemas.microsoft/expression / 2010 / interaction
xmlns:i="schemas.microsoft/expression/2010/interactivity" xmlns:ei=schemas.microsoft/expression/2010/interactions
< Button Command =" {Binding}"含量="登录" Grid.Row = QUOT 1 QUOT; IsEnabled =" {Binding Path = IsLoginButtonEnabled}"> < i:Interaction.Triggers> < i:EventTrigger EventName =" Click"> ; $ < ei:CallMethodAction TargetObject =" {Binding}"方法名= QUOT;为LoginEvent" /> - 此行有一个异常"发生了XamlParseException"该方法或操作未实施。 < / i:EventTrigger> < / i:Interaction.Triggers> < / Button>
<Button Command="{Binding }" Content="Login" Grid.Row="1" IsEnabled="{Binding Path=IsLoginButtonEnabled}"> <i:Interaction.Triggers> <i:EventTrigger EventName="Click"> <ei:CallMethodAction TargetObject="{Binding}" MethodName="LoginEvent"/> -- This line have an exception "XamlParseException occurred" The method or operation is not implemented. </i:EventTrigger> </i:Interaction.Triggers> </Button>
我使用Prism和MEF将viewmodel注入此视图,并使用"LoginEvent"和"LoginEvent"。存在于viewmodel类中LoginViewModel
I use Prism and MEF to inject viewmodel to this view, and the "LoginEvent" is exists in viewmodel class LoginViewModel
public void Login() { //无事可做。
public void Login() { //Nothing to do.
}
非常奇怪的是,我甚至无法使用try ... catch ...在LoginView.cs文件中捕获此异常:
the very strange thing is that i can not even use try ... catch... to catch this exception like this in the LoginView.cs file:
尝试 {
InitializeComponent(); } catch(例外e) {
InitializeComponent(); } catch (Exception e) {
}
以前有没有人见过这个,等你的帮助!!!!
Is there anybody met this before, waitting for your help!!!!
推荐答案
您好Itigoo,
Hi Itigoo,
因为您的问题是关于Expression SDK ,我已将此主题移至Expression Forum以获得更好的支持。
Since you question is about Expression SDK, I have moved this thread to Expression Forum for better support.
祝你好运,
更多推荐
发生XamlParseException
发布评论