Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Design Patterns
Message
General information
Forum:
ASP.NET
Category:
Other
Title:
Miscellaneous
Thread ID:
01460935
Message ID:
01461517
Views:
75
Tracy,

I compiled it in VS2010 and it works fine.

I still don't understand the PersonViewModel component. I could use some help with this.



>After you installed the toolkit, did you download the source from the codeproject link I gave you? I can build and run it fine...the definition it is looking for is in OliverCode.Commands.DelegateCommand.cs
>
>
>>Wow, this IS very clear. Thanks.
>>
>>However, I'm having some problems compiling the code. In the PersonViewMode class I have:
>>
>>
>>using System;
>>using System.Collections.Generic;
>>using System.Linq;
>>using System.Text;
>>using System.Windows.Input;
>>
>>namespace MVVM1
>>{
>>    internal class PersonViewModel
>>    {
>>        public PersonModel Person { get; set; }
>>
>>        private DelegateCommand savePersonCommand;
>>        public ICommand SavePersonCommand
>>        {
>>            get
>>            {                
>>                if(savePersonCommand == null)
>>                {
>>                    savePersonCommand = new DelegateCommand(new Action(SaveExecuted), new Func<bool(SaveCanExecute));
>>                }
>>
>>                return savePersonCommand;
>>            }
>>
>>        }
>>
>>        public PersonViewModel()
>>        {
>>            //This data will load as the default person from the model attached to the view
>>            Person = new PersonModel { FirstName = "John", LastName = "Doe", Age = 999 };
>>        }
>>
>>        public bool SaveCanExecute()
>>        {
>>            return Person.Age > 0 && !string.IsNullOrEmpty(Person.FirstName) && !string.IsNullOrEmpty(Person.LastName);
>>        }
>>
>>        public void SaveExecuted()
>>        {
>>            System.Windows.MessageBox.Show(string.Format("Saved: {0} {1} - ({2})", Person.FirstName, Person.LastName, Person.Age));
>>        }
>>    }
>>}
>>
>>
>>It can't find the DelegateCommand. I installed the toolkit he refers to. How do I make that available in my project?
>>
>>
>>
>>
>>>VERY simple:
>>>http://olivercode.net/2010/02/12/mvvm-model-view-view-model-for-dummiessimplified/
>>>(I also found it here:)
>>>http://www.codeproject.com/KB/WPF/MVVMForDummies.aspx
>>>
>>>>Will do. Thanks
>>>>
>>>>
>>>>>I recommend you start by watching these (very basic and clear):
>>>>>http://polymorphicpodcast.com/shows/mv-patterns/
>>>>>
>>>>>(good basic examples and over view to help you understand the MVP pattern and patterns in general for a beginner)
>>>>>
>>>>>Then move on to your link and the MVVM pattern...
>>>>>
>>>>>
>>>>>>Here's what this is all about....
>>>>>>
>>>>>>I got hired at a new job. They sent me a link to this http://msdn.microsoft.com/en-us/magazine/dd419663.aspx and they asked me
>>>>>>to be familiar with it.
>>>>>>
>>>>>>The article says that the Model-View-ViewModel pattern is base off the Model-View-Presenter pattern, which is in turn based off
>>>>>>the Model-View-Controller pattern. So I was reading all these articles trying to understand some history and also to understand
>>>>>>the terminolgy.
>>>>>>
>>>>>>I get that the Model is the database, and from what I can see the View is the UI. But some portions of these articles seem to
>>>>>>seperate the UI into more than one part.
>>>>>>
>>>>>>Then there's the Presenter and Controller. From what I can see they represent events occuring somewhere.
>>>>>>
>>>>>>I'm a bit lost here.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>>>Thanks.
>>>>>>>>
>>>>>>>>I'm looking at this wite here - http://www.enode.com/x/markup/tutorial/mvc.html
>>>>>>>
>>>>>>>FWIW if you are looking at this from a WPF POV stick to MVVM - it's far better suited to WPF than the MVC pattern because it makes it easier to build the complete view in XAML if neccessary (i.e. no code behind needed in the View)
>>>>>>>
>>>>>>>>
>>>>>>>>I'm having a hard time understanding what these pieces represent. I get the Model. That appears to be the data layer. But the View
>>>>>>>>and Controller portions are throwing me.
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>>I neglected to point out that some design patterns are documented on the Fox Wiki. There is also info on Wikipedia. And to be obvious, a web search will bring up lots of stuff.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>>Thanks Craig. Good info.
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform