using System;
using System.IO;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Navigation;

namespace FingersDance.Control.Screen
{
	public partial class UserControlScreen
	{
		public UserControlScreen()
		{
			this.InitializeComponent();

			// Insert code required on object creation below this point.
		}


        private void ScatterViewPivot_ContactChanged(object sender, Microsoft.Surface.Presentation.ContactEventArgs e)
        {
            try
            {

                //myrect.Width = e.GetPosition(my_surfaceWindow).X;
                //myrect.Height = e.GetPosition(my_surfaceWindow).Y;

                Grid1.Width = e.GetPosition(UserControl).X;
                Grid1.Height = e.GetPosition(UserControl).Y;

                //Grid2.Width = 1024 - e.GetPosition(UserControl).X; 
                //Grid2.Height = 768 - e.GetPosition(UserControl).Y;

                //Grid3.Width = e.GetPosition(UserControl).X;
                //Grid3.Height = 768 - e.GetPosition(UserControl).Y;

                //Grid4.Width = 1024 - e.GetPosition(UserControl).X;
                //Grid4.Height = e.GetPosition(UserControl).Y;

            }
            catch (Exception ex) { }
        }

        private void ScatterViewItemPivot_ContactChanged(object sender, Microsoft.Surface.Presentation.ContactEventArgs e)
        {
            try
            {

                Grid1.Width = e.GetPosition(UserControl).X;
                Grid1.Height = e.GetPosition(UserControl).Y;

                Grid2.Width = 1024- e.GetPosition(UserControl).X;
                Grid2.Height = e.GetPosition(UserControl).Y;

                Grid3.Width = e.GetPosition(UserControl).X;
                Grid3.Height = 768 - e.GetPosition(UserControl).Y;

                Grid4.Width = 1024 - e.GetPosition(UserControl).X;
                Grid4.Height = 768 - e.GetPosition(UserControl).Y;

            }
            catch (Exception ex) { }
        }
	}
}