using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
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.Navigation;
using System.Windows.Shapes;
using Telerik.Windows.DragDrop;

namespace WpfApplication
{
    /// <summary>
    /// Interaction logic for Grid.xaml
    /// </summary>
    public partial class GridView : UserControl
    {
        public GridView()
        {
            InitializeComponent();

			DragDropManager.AddDragInitializeHandler(this.Rect, OnDragInit);
        }

		public void Button_Click1(object sender, RoutedEventArgs e)
		{
			if (window != null)
			{
				this.window.Close();
				this.window = null;
			}
		}

		private void OnDragInit(object sender, DragInitializeEventArgs e)
		{
			//e.DragVisual = new Rectangle() { Width = 20, Height = 20, Fill = new SolidColorBrush(Colors.Blue) };
			e.DragVisual = "Pesho";
		}

        public void Setup()
        {
            

        }

		private Window window = null;

		private void Button_Click(object sender, RoutedEventArgs e)
		{
			if (window == null)
			{
				window = new Window()
				{
					ShowActivated = false,
					//WindowStyle = WindowStyle.None,
					//AllowsTransparency = true,
					AllowDrop = false,
					Background = new SolidColorBrush(Colors.Aqua),
					//IsHitTestVisible = false,
					SizeToContent = SizeToContent.WidthAndHeight,
					//Topmost = true,
					ShowInTaskbar = true
				};

				window.Content = "Pesho";
				window.Show();
			}
		}
    }
}
