CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets matching tags of MVVM
C#
public abstract class ViewModelBase : INotifyPropertyChanged
{
    public event PropertyChangedEventHandler PropertyChanged;
    protected void RaisePropertyChanged(string property)
    {
        if (PropertyChanged == null)
            return;
        PropertyChanged(this,
            new PropertyChangedEventArgs(property));
        PropertyChanged(this,
by Jerry Nixon   November 08, 2011 @ 10:39am
Tags: MVVM, C#
99 Views
no comments
 
C#
public class DelegateCommand : ICommand
{
    private readonly Predicate<object> _canExecute;
    private readonly Action<object> _execute;
 
    public event EventHandler CanExecuteChanged;
 
    public DelegateCommand(Action<object> execute) 
                   : this(execute, null)
    {
by Athens Springer   June 28, 2011 @ 7:09am
Tags: C#, WPF, MVVM
152 Views
no comments
 
C#
//Calling Code for VM to pass message box delegate
Func<string, string, MessageBoxButton, MessageBoxImage, MessageBoxResult> messageBox = (msg, caption, buttons, image) => MessageBox.Show(msg, caption, buttons, image);
 
//pass above variable to VM
 
//Usage of message box delegate variable inside VM
MessageBoxResult = messageBoxinVM("Test Message", "Test Caption for Message", MessageBoxButton.YesNoCancel, MessageBoxImage.Question);
by Vijay Sharma   January 13, 2011 @ 2:13am
289 Views
no comments
 
C#
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Windows.Data;
 
namespace VMLocatorSample.ViewModels
{
    public class ViewModelLocator
by Bobby Diaz   March 31, 2010 @ 8:44am
1023 Views
no comments
 
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate