using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace DependencyPropertyExample
{
    /// <summary>
    /// Interaction logic for MyWindow.xaml
    /// </summary>

    public partial class MyWindow : System.Windows.Window
    {

        public MyWindow()
        {
            InitializeComponent();
        }

        // Example 18-7. Handling change notifications in a custom type

        protected override void OnPropertyChanged(
            DependencyPropertyChangedEventArgs e)
        {

            base.OnPropertyChanged(e);
            if (e.Property == UIElement.IsMouseOverProperty)
            {
                this.Background = this.IsMouseOver ? Brushes.Red : Brushes.Blue;
            }
        }

        // Example 18-7

    }
}