Ejemplo n.º 1
0
        private void OnAppBarDeleteIconClick(object sender, EventArgs e)
        {
            var tileUtility = TileUtility.Instance;
            var common      = Common.Instance;
            var querystring = GetFromQuerystring();

            if (!String.IsNullOrEmpty(querystring))
            {
                var result = MessageBox.Show(AppResources.DeleteMessageBoxText, AppResources.DeleteMessageBoxTitle, MessageBoxButton.OKCancel);
                if (result == MessageBoxResult.OK)
                {
                    tileUtility.RemoveTile(CurrentItem);
                    viewModel.Delete(CurrentItem);
                    common.NavigateToUrl(Globals.MainPageUri);
                }
            }
            else
            {
                common.ShowErrorMessage();
            }
        }
Ejemplo n.º 2
0
        private void OnContextMenuDeleteClick(object sender, RoutedEventArgs e)
        {
            var tileUtility = TileUtility.Instance;
            var common      = Common.Instance;

            if (SelectedItem != null)
            {
                _viewModel.Load();
                var item = (from i in _viewModel.Happenings where i.Guid == SelectedItem.Guid select i).FirstOrDefault();

                var result = MessageBox.Show(AppResources.DeleteMessageBoxText, AppResources.DeleteMessageBoxTitle, MessageBoxButton.OKCancel);
                if (result == MessageBoxResult.OK)
                {
                    tileUtility.RemoveTile(item);
                    _viewModel.Delete(item);
                    _viewModel.Load();
                    HappeningsListBox.DataContext = _viewModel.Happenings;
                }
            }
            else
            {
                common.ShowErrorMessage();
            }
        }