Inheritance: Mixins.DynamicMixin, Mixins.IChangeTracking
Exemplo n.º 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;
        }
Exemplo n.º 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;
        }