mvvm

MVVM and avoiding Monolithic God object

I am in the completion stage of a large project that has several large components: image acquisition, image processing, data storage, factory I/O (automation project) and several others. Each of these components is reasonably independent, but for the project to run as a whole I need at least one instance of each component. Each componen...

Sometimes my dropdowns/datepickers will stop functioning?

Q: Where should I check to track this down? Issue: Opening a view model in my application sometimes makes dropdowns/datepickers nonfunctional. ie. dropdown won't drop and the datepicker calendar won't come up I suspect a binding issue but don't see one. Dropdowns have normal things like strings, numbers. One drop has a list of mi...

How to play Sound and Animations in MVVM

I have read alot of blogs about the best way to play sound/Animation but if possible I would like to see a simplified example on how this is done so I understand better. So to my understanding in MVVM The View-->Sound and Animation The ViewModel-->If some value is true, i would like to play the Sound and Animation on the view. Now Ho...

which is the best or widely used MVVM Toolkit for WPF?

Could you tell me which is the best MVVM pattern someone have to follow (like Prism). Where can I find hands-on examples to help? Actually, I am little confused which one to follow? ...

Regarding the ViewModel

Im struggling to understand the ViewModel part of the MVVM pattern. My current approach is to have a class, with no logic whatsoever (important), except that it implements INotifyPropertyChanged. The class is just a collection of properties, a struct if you like, describing an as small part of the data as possible. I consider this my Mod...

How to build a generic/re-usable modal dialog for WPF following MVVM

I would like to build a generic/re-usable modal dialog that I can use in our WPF (MVVM) - WCF LOB application. I have a Views and associated ViewModels that I would like to display using dialogs. Bindings between Views and ViewModels are done using Type-targeted DataTemplates. Here are some requirements that I have been able to draft: ...

Thoughts on writing a "flexible" API?

I may have the wrong "pattern" here, but I think it's a fair topic. I have an ASP.Net MVC application in which it calls out to a WCF service to get back the ViewModels that will be rendered. (the reason it's using a WCF service is so that other small MVC apps may also call on for these ViewModels...only internally, it's not a publicly ...

WPF MVVM View with varying number of objects. How to?

HI! I want to design view which will contain multiple objects in different locations. For example - it would be great if viewmodel could have field like list of objects (rectangles) and when i change/add members to list, new rectangles appear on view in specified positions. How do i create such view/viewmodel? ...

working with WPF usercontrol and MVVM

I have following questions Should the consumer of my usercontrol assign the usercontrol's DataContext or set some dependency property. (related to #3 : if DataContext then my individual items need to bind directly to the object given in DC, if DP then I have the luxury to have bind to any VM) If they set property, and if I am using 3 p...

WPF application with many user controls

Hi, I'm writing an application that is supposed to show and hide the content of the main window stack panel based on the user choice. For example, the user clicks on the button that displays the list of the customers, then click on the button that displays the ordering form. The customers content should be hidden and the ordering form sh...

Set ListBoxItem.IsSelected when child TextBox is Focused

Hi, I have a typical MVVM scenario: I have a ListBox that is binded to a List of StepsViewModels. I define a DataTemplate so that StepViewModels are rendered as StepViews. The StepView UserControl have a set of labels and TextBoxs. What I want to do is to select the ListBoxItem that is wrapping the StepView when a textBox is focused. I...

Modifying an individual TreeViewItem on a databound WPF TreeView without modifying the data source.

I've got a MVVM WPF app with the TreeView databound to a viewmodel class. It is essentially a file explorer. I want to add the ability to "Add a new folder" to the hierarchy. To achieve the desired functionality what I am trying to do is simply switch the Textblock out for an editable TextBox in my datatemplate. This is what my datat...

Cleanup vs Dispose(bool) in MVVM-light

In the lastest version of MVVM-light (V3 SP1) both "Dispose()" and "Dipose(bool)" methods in ViewModel class are marked Do not use this method anymore, it will be removed in a future version. Use ICleanup.Cleanup() instead Does this mean that IDisposable interface must not be implemented in all ViewModel classes that are derived f...

wpf mvvm client server application

First of all i must say i am new to wpf and mvvm. I want to develop a client-server application(clients send info to the server and the serer notifies one or more of them..consider something like yahoo messenger(some user changes his status..sends info to the server and the sever notifies his friends and changes to their UI are made) My ...

Can I remove duplicating events in EventAggregator?

Hi, I have a quite simple scenario that I cannot get to work correctly. I have 2 views, CarView and CarWindowView (childwindow) with corresponding ViewModels. In my CarView I have an EditButton that that opens CarWindowView (childwindow) where I can edit the Car object fields. My problem is that the DisplayModule method in my CarWindow...

CompositeWPF - MVVM - How to change the focus and tabnavigation to an element in view

Using CompositeWPF I have the following setup: <Window x:Name="MainWindow"> <View x:Name="MainView"> <View x:Name="CurrentSelectedView"/> </View> </Window> MainView is a view containing a menu structure. CurrentSelectedView changes depending on the menu selection you make. For this example lets assume the CurrentSelectedView c...

WPF App With several Usercontrols passing values to MainViewModel (MVVM)

I have a wpf app that shows 5 different usercontrols as you go through the system. Each usercontrol has a listbox on it. So i want to select an item and pass it back to MainViewModel. I have it working now so that i can store a value in ViewModelBase but it seems that my tactic for calling the User controls is flawed as I cant link up to...

WPF Calling a custom command on a custom control (from a viewmodel?)

I want to take a snap of the visual tree of a custom wpf control when the user clicks a button in a toolbar. The control is bound to a viewmodel. I have a BitmapSource dp in the custom control holding the snapped image which is bound to a property on my VM. The BitmapSource dp on the control is updated via a custom command on the contro...

List Implementation and Custom Types

I apologize in advance if this is vague...What is the best or most practical way to implement lists of custom types for MVVM? I had someone tell me that for each type I have I should have corresponding List of it. For example, if I have a Customer class I should also have a CustomerList class whose base class is List and within this c...

Property injection with Unity causing stack overflow...

Hi all, I have been using Unity for quite a while but I have always used it with constructor injection. In an effort to reduce the number of classes I have to inject into my view models (as my commands rely on them) I thought I would try creating a concept that uses Property Injection and thus quash the requirement for the large constru...