You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

79 lines
2.1 KiB
C#

using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Command;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
namespace Aucma.Scada.UI.viewModel.AssemblyPlan
{
public class SearchCriteriaViewModel : INotifyPropertyChanged
{
public SearchCriteriaViewModel()
{
SaveSearchCriteriaCommand = new RelayCommand(SaveSearchCriteria);
CloseWindowCommand = new RelayCommand<object>(t => CloseWindow(t));
Configurations = new ObservableCollection<string>
{
"Option 1",
"Option 2",
"Option 3",
"Option 4",
"Option 5",
"Option 6",
"Option 7",
"Option 8",
"Option 9",
"Option 10"
};
}
private ObservableCollection<string> _configurations = new ObservableCollection<string>();
public ObservableCollection<string> Configurations
{
get { return _configurations; }
set
{
_configurations = value;
OnPropertyChanged(nameof(Configurations));
}
}
public RelayCommand SaveSearchCriteriaCommand { get; set; }
public RelayCommand<object> CloseWindowCommand { get; set; }
private void SaveSearchCriteria()
{
var info = _configurations.ToList();
}
private void CloseWindow(object parameter)
{
var window = parameter as Window;
if (window != null)
{
window.Close();
}
}
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void OnPropertyChanged(string propertyName)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
}