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

            currTypeFrequency = navigationParameter as TypeFrequency;

            DefaultViewModel["TypeFrequency"] = currTypeFrequency;

            this.IsEnabled = currTypeFrequency != null;            

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

            DisplayData();
        }
        private TypeFrequency NewTypeFrequency()
        {
            currTypeFrequency= new TypeFrequency();

            currTypeFrequency.PropertyChanged += new PropertyChangedEventHandler(currTypeFrequency_PropertyChanged);

            return currTypeFrequency;
        }
        private void Add_AppBarButtonClick(object sender, RoutedEventArgs e)
        {
            currTypeFrequency = NewTypeFrequency();
            ((ObservableCollection<TypeFrequency>)DataContext).Add(currTypeFrequency);

            DisplayData();

            AppBarAddButton.IsEnabled = false;
            AppBarDoneButton.IsEnabled = true;
            AppBarCancelButton.IsEnabled = true;
        }