private void DisplayData(TypeTransactionReason expense)
 {
     EnableAppBarStatus(true);
     // Navigate to the appropriate destination page, configuring the new page
     // by passing required information as a navigation parameter
     frmReason.Navigate(typeof(ReasonDetailFrame), expense);
 }
        private TypeTransactionReason NewTypeTransactionReason()
        {
            currTypeTransReason = new TypeTransactionReason();

            currTypeTransReason.PropertyChanged += new PropertyChangedEventHandler(currTypeTransReason_PropertyChanged);

            return currTypeTransReason;
        }
        protected override void LoadState(object navigationParameter, Dictionary<string, object> pageState)
        {
            App.Instance.Share = null;

            currTypeTransReason = navigationParameter as TypeTransactionReason;

            DefaultViewModel["TypeTransactionReason"] = currTypeTransReason;

            this.IsEnabled = currTypeTransReason != null;

            this.UpdateLayout();
        }
        private void Add_AppBarButtonClick(object sender, RoutedEventArgs e)
        {
            currTypeTransReason = NewTypeTransactionReason();
            ((ObservableCollection<TypeTransactionReason>)DataContext).Add(currTypeTransReason);

            DisplayData();

            EnableAppBarStatus(true);
        }
        private async void ItemGridView_ItemClick(object sender, ItemClickEventArgs e)
        {
            MessageDialog dialog = null;
            if (currTypeTransReason != null && currTypeTransReason.HasChanges)
            {
                dialog = new MessageDialog("The are changes. Please save the first.");
                //await dialog.ShowAsync();
                //return;
            }
            currTypeTransReason = e.ClickedItem as TypeTransactionReason;
            currTypeTransReason.PropertyChanged += new PropertyChangedEventHandler(currTypeTransReason_PropertyChanged);

            DisplayData();
        }