using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;

using BeWo.ViewModel;

namespace BeWo.View.Controls
{
    /// <summary>
    /// Interaction logic for ServiceRecordPopUp.xaml
    /// </summary>
    public partial class ServiceRecordPopUp : UserControl
    {
        public ServiceRecordPopUp(List<ServiceRecordVM> serviceRecords)
        {
            this.InitializeComponent();
            this.CommandBindings.Add(new CommandBinding(ApplicationCommands.Close, (s, e) => BeWoApp.MainControl.CloseCurrentPopUp()));
            this.DataContext = serviceRecords;

            if (serviceRecords == null || serviceRecords.Count == 0)
            {
                this.serviceRecordGrid.Visibility = Visibility.Collapsed;
            }
            else
            {
                this.tb_nodata.Visibility = Visibility.Collapsed;
            }
        }
    }
}