diff --git a/BookAStar/BookAStar.Droid/Properties/AndroidManifest.xml b/BookAStar/BookAStar.Droid/Properties/AndroidManifest.xml index 6ece6f55..5f09cf21 100644 --- a/BookAStar/BookAStar.Droid/Properties/AndroidManifest.xml +++ b/BookAStar/BookAStar.Droid/Properties/AndroidManifest.xml @@ -63,4 +63,8 @@ + + + + \ No newline at end of file diff --git a/BookAStar/BookAStar/App.xaml.cs b/BookAStar/BookAStar/App.xaml.cs index e352f99a..c90b1eef 100644 --- a/BookAStar/BookAStar/App.xaml.cs +++ b/BookAStar/BookAStar/App.xaml.cs @@ -258,11 +258,12 @@ namespace BookAStar masterDetail.ToolbarItems.Add(tiSetts); masterDetail.ToolbarItems.Add(tiPubChat); this.MainPage = masterDetail; + NavigationService = new NavigationService(masterDetail.Detail.Navigation); } public static Task DisplayActionSheet(string title, string cancel, string destruction, string [] buttons) { - var currentPage = ((NavigationPage)Current.MainPage).CurrentPage; + var currentPage = CurrentApp.masterDetail.Detail.Navigation.NavigationStack.Last(); return currentPage.DisplayActionSheet(title, cancel, destruction, buttons); } diff --git a/BookAStar/BookAStar/Pages/EstimatePages/BookQueryPage.xaml b/BookAStar/BookAStar/Pages/EstimatePages/BookQueryPage.xaml index 304efc8d..819bdb67 100644 --- a/BookAStar/BookAStar/Pages/EstimatePages/BookQueryPage.xaml +++ b/BookAStar/BookAStar/Pages/EstimatePages/BookQueryPage.xaml @@ -29,9 +29,9 @@ + diff --git a/BookAStar/BookAStar/Pages/EstimatePages/EditEstimatePage.xaml.cs b/BookAStar/BookAStar/Pages/EstimatePages/EditEstimatePage.xaml.cs index f1874411..89e96add 100644 --- a/BookAStar/BookAStar/Pages/EstimatePages/EditEstimatePage.xaml.cs +++ b/BookAStar/BookAStar/Pages/EstimatePages/EditEstimatePage.xaml.cs @@ -49,6 +49,7 @@ namespace BookAStar.Pages bill.Add(com); DataManager.Current.EstimationCache.SaveEntity(); })}; + lineView.PropertyChanged += LineView_PropertyChanged; App.NavigationService.NavigateTo( true, lineView ); } @@ -62,11 +63,14 @@ namespace BookAStar.Pages DataManager.Current.EstimationCache.SaveEntity(); }) }; + lineView.PropertyChanged += LineView_PropertyChanged; + lineView.PropertyChanged += LineView_PropertyChanged; App.NavigationService.NavigateTo( true, lineView ); } + private void LineView_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { DataManager.Current.EstimationCache.SaveEntity(); diff --git a/BookAStar/BookAStar/ViewModels/EstimateAndBilling/BookQueryViewModel.cs b/BookAStar/BookAStar/ViewModels/EstimateAndBilling/BookQueryViewModel.cs index c410a561..0b2c66aa 100644 --- a/BookAStar/BookAStar/ViewModels/EstimateAndBilling/BookQueryViewModel.cs +++ b/BookAStar/BookAStar/ViewModels/EstimateAndBilling/BookQueryViewModel.cs @@ -10,6 +10,7 @@ namespace BookAStar.ViewModels.EstimateAndBilling using Model; using Model.Social; using Model.Workflow; + using System.Collections.ObjectModel; using System.Linq; class BookQueryViewModel : ViewModel, IBookQueryData @@ -26,6 +27,10 @@ namespace BookAStar.ViewModels.EstimateAndBilling EventDate = data.EventDate; Previsionnal = data.Previsionnal; Id = data.Id; + estimates = new ObservableCollection( + DataManager.Current.Estimates.Where( + e => e.Query.Id == Id + )); this.data = data; } private BookQueryData data; @@ -47,19 +52,17 @@ namespace BookAStar.ViewModels.EstimateAndBilling return DataManager.Current.EstimationCache.LocalGet(this.Id); } } - public Estimate Estimate { get - { - return DataManager.Current.Estimates.FirstOrDefault( - e=>e.Query.Id == Id - ); + private ObservableCollection estimates; + public ObservableCollection Estimates { + get { + return estimates; } } - public bool EstimationDone { get { - return Estimate != null; + return Estimates != null && Estimates.Count>0; } } diff --git a/BookAStar/BookAStar/ViewModels/EstimateAndBilling/EditEstimateViewModel.cs b/BookAStar/BookAStar/ViewModels/EstimateAndBilling/EditEstimateViewModel.cs index 49768fbd..ea8a3b64 100644 --- a/BookAStar/BookAStar/ViewModels/EstimateAndBilling/EditEstimateViewModel.cs +++ b/BookAStar/BookAStar/ViewModels/EstimateAndBilling/EditEstimateViewModel.cs @@ -32,10 +32,11 @@ namespace BookAStar.ViewModels.EstimateAndBilling { Data.Bill = new List( Bill ); NotifyPropertyChanged("FormattedTotal"); + NotifyPropertyChanged("Bill"); } private Estimate data; public Estimate Data { get { return data; } set { - data = value; + SetProperty(ref data, value); if (data.AttachedFiles == null) data.AttachedFiles = new List(); if (data.AttachedGraphics == null) data.AttachedGraphics = new List(); if (data.Bill == null) data.Bill = new List(); @@ -43,6 +44,11 @@ namespace BookAStar.ViewModels.EstimateAndBilling AttachedGraphicList = new ObservableCollection(data.AttachedGraphics); Bill = new ObservableCollection(data.Bill); Bill.CollectionChanged += Bill_CollectionChanged; + Title = Data.Title; + Description = Data.Description; + NotifyPropertyChanged("FormattedTotal"); + NotifyPropertyChanged("Query"); + NotifyPropertyChanged("CLient"); } } [JsonIgnore]