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;
namespace Tango.Touch.Controls
{
public class TouchPanelEureka : TouchPanel
{
#region Prevent Focus Steal
///
/// The prevent scroll property
///
public static readonly DependencyProperty MakeEurekaFullScreenProperty =
DependencyProperty.RegisterAttached("MakeEurekaFullScreen",
typeof(bool), typeof(TouchPanelEureka),
new FrameworkPropertyMetadata(false));
///
/// Sets the MakeEurekaFullScreen attached property.
///
/// The element.
/// if set to true [value].
public static void SetMakeEurekaFullScreen(FrameworkElement element, bool value)
{
element.SetValue(MakeEurekaFullScreenProperty, value);
}
///
/// Gets the MakeEurekaFullScreen attached property.
///
/// The element.
///
public static bool GetMakeEurekaFullScreen(FrameworkElement element)
{
if (element != null)
{
return (bool)element.GetValue(MakeEurekaFullScreenProperty);
}
else
{
return false;
}
}
#endregion
static TouchPanelEureka()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(TouchPanelEureka), new FrameworkPropertyMetadata(typeof(TouchPanelEureka)));
}
protected override void OnCurrentDialogChanged(FrameworkElement dialog)
{
base.OnCurrentDialogChanged(dialog);
if (dialog != null)
{
if (GetMakeEurekaFullScreen(dialog))
{
_dialogBorder.CornerRadius = new CornerRadius(0);
_dialogBorder.Padding = new Thickness(0);
_dialogBorder.Margin = new Thickness(0, 125, 0, 0);
dialog.Width = this.ActualWidth;
dialog.Height = this.ActualHeight - 125;
}
else
{
_dialogBorder.CornerRadius = new CornerRadius(5);
_dialogBorder.Padding = new Thickness(10);
_dialogBorder.Margin = new Thickness(0);
}
}
}
}
}