.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

MVVM Demo App. Josh Smith

Posted By:      Posted Date: August 27, 2010    Points: 0   Category :WPF
I've been studying this code for a while now, taking notes and digging in.  I am an experienced programmer and have been around a while.  Was wondering if anyone else feels that same way I do about this demo..  It's a pretty difficult thing to get your "head around".  Does it seem that the simple thing we're trying to accomplish with the MVVM pattern is really difficult?  Or am I just a newbie to the pattern and eventually it will sink into the thich skull? I don't criticize the work done because as far as I can tell it's a nice piece of work.  All of the Abstract classes are well defined, the concrete classes are well defined, the commanding patterns are very interesting.  It just seems to me that we are jumping through hoops to do this stuff. Comments?Javaman

View Complete Post

More Related Resource Links

VS 2010 Version of Josh Smith's MVVM Demo Application

I tried downloading Josh Smith's MVVM demo yesterday and when I opened it up in VS 2010 I got several errors.  Has any one else encountered this problem?  And is there an updated version available for VS 2010?

WPF startup problem using Josh Smith's MVVM example project

  Hi folks I am teaching myself the MVVM pattern in WPF, with the help of Josh Smith's legendary article found here: http://msdn.microsoft.com/en-us/magazine/dd419663.aspx I decided to try the sample code, and then build my own WPF application from scratch, incrementally adding features based on the sample so I understand how it all fits together. I am having a few problems just getting a simple window to show and I was hoping somebody could indicate what I am doing wrong. I created a basic WPF project and used the code from the sample's Application.xaml and Application.xaml.vb, so I could use the special method for project startup that the sample illustrates. The code for Application.xaml is as follows:   <Application x:Class="JoshTest.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <Application.Resources> </Application.Resources> </Application>   The Application.xaml.vb class is as follows:   Imports Microsoft.VisualBasic Imports System.Globalization Imports System.Windows Imports System.Windows.Markup Imports JoshTest.ViewModel Imports System Namespace JoshTest Partial Public Class App Inherits Application Private viewModel As MainWindowViewModel Private window As MainWindow Shared Sub

WPF: If Heineken did MVVM Frameworks Part 4

MVVM is to have an instance of a particular Model (say currentPerson) inside my ViewModel (say PeopleViewModel) which is exposed to the View (say PeopleView). The View binds and edits the Model directly.

This definitely flies in the face of what most people consider to be the holy grail of MVVM pattern, but it's a fairly new pattern, so people are still finding their way with it every day, and this works for me very well. The reason I do what I do, is for the following reasons:

1.I have always had the luxury of being able to write my own UI specific Model classes. I would even do this if I was using some other Model classes first, such as LINQ to SQL or LINQ to Entity Framework. As these classes don't have everything a proper WPF Model class needs in my humble opinion. Though, they are pretty good, as they are Partial classes and use INotifyPropertyChanged/DataContract etc etc
2.I am a pragmatist and I do not like writing code for the sake of writing code. I have seen some MVVM apps where the author has had a Model with 50 properties on it, that are simply repeated in the ViewModel abstraction, where the ViewModel added nothing. On that day I decided I would never do that unless I have to.
3.I honestly see no harm in writing directly to the Model from the View, JUST SO LONG AS if the Model is InValid its data NEVER makes its way to the database. I honestly see no pro

ASP.NET Repeater Combined with jQuery FAQ Plugin Demo

The plugin is really straight forward. You just have to add your FAQ items in a header element such as an h2 and content sections in spans. This could be done in a pure HTML page or the FAQ items and content could be pulled from a database or XML file like I did in the download. Once the markup is built, the plugin does the rest. It will hide the content sections, add click events to the headers to open and close the content sections, toggle the plus/minus symbols and build the index shown on the right if you want.

Can I use MVVM for it?


I've read many articles about MVVM, but I can't get it into real code.

I have two lists which have common field user_id. First list contains all users with their names and second all files from all users. The asp.net page should show grid with newest file for every user. How can I get it into MVVM? Where should I bind username to his file? Need I ViewModel for every list or one common for both?


Regards, Gabriel

Toolbox: Online Scheduling, Jeff Smith's SQL Blog, Easy Regular Expressions, And More


This month Scott looks at improving development skills, writing regular expressions, a web scheduling control and a SQL tips blog.

Scott Mitchell

MSDN Magazine November 2008

Editor's Note: Tales of a GPS Demo


One of the most annoying things about the Internet is that no matter how hard you try to make something permanent, it can be gone tomorrow with no forwarding address. We found this out the hard way earlier this year, and we're hoping to remedy the situation with this Editor's Note.

MSDN Magazine September 2003

Video: The Access Show: Demo of Microsoft Access 2010 Services and Web Databases

Ryan McMinn and Clint Covington have a big announcement for us - Access Services is new functionality as part of SharePoint 2010 that allows users to create databases with forms and reports that run in the browser. (Length: 24:00)

MVVM with navigation pages

Hi how can i do for create a WPF navigation pages application using MVVM pattern? Thanks

Global Values in MVVM

When developing WinForms app, I created in the Program.cs module a singleton instance of a class that held values that I could reference anywhere in the application.  The values included connection string (the user could log onto anyone of a number of databases), various options from the database including information about the user, etc. Any recommendations about how to do this within the scope of the MVVM pattern for WPF?  

MVVM and Animation Control

I've been struggling with what should be a fairly straightforward issue...hoping someone's got a solution.I'm using MVVM in a scenario where I'm using a MediaElement in a View. The MediaElement has a Storyboard that I customize using DataBinding. The scenario works well when I'm using EventTriggers to control playback, but I have not discovered how to manipulate things using DataTriggers.My Storyboard consists of a ParallelTimeline, which contains the MediaTimeline (with Source, BeginTime and Duration databound to the ViewModel. I've got two buttons that are attached to the Storyboard in EventTriggers calling PauseStoryboard and ResumeStoryboard. This works well, but it's not the best paradigm for me.I am trying to accomplish a design where, if I have two such Views each containing a MediaElement with this type of Storyboard, when one Storyboard reaches its end point, the other View's MediaElement is triggered to play.I have tried to use a DataTrigger design, but I am having problems freezing the Storyboard because I'm using DataBinding to set some of the Storyboard parameters.Does anyone have any ideas as to how I can control a MediaElement via Storyboard/Timeline using DataTrigger instead of EventTrigger? Am I missing something obvious in MVVM?--- Jim ---

WPF MVVM pattern Projects

Hello,   I'm planning to develop WPF,C# using MVVM pattern.I'm looking for Sample projects using MVVM style i.e, like we have on Asp.net Web MVC NerdDinner,MVC MusicStore,Microsoft TownHall project.Can i find similar or any other help ful links for MVVM projects?    

MVVM. Access TabControl->TabItems from ViewModel

Hi Folks,   Well, I just start to use MVVM, and I want to migrate functionality from my old non mvvm project to my new mvvm project.   The problem is the following one: In my old app (wizard application), I use tab control. And I have such things as States there. For this purpose I use StateMachine approach: My tab control looks like:   private void sm_StateChanged(State current, State previous, State next) { switch (current.Name) { case StatesNames.WELCOME_SCREEN_STATE_NAME: MainTabControl.SelectedIndex = 0; break; case StatesNames.SERVER_SUMMARY_SCREEN_STATE_NAME: MainTabControl.SelectedIndex = 1; preCertificationTabControl.SelectedIndex = 0; break; case StatesNames.SERVER_DEFINITION_SCREEN_STATE_NAME: MainTabControl.SelectedIndex = 1; preCertificationTabControl.SelectedIndex = 1; break; case StatesNames.UPGRADE_PRECERTIFICATION_SCREEN_STATE_NAME: MainTabControl.SelectedIndex = 1; preCertificationTabControl.SelectedIndex = 2; break; case StatesNames.PRECERTIFICATION_SCREEN_STATE_NAME: NavigationStateMachine.GetInstance().SwitchToNextState(); break; } } Well, as you can see, I need to access my tabControl to indicate states :( but it is not correct from

WPF MVVM RoutedEvent

Hi, I want to make a custom search control. I have followed this example about the RoutedEvent and everythings works fine. The only problem is i have now a code behind file and i whant this in my ViewModel. How can i do this? Control class public class SearchTextBox: TextBox { public static readonly RoutedEvent searchEvent = EventManager.RegisterRoutedEvent( "Search", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(SearchTextBox)); public event RoutedEventHandler Search { add { AddHandler(searchEvent, value); } remove { RemoveHandler(searchEvent, value); } } void RaiseSearchEvent() { RoutedEventArgs newEventArgs = new RoutedEventArgs(SearchTextBox.searchEvent); RaiseEvent(newEventArgs); } protected override void OnTextChanged(System.Windows.Controls.TextChangedEventArgs e) { RaiseSearchEvent(); } } Application View <lib:SearchTextBox Search="....."/> Application Model ..... I've searched the internet and the related topics from MSDN but could not find the answer. Kind regards, Flaminio

Event Binding in MVVM

We are implementing the MVVM in the WPF forms that we are designing. For this we have designed the specific ViewModels for each WPF view. The WPF form has various controls such as button, combo box etc. We are registering the button click event and other events in the ViewModel constructor. Is there better way of handling this? Pls.guide

Drag and Drop Events binded to MVVM commands

Hi , I am developing the drag n drop functionality.. I want in my drop event my command from MVVM model should fire.. Can you help me in how to Map Drag drop events  into MVVM by Commands...
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend