예제 #1
0
        private async void ImageDoubleTapped(object sender, DoubleTappedRoutedEventArgs e)
        {
            if (sender != null && !string.IsNullOrEmpty(ViewModel.TranslationFile))
            {
                if (!await FileUtils.HaveAyaPositionFile())
                {
                    await ViewModel.DownloadAyahPositionFile();
                }

                var cachedImage = sender as CachedImage;
                if (cachedImage == null)
                {
                    return;
                }

                var ayah = await CachedImage.GetAyahFromGesture(e.GetPosition(cachedImage.Image),
                                                                ViewModel.CurrentPageNumber,
                                                                cachedImage.ActualWidth);

                var currentPage = ViewModel.CurrentPage;
                if (currentPage != null)
                {
                    ViewModel.SelectedAyah = ayah;
                    if (await ViewModel.HasTranslationFile())
                    {
                        ViewModel.ShowTranslation = !ViewModel.ShowTranslation;
                        SettingsUtils.Set(Constants.PREF_SHOW_TRANSLATION, ViewModel.ShowTranslation);
                    }
                }
            }
        }
예제 #2
0
        private async Task ImageHoldingOrRightTapped(object sender, Func <UIElement, Point> getPosition)
        {
            if (sender != null)
            {
                if (!await FileUtils.HaveAyaPositionFile())
                {
                    await ViewModel.DownloadAyahPositionFile();
                }

                var cachedImage = sender as CachedImage;
                if (cachedImage == null)
                {
                    return;
                }

                QuranAyah ayah = await CachedImage.GetAyahFromGesture(getPosition(cachedImage.Image),
                                                                      ViewModel.CurrentPageNumber,
                                                                      radSlideView.ActualWidth);

                ShowContextMenu(ayah, null, getPosition(ThisPage));
            }
        }