using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using Comal.Classes;
using InABox.Core;
namespace PRSDesktop
{
///
/// Interaction logic for ItemsPanel.xaml
///
public partial class ReadyToGoPanel : UserControl, IPanel
{
public ReadyToGoPanel()
{
InitializeComponent();
}
public bool IsReady { get; set; }
public event DataModelUpdateEvent OnUpdateDataModel;
public Dictionary Selected()
{
return new Dictionary(); // { { typeof(DeliveryItem).EntityName(), Items.SelectedRows } };
}
public void Setup()
{
Items.Refresh(true, false);
}
public void Shutdown()
{
}
public void CreateToolbarButtons(IPanelHost host)
{
}
public void Refresh()
{
Items.Refresh(false, true);
}
public string SectionName => "Ready To Go";
public DataModel DataModel(Selection selection)
{
var ids = Items.ExtractValues(x => x.ID, selection).ToArray();
return new DeliveryItemDataModel(new Filter(x => x.ID).InList(ids));
}
public void Heartbeat(TimeSpan time)
{
}
public Type DataType()
{
return typeof(DeliveryItem);
}
private void SearchBox_KeyUp(object sender, KeyEventArgs e)
{
if (e.Key == Key.Enter)
{
Items.Search = SearchBox.Text;
Items.Refresh(false, true);
}
}
private void ClearSearchButton_Click(object sender, RoutedEventArgs e)
{
Items.Search = "";
Items.Refresh(false, true);
}
}
}