using System;
using System.Collections.Generic;
using System.Linq;
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;
using System.Windows.Media.Media3D;


namespace ModelVisual3D
{
    /// <summary>
    /// Interaction logic for ContainerUIElement3D.xaml
    /// </summary>
    public partial class ContainerUIElement3D : Window
    {
        Material _material;
        public ContainerUIElement3D()
        {
            InitializeComponent();

        }
        private void TeaPot_MouseEnter(object sender, MouseEventArgs e)
        {
            //dotychczasowy materiał jest zapisywany
            _material = (Material)this.Viewport3D.FindResource("TeaPotMaterial");
            DiffuseMaterial difMaterial = new DiffuseMaterial();
            SolidColorBrush solidColorBrush = new SolidColorBrush();
            solidColorBrush.Color = Colors.White;
            difMaterial.Brush = solidColorBrush;
            //nowy materiał jest zapisywany do zasobów
            this.Viewport3D.Resources["TeaPotMaterial"] = difMaterial;
        }

        private void TeaPot_MouseLeave(object sender, MouseEventArgs e)
        {
            //przywrócenie dotychczasowego zasobu
            this.Viewport3D.Resources["TeaPotMaterial"] = _material;
        }
    }
}
