private void RadDataBoundListBoxItemTap(object sender, ListBoxItemTapEventArgs e)
        {
            var item = e.Item.Content as ItemViewModel;
            if (item == null) return;
            if (item.HasObtained == item.MaxToObtain) return;

            if (App.ViewModel.UserScore > item.Price)
            {
                var count = int.Parse(item.HasObtained);
                var total = int.Parse(item.MaxToObtain);

                if (count < total)
                {
                    item.HasObtained = count + 1 + "";
                    App.ViewModel.UserScore -= item.Price;
                    App.ViewModel.Dashboard.Name = App.ViewModel.UserScore;

                    switch(item.Name)
                    {
                        case "Penalty -1":
                            App.ViewModel.TimeDetuctValue -= 1;
                            break;
                        case "Penalty -2":
                            App.ViewModel.TimeDetuctValue -= 2;
                            break;
                    }
                }
            }
            else
            {
                InsufficientFundWindow.IsOpen = true;
            }
        }
예제 #2
0
        private void ItemsControl_OnItemTap(object sender, ListBoxItemTapEventArgs e)
        {
            if (!(e.Item.DataContext is CatalogBookItemModel))
            {
                var              firstViewportElement = ItemsControl.ViewportItems.First();
                double           itemVerticalOffset;
                CatalogItemModel item;
                if (_scrollViewer.VerticalOffset < ItemsControl.ActualHeight * 2)
                {
                    itemVerticalOffset = -_scrollViewer.VerticalOffset;
                    item = ViewModel.FolderItems.First();
                }
                else
                {
                    var   transform        = firstViewportElement.TransformToVisual(ItemsControl);
                    Point absolutePosition = transform.Transform(new Point(0, 0));
                    itemVerticalOffset = absolutePosition.Y;
                    item = (CatalogItemModel)firstViewportElement.DataContext;
                }

                _navigationDataContexts.Push(item);
                _navigationVerticalOffsets.Push(itemVerticalOffset);
            }

            ViewModel.NavigateToItem((CatalogItemModel)e.Item.DataContext);
        }
        private void TranslationList_ItemTap(object sender, ListBoxItemTapEventArgs e)
        {
            TranslationLang trans = ((sender as RadDataBoundListBox).SelectedItem as TranslationLang);

            if (trans != null)
            {
                //check if not downloaded yet, download all verses of the translationId then change

                /*if ((Application.Current as App).db.GetVerseCount(trans.id) != 6236)
                 * {
                 *  RadMessageBox.Show("Download Translation",
                 *      MessageBoxButtons.OKCancel,
                 *      "Are you sure you want  to download Translation " + trans.translation_name.ToString() + " ?",
                 *      null,
                 *      false,
                 *      true,
                 *      HorizontalAlignment.Center,
                 *      VerticalAlignment.Top,
                 *      closedHandler: (args) =>
                 *      {
                 *          if (args.ClickedButton == null)
                 *          {
                 *              return;
                 *          }
                 *
                 *          if (args.Result == DialogResult.OK)
                 *          {
                 *              DownloadTranslations(trans.id);
                 *
                 *              AppSettings.TransSetting = trans.id.ToString();
                 *              AppSettings.TransNameSetting = trans.translation_name.ToString();
                 *              AppSettings.TransCodeSetting = trans.lang_code.ToString();
                 *
                 *              return;
                 *              //MessageBox.Show("Saved. (" + trans.id.ToString() + ") " + trans.translation_name);
                 *          }
                 *          else
                 *          {
                 *              // Do Nothing
                 *              return;
                 *          }
                 *      }
                 *      );
                 * }
                 * else
                 * {
                 *  AppSettings.TransSetting = trans.id.ToString();
                 *  AppSettings.TransNameSetting = trans.translation_name.ToString();
                 *  AppSettings.TransCodeSetting = trans.lang_code.ToString();
                 *
                 *  MessageBox.Show("Saved. (" + trans.id.ToString() + ") " + trans.translation_name);
                 * }*/

                AppSettings.TransSetting     = trans.id.ToString();
                AppSettings.TransNameSetting = trans.translation_name.ToString();
                AppSettings.TransCodeSetting = trans.lang_code.ToString();

                MessageBox.Show("Saved");
            }
        }
        private void lbFeedbackModules_ItemTap(object sender, ListBoxItemTapEventArgs e)
        {
            FeedbackModule item = e.Item.AssociatedDataItem.Value as FeedbackModule;

            if (ItemTapped != null)
                ItemTapped(sender, new ItemEventArgs(item));
        }
예제 #5
0
        protected virtual void OnHamburgerMenuItemTap(object sender, ListBoxItemTapEventArgs e)
        {
            // Needed on every UI interaction
            SdkService.MegaSdk.retryPendingConnections();

            var menuItem = e.Item.DataContext as HamburgerMenuItem;

            if (menuItem == null)
            {
                return;
            }

            if (menuItem.Type == this.CurrentHamburgerMenuItem)
            {
                if (this.PageDrawerLayout != null)
                {
                    this.PageDrawerLayout.CloseIfOpen();
                }
            }
            else
            {
                menuItem.TapAction.Invoke();
            }

            this.HamburgerMenuListBox.SelectedItem = null;
        }
예제 #6
0
        private void OnItemTap(object sender, ListBoxItemTapEventArgs e)
        {
            // In case that it is an account newly activated, the list of available plans shows the "Free" option.
            // If the user selects it, we only need to redirect it to the cloud drive
            if (((ProductBase)LstPlans.SelectedItem).AccountType == MAccountType.ACCOUNT_TYPE_FREE)
            {
                NavigateService.NavigateTo(typeof(MainPage), NavigationParameter.Normal);
                return;
            }

            // Else we need to identify the selected plan and send it along the Monthly and Annual plans of this type to the PaymentPage
            for (int i = 0; i < _myAccountPageViewModel.UpgradeAccount.Products.Count; i++)
            {
                if (_myAccountPageViewModel.UpgradeAccount.Products.ElementAt(i).AccountType == ((ProductBase)LstPlans.SelectedItem).AccountType)
                {
                    switch (_myAccountPageViewModel.UpgradeAccount.Products.ElementAt(i).Months)
                    {
                    case 1:
                        PhoneApplicationService.Current.State["SelectedPlanMonthly"] = _myAccountPageViewModel.UpgradeAccount.Products.ElementAt(i);
                        break;

                    case 12:
                        PhoneApplicationService.Current.State["SelectedPlanAnnualy"] = _myAccountPageViewModel.UpgradeAccount.Products.ElementAt(i);
                        break;

                    default:
                        break;
                    }
                }
            }

            PhoneApplicationService.Current.State["SelectedPlan"] = LstPlans.SelectedItem;
            NavigateService.NavigateTo(typeof(PaymentPage), NavigationParameter.Normal);
        }
        private void lbProfiles_ItemTap(object sender, ListBoxItemTapEventArgs e)
        {
            curProfile = e.Item.AssociatedDataItem.Value as Profile;

            App.EcosModel.Connect(curProfile.IPAddress, curProfile.Port);



            // for test only!!!
            //EcosModel_Connected(null, null);

            //if (App.EcosModel.LocomotivesManager.Items.Count == 0)
            //{
            //    for (int i = 1; i < 50; i++)
            //        App.EcosModel.LocomotivesManager.Items.Add(new Locomotive(i, i, i.ToString("d2") + "__Locomotive ", i % 2 == 0 ? "DCC28" : "DCC128")
            //        {
            //            IsMyFavorite = i % 2 == 0,
            //        });

            //    //for (int i = 1; i < 50; i++)
            //    //    App.EcosModel.LocomotivesManager.Items.Add(new Locomotive(i, i, "Consist " + i, "DCC28"));
            //}

            //if (App.EcosModel.AccessoriesManager.Items.Count == 0)
            //{
            //    for (int i = 1; i < 50; i++)
            //        App.EcosModel.AccessoriesManager.Items.Add(new Accessory(i, i.ToString("d2") + "__Accessory ", "", i.ToString(), "", i % 2 == 0 ? "MM" : "DCC")
            //        {
            //            IsMyFavorite = i % 2 == 0,
            //        });
            //}
        }
        private void ChapterList_ItemTap(object sender, ListBoxItemTapEventArgs e)
        {
            Chapter chapter = ((sender as RadDataBoundListBox).SelectedItem as Chapter);

            if (chapter != null)
            {
                //MessageBox.Show(chapter.chapter_id+"-"+chapter.name);
                NavigationService.Navigate(new Uri("/Views/Verses.xaml?chapterId=" + chapter.chapter_id.ToString() + "&chapterName=" + chapter.tr_name.ToString() + "&type=" + chapter.type + "&enName=" + chapter.en_name, UriKind.Relative));

                /*
                 * string audioUrl = "http://web.quran360.com/audio/ch_saad_al_ghaamidi/00" + chapter.chapter_id + ".mp3";
                 *
                 * //MessageBox.Show(audioUrl);
                 *
                 * AudioTrack audio = new AudioTrack(new Uri(audioUrl, UriKind.Absolute),
                 *      chapter.chapter_id + ". " + chapter.tr_name,
                 *      chapter.en_name,
                 *      chapter.en_name,
                 *      null);
                 *
                 * BackgroundAudioPlayer player = BackgroundAudioPlayer.Instance;
                 * player.Track = audio;
                 * player.Play();
                 *
                 * if (PlayState.Playing == BackgroundAudioPlayer.Instance.PlayerState)
                 * {
                 *  player.Pause();
                 * }
                 * else
                 * {
                 *  player.Play();
                 * }
                 */
            }
        }
        public void Selected(ListBoxItemTapEventArgs eventArgs)
        {
            MovieViewModel movie = (MovieViewModel)eventArgs.Item.Content;

            this.navigationService.UriFor<MovieViewModel>()
                .WithParam(p => p.Id, movie.Id)
                .Navigate();
        }
예제 #10
0
 private void ProjectsList_ItemTap(object sender, ListBoxItemTapEventArgs e)
 {
     if (ProjectsList.SelectedItem != null)
     {
         Project project = (ProjectsList.SelectedItem as Lazy <Project>).Value;
         NavigationService.Navigate(new Uri("/Views/ViewProject.xaml?ProjectId=" + project.Id, UriKind.Relative));
     }
 }
예제 #11
0
 private void TasksList_ItemTap(object sender, ListBoxItemTapEventArgs e)
 {
     if (TasksList.SelectedItem != null)
     {
         Task task = (TasksList.SelectedItem as TableIndex <Task, Tuple <DateTime, bool>, int>).LazyValue.Value;
         NavigationService.Navigate(new Uri("/Views/ViewTask.xaml?TaskId=" + task.Id, UriKind.Relative));
     }
 }
        public void Selected(ListBoxItemTapEventArgs eventArgs)
        {
            var movie = (GenreViewModel)eventArgs.Item.Content;

            this.navigationService.UriFor<GenreViewModel>()
                .WithParam(p => p.Name, movie.Name)
                .Navigate();
        }
예제 #13
0
 void list_ItemTap(object sender, ListBoxItemTapEventArgs e)
 {
     if (ItemTapCommand != null)
     {
         var item = e.Item.AssociatedDataItem.Value;
         ItemTapCommand.Execute(item);
     }
 }
        public void OnItemTap(object sender, ListBoxItemTapEventArgs e)
        {
            var targetListBox = sender as RadDataBoundListBox;
            _commandToDelete = targetListBox.SelectedValue.ToString();
            var message = "Are you sure you want to delete the voice command \"" + _commandToDelete + "\"";

            RadMessageBox.Show(message, MessageBoxButtons.OKCancel, closedHandler: (arg) => DeleteSelectedsCommands(arg));
        }
        private void lbCollections_ItemTap(object sender, ListBoxItemTapEventArgs e)
        {
            UserItemsGroup item = e.Item.AssociatedDataItem.Value as UserItemsGroup;

            App.ProfilesManager.SelectedItem.SelectedCollection = item;

            NavigationService.Navigate(new Uri("/CollectionPage.xaml", UriKind.Relative));
        }
예제 #16
0
 private void list_ItemTap(object sender, ListBoxItemTapEventArgs e)
 {
     if (ItemTapCommand != null)
     {
         var item = e.Item.AssociatedDataItem.Value;
         ItemTapCommand.Execute(item);
     }
 }
        public void Selected(ListBoxItemTapEventArgs eventArgs)
        {
            TvSeasonViewModel movie = (TvSeasonViewModel)eventArgs.Item.Content;

            this.navigationService.UriFor<TvEpisodeListViewModel>()
                .WithParam(p => p.Season, movie.Season)
                .WithParam(p => p.TvshowId, movie.TvshowId)
                .Navigate();
        }
예제 #18
0
        private void MovieListBox_ItemTap(object sender, ListBoxItemTapEventArgs e)
        {
            ItemViewModel movieCategory = this.MovieListBox.SelectedItem as ItemViewModel;

            this.MovieName.Text         = HttpUtility.UrlDecode(movieCategory.Title);
            this.coverImage.ImageSource = new BitmapImage(new Uri(HttpUtility.UrlDecode(movieCategory.IMAGE), UriKind.RelativeOrAbsolute));
            GetEpisodes(movieCategory.URL);
            this.RootPivot.SelectedIndex = 0;
        }
예제 #19
0
        private void List_ItemTap(object sender, ListBoxItemTapEventArgs e)
        {
            Topic topic = ((sender as RadDataBoundListBox).SelectedItem as Topic);

            if (topic != null)
            {
                NavigationService.Navigate(new Uri("/Views/TopicItems.xaml?topicId=" + topic.id + "&topicTitle=" + topic.topic_title, UriKind.Relative));
            }
        }
예제 #20
0
        private void List_ItemTap(object sender, ListBoxItemTapEventArgs e)
        {
            Index index = ((sender as RadDataBoundListBox).SelectedItem as Index);

            if (index != null)
            {
                NavigationService.Navigate(new Uri("/Views/IndexItems.xaml?indexId=" + index.id + "&indexTitle=" + index.index_title, UriKind.Relative));
            }
        }
예제 #21
0
        private void TopicItemsList_ItemTap(object sender, ListBoxItemTapEventArgs e)
        {
            TopicItem topicItem = ((sender as RadDataBoundListBox).SelectedItem as TopicItem);

            if (topicItem != null)
            {
                App.ViewModel.LoadChapterRec(topicItem.chapter_id);
                NavigationService.Navigate(new Uri("/Views/Verses.xaml?chapterId=" + topicItem.chapter_id + "&verseId=" + topicItem.verse_id + "&chapterName=" + App.ViewModel.ChapterRec.tr_name.ToString() + "&type=" + App.ViewModel.ChapterRec.type + "&enName=" + App.ViewModel.ChapterRec.en_name, UriKind.Relative));
            }
        }
예제 #22
0
 private void lbRss_ItemTap(object sender, ListBoxItemTapEventArgs e)
 {
     SyndicationItem item = e.Item.AssociatedDataItem.Value as SyndicationItem;
     if (item != null && item.Links.Count > 0)
     {
         WebBrowserTask webBrowserTask = new WebBrowserTask();
         webBrowserTask.Uri = item.Links.FirstOrDefault().Uri;
         webBrowserTask.Show();
     }
 }
예제 #23
0
        private void SearchTermDetailList_ItemTap(object sender, ListBoxItemTapEventArgs e)
        {
            Verse verse = ((sender as RadDataBoundListBox).SelectedItem as Verse);

            if (verse != null)
            {
                App.ViewModel.LoadChapterRec(verse.chapter_id);
                NavigationService.Navigate(new Uri("/Views/Verses.xaml?chapterId=" + verse.chapter_id + "&verseId=" + verse.verse_id + "&chapterName=" + App.ViewModel.ChapterRec.tr_name.ToString() + "&type=" + App.ViewModel.ChapterRec.type + "&enName=" + App.ViewModel.ChapterRec.en_name, UriKind.Relative));
            }
        }
        private void SearchTermList_ItemTap(object sender, ListBoxItemTapEventArgs e)
        {
            SearchTerm searchTerm = ((sender as RadDataBoundListBox).SelectedItem as SearchTerm);

            if (searchTerm != null)
            {
                //MessageBox.Show(searchTerm.search_text);
                NavigationService.Navigate(new Uri("/Views/SearchDetailPage.xaml?SearchText=" + searchTerm.search_text, UriKind.Relative));
            }
        }
        private void BookMarkList_ItemTap(object sender, ListBoxItemTapEventArgs e)
        {
            BookMark bookMark = ((sender as RadDataBoundListBox).SelectedItem as BookMark);

            if (bookMark != null)
            {
                App.ViewModel.LoadChapterRec(bookMark.chapter_id);
                NavigationService.Navigate(new Uri("/Views/Verses.xaml?chapterId=" + bookMark.chapter_id.ToString() + "&verseId=" + bookMark.verse_id.ToString() + "&chapterName=" + App.ViewModel.ChapterRec.tr_name.ToString() + "&type=" + App.ViewModel.ChapterRec.type + "&enName=" + App.ViewModel.ChapterRec.en_name, UriKind.Relative));
            }
        }
예제 #26
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private async void ResultsSuppliers_OnItemTap(object sender, ListBoxItemTapEventArgs e)
 {
     //throw new NotImplementedException();
     try
     {
         ViewModelLocator.MainStatic.SearchItem.CurrentSupplierItem = (SupplierItem)ResultsSuppliers.SelectedItem;
         NavigationService.Navigate(new Uri("/Pages/SuppliersDetailPage.xaml", UriKind.Relative));
     }
     catch { };
 }
예제 #27
0
        private void lstRecent_Tap(object sender, ListBoxItemTapEventArgs e)
        {
            var item = lstRecentItems.SelectedItem as ProductViewModel;

            if (item == null)
            {
                return;
            }

            NavigationService.Navigate(new Uri("/ProductDetails.xaml?id=" + item.Id, UriKind.Relative));
        }
예제 #28
0
        private void OnCameraUploadsItemTap(object sender, ListBoxItemTapEventArgs e)
        {
            if (!CheckTappedItem(e.Item))
            {
                return;
            }

            LstCloudDrive.SelectedItem = null;

            _cameraUploadsPageViewModel.CameraUploads.OnChildNodeTapped((IMegaNode)e.Item.DataContext);
        }
        private void OnItemTap(object sender, ListBoxItemTapEventArgs e)
        {
            if (!CheckTappedItem(e.Item))
            {
                return;
            }

            LstSavedForOffline.SelectedItem = null;

            _savedForOfflineViewModel.SavedForOffline.OnChildNodeTapped((IOfflineNode)e.Item.DataContext);
        }
예제 #30
0
        private void OnFolderLinkItemTap(object sender, ListBoxItemTapEventArgs e)
        {
            if (!CheckTappedItem(e.Item))
            {
                return;
            }

            LstCloudDrive.SelectedItem = null;

            _folderLinkViewModel.FolderLink.OnChildNodeTapped((IMegaNode)e.Item.DataContext);
        }
예제 #31
0
        private void OnOutgoingSharedItemTap(object sender, ListBoxItemTapEventArgs e)
        {
            if (!CheckTappedItem(e.Item))
            {
                return;
            }

            this.LstOutgoingSharedFolders.SelectedItem         = null;
            _sharedItemsViewModel.IsOutSharedItemsRootListView = false;

            _sharedItemsViewModel.OutShares.OnChildNodeTapped((IMegaNode)e.Item.DataContext);
        }
예제 #32
0
        public void Open(ListBoxItemTapEventArgs args)
        {
            var context = args.Item.DataContext as BoardViewModel;

            if (context == null)
            {
                return;
            }

            _navigationService.UriFor <Boards.BoardViewModel>()
            .WithParam(x => x.Id, context.Id)
            .Navigate();
        }
예제 #33
0
        private void searchItem_Tap(object sender, ListBoxItemTapEventArgs e)
        {
            var list = sender as RadDataBoundListBox;

            if (list == null)
            {
                return;
            }

            var item = list.SelectedItem as SearchResultViewModel;

            if (item == null)
            {
                return;
            }

            NavigationService.Navigate(new Uri("/ProductDetails.xaml?id=" + item.Id, UriKind.Relative));
        }
예제 #34
0
        private void VersesList_ItemTap(object sender, ListBoxItemTapEventArgs e)
        {
            Verse verse = ((sender as RadDataBoundListBox).SelectedItem as Verse);

            if (verse != null)
            {
                int result = (Application.Current as App).db.SetLastRead(verse.chapter_id, verse.verse_id);

                if (result == 0)
                {
                    MessageBox.Show("Last Read upadate Failed.");
                }
                else
                {
                    //MessageBox.Show("Last Read Saved.");
                }

                NavigationService.Navigate(new Uri("/Views/VerseComparePage.xaml?SuraID=" + verse.chapter_id + "&VerseID=" + verse.verse_id, UriKind.Relative));
            }
        }
예제 #35
0
        private void radListStores_Tap(object sender, ListBoxItemTapEventArgs e)
        {
            var storeInfo = listStockInfo.SelectedItem as StockInfo;

            if (storeInfo == null)
            {
                return;
            }

            var dh = new DialogService();

            var storeDetails = new StoreDetails();

            storeDetails.SetInfo(storeInfo);
            dh.Child = storeDetails;

            dh.AnimationType = DialogService.AnimationTypes.Fade;

            dh.Show();
        }
예제 #36
0
        private async void OnSelectedPaymentMethod(object sender, ListBoxItemTapEventArgs e)
        {
            if (!NetworkService.IsNetworkAvailable(true))
            {
                return;
            }

            switch (((PaymentMethod)LstPaymentMethods.SelectedItem).PaymentMethodType)
            {
            case MPaymentMethod.PAYMENT_METHOD_WINDOWS_STORE:
                await LicenseService.PurchaseProduct(_paymentViewModel.SelectedProduct);

                break;

            case MPaymentMethod.PAYMENT_METHOD_CENTILI:
            case MPaymentMethod.PAYMENT_METHOD_FORTUMO:
                // If user has accessed a public node in the last 24 hours, also send the node handle (Task #10800)
                var lastPublicNodeHandle = SettingsService.GetLastPublicNodeHandle();
                if (lastPublicNodeHandle.HasValue)
                {
                    SdkService.MegaSdk.getPaymentIdWithLastPublicHandle(
                        _paymentViewModel.SelectedProduct.Handle, lastPublicNodeHandle.Value,
                        new GetPaymentUrlRequestListener(((PaymentMethod)LstPaymentMethods.SelectedItem).PaymentMethodType));
                    break;
                }

                SdkService.MegaSdk.getPaymentId(_paymentViewModel.SelectedProduct.Handle,
                                                new GetPaymentUrlRequestListener(((PaymentMethod)LstPaymentMethods.SelectedItem).PaymentMethodType));
                break;

            case MPaymentMethod.PAYMENT_METHOD_CREDIT_CARD:
                PageSubtitle.Text = UiResources.EnterPaymentDetails;
                _paymentViewModel.ProductSelectionIsEnabled       = false;
                _paymentViewModel.PaymentMethodSelectionIsEnabled = false;
                _paymentViewModel.CreditCardPaymentIsEnabled      = true;
                ((ApplicationBarIconButton)ApplicationBar.Buttons[0]).IsEnabled = true;
                break;
            }
        }
        private void RadDataBoundListBoxItemTap(object sender, ListBoxItemTapEventArgs e)
        {
            var item = e.Item.Content as ItemViewModel;
            if (item == null) return;
            if (item.HasObtained == item.MaxToObtain)
                OnMaximumReached();

            if (App.ViewModel.UserScore >= item.Price) {
                var count = int.Parse(item.HasObtained);
                var total = int.Parse(item.MaxToObtain);

                if (count < total) {
                    Utils.CoinSound.Play();
                    Utils.SendEvent("Purchase Items", item.Name, null, 0);
                    item.HasObtained = count + 1 + "";
                    App.ViewModel.UserScore -= item.Price;
                    App.ViewModel.Dashboard.Name = App.ViewModel.UserScore;

                    switch (item.Name) {
                        case "Penalty8":
                            SetPenalty(8);
                            break;
                        case "Penalty6":
                            SetPenalty(6);
                            break;
                        case "Penalty4":
                            SetPenalty(4);
                            break;
                        case "Penalty2":
                            SetPenalty(2);
                            break;
                    }
                }
                else
                    OnMaximumReached();
            }
            else
                OnMoneyNotSufficient();
        }
 private void StarbucksCards_ItemTap(object sender, ListBoxItemTapEventArgs e)
 {
     Frame.Navigate(typeof(CardDetailsView), ViewModel.SelectedCard);
 }
예제 #39
0
 private void Items_ItemTap(object sender, ListBoxItemTapEventArgs e)
 {
     var item = Items.SelectedItem as MealItemViewModel;
     if (item != null)
     {
         ViewModel.EditItem.Execute(item);
     }
     Items.SelectedItem = null;
 }
 private void ItemsControl_OnItemTap(object sender, ListBoxItemTapEventArgs e)
 {
     ((CatalogSearchPageViewModel)DataContext).NavigateToItem((CatalogBookItemModel)e.Item.DataContext);
 }
 private void lbSnifferPackets_ItemTap(object sender, ListBoxItemTapEventArgs e)
 {
     SnifferPacket item = e.Item.AssociatedDataItem.Value as SnifferPacket;
     //(Application.Current.RootVisual as PhoneApplicationFrame).Navigate(new Uri("/SnifferPacketInfoPage.xaml", UriKind.Relative));
 }
예제 #42
0
 private void ProjectsList_ItemTap(object sender, ListBoxItemTapEventArgs e)
 {
     if (ProjectsList.SelectedItem != null)
     {
         Project project = (ProjectsList.SelectedItem as Lazy<Project>).Value;
         NavigationService.Navigate(new Uri("/Views/ViewProject.xaml?ProjectId=" + project.Id, UriKind.Relative));
     }
 }
예제 #43
0
 private void TasksList_ItemTap(object sender, ListBoxItemTapEventArgs e)
 {
     if (TasksList.SelectedItem != null)
     {
         Task task = (TasksList.SelectedItem as TableIndex<Task, Tuple<DateTime, bool>, int>).LazyValue.Value;
         NavigationService.Navigate(new Uri("/Views/ViewTask.xaml?TaskId=" + task.Id, UriKind.Relative));
     }
 }
 private void ItemsControl_OnItemTap(object sender, ListBoxItemTapEventArgs e)
 {
     ((AllCatalogsSearchPageViewModel)DataContext).NavigateToItem((CatalogBookItemModel) e.Item.DataContext);
 }
        private void TranslationList_ItemTap(object sender, ListBoxItemTapEventArgs e)
        {
            TranslationLang trans = ((sender as RadDataBoundListBox).SelectedItem as TranslationLang);
            if (trans != null)
            {

                //check if not downloaded yet, download all verses of the translationId then change
                /*if ((Application.Current as App).db.GetVerseCount(trans.id) != 6236)
                {
                    RadMessageBox.Show("Download Translation",
                        MessageBoxButtons.OKCancel,
                        "Are you sure you want  to download Translation " + trans.translation_name.ToString() + " ?",
                        null,
                        false,
                        true,
                        HorizontalAlignment.Center,
                        VerticalAlignment.Top,
                        closedHandler: (args) =>
                        {
                            if (args.ClickedButton == null)
                            {
                                return;
                            }

                            if (args.Result == DialogResult.OK)
                            {
                                DownloadTranslations(trans.id);

                                AppSettings.TransSetting = trans.id.ToString();
                                AppSettings.TransNameSetting = trans.translation_name.ToString();
                                AppSettings.TransCodeSetting = trans.lang_code.ToString();

                                return;
                                //MessageBox.Show("Saved. (" + trans.id.ToString() + ") " + trans.translation_name);
                            }
                            else
                            {
                                // Do Nothing
                                return;
                            }
                        }
                        );
                }
                else
                {
                    AppSettings.TransSetting = trans.id.ToString();
                    AppSettings.TransNameSetting = trans.translation_name.ToString();
                    AppSettings.TransCodeSetting = trans.lang_code.ToString();

                    MessageBox.Show("Saved. (" + trans.id.ToString() + ") " + trans.translation_name);
                }*/

                AppSettings.TransSetting = trans.id.ToString();
                AppSettings.TransNameSetting = trans.translation_name.ToString();
                AppSettings.TransCodeSetting = trans.lang_code.ToString();

                MessageBox.Show("Saved");
            }
        }
예제 #46
0
 private void List_ItemTap(object sender, ListBoxItemTapEventArgs e)
 {
     Index index = ((sender as RadDataBoundListBox).SelectedItem as Index);
     if (index != null)
     {
         NavigationService.Navigate(new Uri("/Views/IndexItems.xaml?indexId=" + index.id + "&indexTitle=" + index.index_title, UriKind.Relative));
     }
 }
예제 #47
0
 private void OnItemTap(object sender, ListBoxItemTapEventArgs e)
 {
     NavigateService.NavigateTo(typeof(MediaAlbumPage), NavigationParameter.Normal, LstMediaAlbums.SelectedItem);
 }
        private void lbAccessories_ItemTap(object sender, ListBoxItemTapEventArgs e)
        {
            Accessory item = e.Item.AssociatedDataItem.Value as Accessory;

            if (ItemTapped != null)
                ItemTapped(sender, new ItemEventArgs(item));
        }
예제 #49
0
 private void myRepoListBox_ItemTap(object sender, ListBoxItemTapEventArgs e)
 {
     (App.Current as App).CurrentRepoInfo = (RepoData)e.Item.AssociatedDataItem.Value;
     Dispatcher.BeginInvoke(() =>
     {
         NavigationService.Navigate(new Uri("/InfoPages/RepoInfoPage.xaml", UriKind.Relative));
     });
 }
 private void SearchTermList_ItemTap(object sender, ListBoxItemTapEventArgs e)
 {
     SearchTerm searchTerm = ((sender as RadDataBoundListBox).SelectedItem as SearchTerm);
     if (searchTerm != null)
     {
         //MessageBox.Show(searchTerm.search_text);
         NavigationService.Navigate(new Uri("/Views/SearchDetailPage.xaml?SearchText=" + searchTerm.search_text, UriKind.Relative));
     }
 }
 private void lbLocos_ItemTap(object sender, ListBoxItemTapEventArgs e)
 {
     Locomotive item = e.Item.AssociatedDataItem.Value as Locomotive;
     
     if (ItemTapped != null)
         ItemTapped(sender, new ItemEventArgs(item));
 }
        private void ChapterList_ItemTap(object sender, ListBoxItemTapEventArgs e)
        {
            Chapter chapter = ((sender as RadDataBoundListBox).SelectedItem as Chapter);
            if (chapter != null)
            {
                //MessageBox.Show(chapter.chapter_id+"-"+chapter.name);
                NavigationService.Navigate(new Uri("/Views/Verses.xaml?chapterId=" + chapter.chapter_id.ToString() + "&chapterName=" + chapter.tr_name.ToString() + "&type=" + chapter.type + "&enName=" + chapter.en_name, UriKind.Relative));

                /*
                string audioUrl = "http://web.quran360.com/audio/ch_saad_al_ghaamidi/00" + chapter.chapter_id + ".mp3";

                //MessageBox.Show(audioUrl);

                AudioTrack audio = new AudioTrack(new Uri(audioUrl, UriKind.Absolute),
                        chapter.chapter_id + ". " + chapter.tr_name,
                        chapter.en_name,
                        chapter.en_name,
                        null);

                BackgroundAudioPlayer player = BackgroundAudioPlayer.Instance;
                player.Track = audio;
                player.Play();

                if (PlayState.Playing == BackgroundAudioPlayer.Instance.PlayerState)
                {
                    player.Pause();
                }
                else
                {
                    player.Play();
                }
                */
            }
        }
 private void List_ItemTap(object sender, ListBoxItemTapEventArgs e)
 {
     var product = List.SelectedItem as ProductViewModel;
     if (product != null)
     {
         ViewModel.Choose(product);
     }
     Dispatcher.BeginInvoke(() =>
     {
         List.SelectedItem = null;
     });
 }
 private void IndexItemsList_ItemTap(object sender, ListBoxItemTapEventArgs e)
 {
     IndexItem indexItem = ((sender as RadDataBoundListBox).SelectedItem as IndexItem);
     if (indexItem != null)
     {
         App.ViewModel.LoadChapterRec(indexItem.chapter_id);
         NavigationService.Navigate(new Uri("/Views/Verses.xaml?chapterId=" + indexItem.chapter_id + "&verseId=" + indexItem.verse_id + "&chapterName=" + App.ViewModel.ChapterRec.tr_name.ToString() + "&type=" + App.ViewModel.ChapterRec.type + "&enName=" + App.ViewModel.ChapterRec.en_name, UriKind.Relative));
     }
 }
예제 #55
0
 private void List_ItemTap(object sender, ListBoxItemTapEventArgs e)
 {
     Topic topic = ((sender as RadDataBoundListBox).SelectedItem as Topic);
     if (topic != null)
     {
         NavigationService.Navigate(new Uri("/Views/TopicItems.xaml?topicId=" + topic.id + "&topicTitle=" + topic.topic_title, UriKind.Relative));
     }
 }
예제 #56
0
        private void VersesList_ItemTap(object sender, ListBoxItemTapEventArgs e)
        {
            Verse verse = ((sender as RadDataBoundListBox).SelectedItem as Verse);
            if (verse != null)
            {
                int result = (Application.Current as App).db.SetLastRead(verse.chapter_id, verse.verse_id);

                if (result == 0)
                {
                    MessageBox.Show("Last Read upadate Failed.");
                }
                else
                {
                    //MessageBox.Show("Last Read Saved.");
                }

                NavigationService.Navigate(new Uri("/Views/VerseComparePage.xaml?SuraID=" + verse.chapter_id + "&VerseID=" + verse.verse_id, UriKind.Relative));
            }
        }
예제 #57
0
 private void List_ItemTap(object sender, ListBoxItemTapEventArgs e)
 {
     var vm = List.SelectedItem as JournalItemViewModel;
     if (vm != null)
     {
         ViewModel.Choose(vm);
     }
     Dispatcher.BeginInvoke(() =>
     {
         List.SelectedItem = null;
     });
 }
 protected override void OnHamburgerMenuItemTap(object sender, ListBoxItemTapEventArgs e)
 {
     base.OnHamburgerMenuItemTap(sender, e);
 }
예제 #59
0
 private void ItemsControl_OnItemTap(object sender, ListBoxItemTapEventArgs e)
 {
     ViewModel.NavigateToItem((CatalogItemModel)e.Item.DataContext);
 }