我正在使用Microsoft Expression Blend 4
我有一个浏览器..,
[XAML] ConnectionView"后面的空代码"
<WebBrowser local:AttachedProperties.BrowserSource="{Binding Source}">
<i:Interaction.Triggers>
<i:EventTrigger>
<i:InvokeCommandAction Command="{Binding LoadedEvent}"/>
</i:EventTrigger>
<i:EventTrigger EventName="Navigated">
<i:InvokeCommandAction Command="{Binding NavigatedEvent}" CommandParameter="??????"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</WebBrowser>
Run Code Online (Sandbox Code Playgroud)
[C#] AttachedProperties类
public static class AttachedProperties
{
public static readonly DependencyProperty BrowserSourceProperty = DependencyProperty . RegisterAttached ( "BrowserSource" , typeof ( string ) , typeof ( AttachedProperties ) , new UIPropertyMetadata ( null , BrowserSourcePropertyChanged ) );
public static string GetBrowserSource ( DependencyObject _DependencyObject )
{
return ( string ) _DependencyObject . GetValue ( BrowserSourceProperty …Run Code Online (Sandbox Code Playgroud) 任何人都可以告诉我实际的语法是什么EventToCommand.据我所知,EventToCommand该类适用于Silverlight/WPF和WP7,因此我认为它是一个更好的选择.
据我所知,我可以添加任何点击事件并将其强行插入我的ViewModel,但我在找到最佳方法时遇到问题.
我知道你可以在没有Blend的情况下添加它,但是有可用的片段吗?
或者是否有更简单的方法通过VS 2010添加它?任何帮助或如果有人知道这方面的好教程将是伟大的.