can we use in WPF MVVM (not in Silverlight) [closed]

Add a reference to the assembly System.Windows.Interactivity then declare it in XAML as xmlns:i=”clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity” or use it if you have Blend SDK installed xmlns:i=”http://schemas.microsoft.com/expression/2010/interactivity” and use it in XAML as <i:Interaction.Triggers> <i:EventTrigger> </i:EventTrigger> </i:Interaction.Triggers>

WPF designer issues : XDG0008 The name “NumericTextBoxConvertor” does not exist in the namespace “clr-namespace:PulserTester.Convertors”

I just want to reiterate a solution that Bradley Uffner mentioned buried in the comments above. Close Visual Studio Delete the hidden .vs folder Open Visual Studio and rebuild your project Keep in mind that this is a very generic error that has multiple causes and solutions, so this may not work for you, but … Read more

WPF: Cancel a user selection in a databound ListBox?

For future stumblers on this question, this page is what ultimately worked for me: http://blog.alner.net/archive/2010/04/25/cancelling-selection-change-in-a-bound-wpf-combo-box.aspx It’s for a combobox, but works for a listbox just fine, since in MVVM you don’t really care what type of control is calling the setter. The glorious secret, as the author mentions, is to actually change the underlying value … Read more

WPF: How to bind a command to the ListBoxItem using MVVM?

Unfortunately, only ButtonBase derived controls have the possibility for binding ICommand objects to their Command properties (for the Click event). However, you can use an API provided by Blend to map an event (like in your case MouseDoubleClick on the ListBox) to an ICommand object. <ListBox> <i:Interaction.Triggers> <i:EventTrigger EventName=”MouseDoubleClick”> <i:InvokeCommandAction Command=”{Binding YourCommand}”/> </i:EventTrigger> </i:Interaction.Triggers> </ListBox> … Read more

Reactive Extensions (Rx) + MVVM =?

I’ve written a framework that represents my explorations in this question called ReactiveUI It implements both an Observable ICommand, as well as ViewModel objects who signal changes via an IObservable, as well as the ability to “assign” an IObservable to a property, who will then fire INotifyPropertyChange whenever its IObservable changes. It also encapsulates a … Read more

Autofac and Func factories

You are calling secVMFactory outside of your FirstViewModel constructor so by that time the ResolveOperation is disposed and in your factory method the c.Resolve will throw the exception. Luckily the exception message is very descriptive and telling you what to do: When registering components using lambdas, the IComponentContext ‘c’ parameter to the lambda cannot be … Read more

How can i specify a designer datacontext for a style, so Resharper finds my properties?

@lhildebrandt’s answer is generally right, but in my case this solution produces errors that totally disable displaying the view in designer. Specifying <d:Style.DataContext> inside <Style> tag helped me. <Style> <d:Style.DataContext> <x:Type Type=”local:MyTreeItem” /> </d:Style.DataContext> <!–usual setters, triggers, etc.–> </Style> In this way d:DataContext can also be specified for controls, and we can provide it interfaces, … Read more

tech