2017-01-26 13:00:31 +01:00
|
|
|
|
using ZicMoove.Model;
|
|
|
|
|
|
using ZicMoove.ViewModels;
|
2016-09-18 00:11:35 +02:00
|
|
|
|
using Xamarin.Forms;
|
2016-09-29 04:54:14 +02:00
|
|
|
|
using XLabs.Ioc;
|
|
|
|
|
|
using XLabs.Platform.Services;
|
2016-09-18 00:11:35 +02:00
|
|
|
|
|
2017-01-26 13:00:31 +01:00
|
|
|
|
namespace ZicMoove.Pages
|
2016-09-18 00:11:35 +02:00
|
|
|
|
{
|
2016-10-29 01:59:48 +02:00
|
|
|
|
using Data;
|
2016-11-14 17:55:24 +01:00
|
|
|
|
using ViewModels.EstimateAndBilling;
|
|
|
|
|
|
|
2016-09-18 00:11:35 +02:00
|
|
|
|
public partial class BookQueriesPage : ContentPage
|
|
|
|
|
|
{
|
|
|
|
|
|
public BookQueriesPage()
|
|
|
|
|
|
{
|
|
|
|
|
|
InitializeComponent();
|
2017-01-13 16:31:40 +01:00
|
|
|
|
BindingContext = new BookQueriesViewModel();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public BookQueriesPage(BookQueriesViewModel model)
|
|
|
|
|
|
{
|
|
|
|
|
|
InitializeComponent();
|
2016-10-29 01:59:48 +02:00
|
|
|
|
BindingContext = model;
|
2016-09-18 00:11:35 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
2017-01-13 16:31:40 +01:00
|
|
|
|
protected override void OnBindingContextChanged()
|
|
|
|
|
|
{
|
|
|
|
|
|
BookQueriesViewModel model = (BookQueriesViewModel) BindingContext;
|
|
|
|
|
|
if (model!=null)
|
|
|
|
|
|
{
|
|
|
|
|
|
model.RefreshQueries =
|
|
|
|
|
|
new Command(() =>
|
|
|
|
|
|
{
|
|
|
|
|
|
DataManager.Instance.BookQueries.Execute(null);
|
|
|
|
|
|
this.list.EndRefresh();
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
base.OnBindingContextChanged();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2016-09-18 00:11:35 +02:00
|
|
|
|
private void OnViewDetail(object sender, ItemTappedEventArgs e)
|
|
|
|
|
|
{
|
2017-01-13 16:31:40 +01:00
|
|
|
|
var item = e.Item as BookQueryViewModel;
|
|
|
|
|
|
App.NavigationService.NavigateTo<BookQueryPage>(true,item);
|
2016-09-18 00:11:35 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|