using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using C1.Silverlight;
using System.Collections;

namespace C1_Demo
{
	public partial class DemoTreeView : UserControl
	{
		public event EventHandler SelectedItemChanged;

		public bool AllowDragDrop
		{
			get { return WindowExplorerTreeView.AllowDragDrop; }
			set { WindowExplorerTreeView.AllowDragDrop = value; }
		}

        public bool ShowLines
        {
            get { return WindowExplorerTreeView.ShowLines; }
            set { WindowExplorerTreeView.ShowLines = value; }
        }

        public double LineThickness
        {
            get { return WindowExplorerTreeView.LineThickness; }
            set { WindowExplorerTreeView.LineThickness = value; }
        }

		public DemoTreeView()
		{
			InitializeComponent();

			WindowExplorerTreeView.ItemConverter = new CustomItemConverter();
			WindowExplorerTreeView.SelectionChanged += new SelectionChangedEventHandler(WindowExplorerTreeView_SelectionChanged);
		}

		void WindowExplorerTreeView_SelectionChanged(object sender, SelectionChangedEventArgs e)
		{
			if (SelectedItemChanged != null)
			{
				if (SelectedItemChanged != null)
				{
					SelectedItemChanged(this, new EventArgs());
				}
			};
		}

		#region ** ClearStyle properties

		public Brush DEMO_Background
		{
			get
			{
				return WindowExplorerTreeView.Background;
			}
			set
			{
				WindowExplorerTreeView.Background = value;
			}
		}

		public Brush DEMO_Foreground
		{
			get
			{
				return WindowExplorerTreeView.Foreground;
			}
			set
			{
				WindowExplorerTreeView.Foreground = value;
			}
		}

		public Brush DEMO_BorderBrush
		{
			get
			{
				return WindowExplorerTreeView.BorderBrush;
			}
			set
			{
				WindowExplorerTreeView.BorderBrush = value;
			}
		}

		public Brush MouseOverBrush
		{
			get
			{
				return WindowExplorerTreeView.MouseOverBrush;
			}
			set
			{
				WindowExplorerTreeView.MouseOverBrush = value;
			}
		}

		public Brush SelectedBackground
		{
			get
			{
				return WindowExplorerTreeView.SelectedBackground;
			}
			set
			{
				WindowExplorerTreeView.SelectedBackground = value;
			}
		}

        public Brush LineStroke
        {
            get
            {
                return WindowExplorerTreeView.LineStroke;
            }
            set
            {
                WindowExplorerTreeView.LineStroke = value;
            }
        }

		#endregion
	}
}
