55 lines
1.6 KiB
C#
55 lines
1.6 KiB
C#
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 VDash.WindowSelectors;
|
|
|
|
namespace VDash.UI
|
|
{
|
|
/// <summary>
|
|
/// Interaction logic for WindowSelectorEditor.xaml
|
|
/// </summary>
|
|
public partial class WindowSelectorEditor : UserControl,ISelectorEditor
|
|
{
|
|
public FromWindowTitle Selector { get; set; }
|
|
|
|
public WindowSelectorEditor(ref FromWindowTitle selector)
|
|
{
|
|
InitializeComponent();
|
|
Selector = selector;
|
|
cbSearchType.ItemsSource = Enum.GetValues(typeof(FromWindowTitle.TitleSearchType));
|
|
DataContext = selector;
|
|
cbSearchType.SelectedItem = selector.SearchType;
|
|
}
|
|
|
|
private void cbSearchType_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
|
{
|
|
Selector.SearchType = (FromWindowTitle.TitleSearchType)cbSearchType.SelectedItem;
|
|
}
|
|
|
|
public string[] ValidateInput()
|
|
{
|
|
List<string> issues = new List<string>();
|
|
if (cbSearchType.SelectedItem == null)
|
|
{
|
|
issues.Add("You must select a search type.");
|
|
}
|
|
if (String.IsNullOrWhiteSpace(Selector.TitleFilter))
|
|
{
|
|
issues.Add("You must enter search text.");
|
|
}
|
|
return issues.ToArray();
|
|
}
|
|
}
|
|
}
|