mvvm

Why aren't the MVP and MVVM patterns seen in Ruby, Python, or PHP?

I've been reading about these and they're pretty prominent in the .NET world. Why aren't there any web frameworks that implement any of these patterns in Ruby, Python, or PHP? Is it because it only works with component-based frameworks, like ASP.NET? Or are they just slow to adopt it? ...

Binding Events that are Unknown

I have a WPF Listbox filled with children that fire events. Now, I am dynamically loading each of the children but I want to hook up the events to a handler. Basically, each time one of the children give me a notificationEvent(Notification n), I want to add the Notification (n) to an observable collection. How would I do this so that n...

Linq and WPF databinding with an association database

I have 5 tables in my database with the following fields: Customer: ID (int), Name (string) Project: ID (int), Name (string) Task: ID (int), Name(string) Customer_Project: ID (int), CustomerID (int) ProjectID (int) Project_Task: ID (int), ProjectID(int), TaskID(int) The last two tables create associations so any number of Customers...

WPF View/ViewModels using Generics- how?

New to WPF, so please bear with me... Suppose I have 2 tables in SQL Thing OtherThing Both have the exact same fields: ID (int) Name (string) Description (string) IsActive (bit/bool) DateModified (DateTime) So, I want to create one Model (not two) and do something like this: BaseModel<T>() { public int ID {get;set;} ... } et...

Clean separation of UI with Caliburn MVVM

Looking into various MVVM frameworks for SL. In the Caliburn documentation I saw a code in a controller that calls MessageBox. Is this right or is this just for intro? Is there something like MessageBox service in Caliburn like in Chinch MVVM? ...

How Can I Add a New Command to a Control's Event

Hi, thanks for taking a look at this question. I have been building an application (VB/WPF) following Josh Smith's example of an MVVM pattern: Click here to view My Views have Controls which trigger a Command upon an event, such as a button click and these are bound to properties in the ViewModel. My ViewModel exposes properties of ty...

System.Timers.Timer leaking due to "direct delegate roots"

Apologies for the rather verbose and long-winded post, but this problem's been perplexing me for a few weeks now so I'm posting as much information as I can in order to get this resolved quickly. We have a WPF UserControl which is being loaded by a 3rd party app. The 3rd party app is a presentation application which loads and unloads co...

Whats so bad about binding your View to Property of a Model and NOT ViewModel ??

Hello, I often hear a Model must be wrapped by a ViewModel that the View is not coupled to the Model/not aware of it. With MVC it is common to bind the View to the Model... nobody complains so what ? I am frightened of creating all that wrappers and doing nearly only duplicating property stuff. ...

NHibernate MVVM Session Best Practice

What is the best place to store the NHibernate session if we only need one? In the main windows view model? In the app? In the DataAccess Class? ...

MVVM Light Toolkit samples

Does anyone know opensource WPF applications created using MVVM Light Toolkit? Or any samples? ...

Creating a ViewModel : do it before or after model data is available?

I have a WPF application that loads data from a data source. Until some data is loaded there is nothing to display. My question is do I: Create both V and VM before any data is available; set the data in the VM once available Create only V at the start; wait until data available then create the VM injecting the data Create both V and...

How do I annimate between modules/views in MVVM?

I have an MVVM Silverlight 4 application that holds a list of modules (a UserControl plus some metadata) in the main window's ViewModel. I am displaying the UserControl of the module in a ContentControl (Content is bound to "CurrentModule.View"). I want to add a bit of pop to the app by annimating the transitions between views. I've...

WPF MVVM KeyBinding not being recognized right away and not always working

For whatever reason, the KeyBindings for my UserControl aren't working as soon as my WPF Application loads. They do work after I press a button on the form but not when I set focus to the form by clicking or alt tabbing or moving or anything like that. And when they do work my enter keys print a random number. (sometimes 5, sometimes 7 e...

MVVM View-First Approach How Change View

Hi everybody, Does anybody have an idea how to change screens (views) in a MVVM View-First-Approach (The view instantiates the ViewModel: DataContext="{Binding Source={StaticResource VMLocator}, Path=Find[EntranceViewModel]}" ) For example: In my MainWindow (Shell) I show a entrance view with a Button "GoToBeach". <Window> <DockPa...

ObservableCollections in the ViewModel and IEnumerables in the Models?

Keep only ObservableCollections in the ViewModel and IEnumerables in the Model? Does following this general guideline make any sense? I'm thinking this is the way to go because the models don't care about updating the View with the RaiseNotifyChanged. ...

Execute Silverlight 4 Command on Load

How do you implement a Silverlight 4 command to execute when the user control loads instead of being mapped to an explicit button click? ...

silverlight adding single prism command delegate to a list of items in xaml

I'm building a menu using Prism (using a trtelerik tree view with hierarchy data templates but hopefully the details don't matter) and I'm trying to set up a Click.Command on each menu items bindings that will all call the same delegate command which is defined in the view model. The menu is built up out of items which I don't really wan...

C# generics with MVVM, pulling the T out of <T>

My Model is a generic class that contains a (for example) Value property which can be int, float, string, bool, etc. So naturally this class is represented something like Model<T>. For the sake of collections Model<T> implements the interface IModel, although IModel is itself empty of any content. My ViewModel contains and instance of M...

MVVM light - how to access property in other view model

Hi, I'm using mvvm light to build a Silverlight application. Is there a code snippet that shows how to access a view model's property or command from within another view model or user control's code behind? I guess it's simple, but I somehow missed something. Ueli ...

Styles Don't Update

I am trying to use theming within my application, but I am having a problem with my styling not being applied correctly. I run the following lines of code: App.Current.Resources.MergedDictionaries.Clear(); ResourceDictionary rd = new ResourceDictionary(); rd.Source = new Uri( "/Style2.xaml...