public INPCBinding()
        {
            InitializeComponent();

            employee = new EmployeeExample()
            {
                Name  = "Bobbie",
                Title = "QA"
            };

            DataContext = employee;
        }
Esempio n. 2
0
        public TwoWayBinding()
        {
            InitializeComponent();

            employee = new EmployeeExample()
            {
                Name           = "Bobbie",
                Title          = "QA",
                Address        = "123 fake street",
                YearsOfService = "5 years"
            };

            DataContext = employee;
        }
Esempio n. 3
0
        public DataConversion()
        {
            InitializeComponent();
            EmployeeExample employee = new EmployeeExample()
            {
                Name           = "Bob",
                Title          = "Developer",
                YearsOfService = "2 years",
                Address        = "123 fake street",
                StartDate      = new DateTime(2001, 1, 10)
            };

            DataContext = employee;
        }
        public static void Run()
        {
            Console.WriteLine(GetWhenToUse());
            Console.WriteLine(GetActors());
            Console.WriteLine(GetAlternatives());

            GoToNextStep();

            //Basic example
            EmployeeExample empExample = new EmployeeExample();

            empExample.Run();

            GoToNextStep();

            //Limited stack with serialization
            EmployeeSerializedExample empSerExample = new EmployeeSerializedExample();

            empSerExample.Run();

            GoToNextStep();

            //Iterative memento
            EmployeeIterativeExample empIterEx = new EmployeeIterativeExample();

            empIterEx.Run();
            GoToNextStep();

            //Basic memento with compression
            EmployeeCompressedExample empComp = new EmployeeCompressedExample();

            empComp.Run();
            //We used gzip encoding in here, but usually, one would use:
            //https://en.wikipedia.org/wiki/Delta_encoding
            //Git goes the middle way, it first stores the objects as they are.
            //and from time to time, it compresses them, by creating pack files
            //http://alblue.bandlem.com/2011/09/git-tip-of-week-objects-and-packfiles.html

            Console.WriteLine(GetPitfalls());
        }
Esempio n. 5
0
 public OneWayBinding()
 {
     InitializeComponent();
     // this is just one of many ways to bind data to the view (one way binding)
     DataContext = EmployeeExample.GetEmployee();
 }
Esempio n. 6
0
 public ListDataBinding()
 {
     InitializeComponent();
     DataContext = EmployeeExample.GetEmployees();
 }