Inheritance: Mixins.DynamicMixin, Mixins.IChangeTracking
Example #1
0
        public MainWindow()
        {
            InitializeComponent();

            Person = new Person
            {
                FirstName = "Ron",
                LastName = "Sponge",
            };

            Person.OnPropertyChanged(c => c.IsChanged,
                isChanged =>
                {
                    Title = isChanged ? Title + '*' : Title.TrimEnd('*');
                    Save.IsEnabled = Reset.IsEnabled = isChanged;
                });

            PersonDynamic = new PersonDynamic();

            PersonDynamic.OnPropertyChanged(c => c.IsChanged,
                isChanged =>
                {
                    Title = isChanged ? Title + '*' : Title.TrimEnd('*');
                    Save.IsEnabled = Reset.IsEnabled = isChanged;
                });

            Person.BeginEdit();
            DataContext = Person;
        }
Example #2
0
        public MainWindow()
        {
            InitializeComponent();

            Person = new Person
            {
                FirstName = "Ron",
                LastName  = "Sponge",
            };

            Person.OnPropertyChanged(c => c.IsChanged,
                                     isChanged =>
            {
                Title          = isChanged ? Title + '*' : Title.TrimEnd('*');
                Save.IsEnabled = Reset.IsEnabled = isChanged;
            });

            PersonDynamic = new PersonDynamic();

            PersonDynamic.OnPropertyChanged(c => c.IsChanged,
                                            isChanged =>
            {
                Title          = isChanged ? Title + '*' : Title.TrimEnd('*');
                Save.IsEnabled = Reset.IsEnabled = isChanged;
            });

            Person.BeginEdit();
            DataContext = Person;
        }