VRDash/VDash/UI/OverlayEditor.xaml.cs

43 lines
1.2 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
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 VDash.Overlay.Config;
namespace VDash.UI
{
/// <summary>
/// Interaction logic for OverlayEditor.xaml
/// </summary>
public partial class OverlayEditor : UserControl,IOverlayEditor
{
public IOverlayEditor Editor { get { return (IOverlayEditor)bdrContent.Child; } set { bdrContent.Child = (UserControl)value; } }
public IOverlayConfig Config { get { return Editor.Config; } }
public OverlayEditor(IOverlayEditor editor)
{
InitializeComponent();
Editor = editor;
DataContext = Config;
}
private void tbWidth_PreviewTextInput(object sender, TextCompositionEventArgs e)
{
Regex regex = new Regex(@"^[1-9]\d*(\.\d+)?$");
e.Handled = regex.IsMatch(e.Text);
}
}
}