public ReadingPage()
 {
     this.InitializeComponent();
     this.navigationHelper               = new NavigationHelper(this);
     this.navigationHelper.LoadState    += this.NavigationHelper_LoadState;
     this.navigationHelper.SaveState    += this.NavigationHelper_SaveState;
     this.navigationHelper.GoBackCommand = new LightNovel.Common.RelayCommand(() => this.GoBack(), () => this.CanGoBack());
     ViewModel.PropertyChanged          += ViewModel_PropertyChanged;
     RegisterForShare();
     Flyout.SetAttachedFlyout(this, ImagePreviewFlyout);
     RefreshThemeColor();
 }
 public ReadingPage()
 {
     this.InitializeComponent();
     this.navigationHelper               = new NavigationHelper(this);
     this.navigationHelper.LoadState    += this.NavigationHelper_LoadState;
     this.navigationHelper.SaveState    += this.NavigationHelper_SaveState;
     this.navigationHelper.GoBackCommand = new LightNovel.Common.RelayCommand(() => this.GoBack(), () => this.CanGoBack());
     RegisterForShare();
     ScrollSwitch = false;
     DisableAnimationScrollingFlag      = true;
     ContentRegion.SizeChanged         += ContentRegion_SizeChanged;
     ContentColumns.ColumnsChanged     += ContentColumns_LayoutUpdated;
     ContentScrollViewer.LayoutUpdated += ScrollToPage_ContentColumns_LayoutUpdated;
     ViewModel.PropertyChanged         += ViewModel_PropertyChanged;
     ViewModel.CommentsListLoaded      += ViewModel_CommentsListLoaded;
     Flyout.SetAttachedFlyout(this, ImagePreviewFlyout);
     RefreshThemeColor();
 }
Beispiel #3
0
        public ReadingPage()
        {
            //DisplayInformation.GetForCurrentView().OrientationChanged += DisplayProperties_OrientationChanged;
            this.InitializeComponent();
            this.SizeChanged                   += ReadingPage_SizeChanged;
            this.navigationHelper               = new NavigationHelper(this);
            this.navigationHelper.LoadState    += this.NavigationHelper_LoadState;
            this.navigationHelper.SaveState    += this.NavigationHelper_SaveState;
            this.navigationHelper.GoBackCommand = new RelayCommand(() => this.GoBack(), () => this.CanGoBack());
            ViewModel.PropertyChanged          += ViewModel_PropertyChanged;
            ViewModel.CommentsListLoaded       += ViewModel_CommentsListLoaded;
            RegisterForShare();
            Flyout.SetAttachedFlyout(this, ImagePreviewFlyout);
            RefreshThemeColor();
            var resourceLoader = Windows.ApplicationModel.Resources.ResourceLoader.GetForCurrentView();

            ImageLoadingTextPlaceholder = resourceLoader.GetString("ImageLoadingPlaceholderText");
            ImageTapToLoadPlaceholder   = resourceLoader.GetString("ImageTapToLoadPlaceholderText");
        }
Beispiel #4
0
        public object Execute(object sender, object parameter)
        {
            var eventArgs     = parameter as RightTappedRoutedEventArgs;
            var tappedElement = eventArgs?.OriginalSource as FrameworkElement;

            if (tappedElement != null)
            {
                var contextMenuItemsDelegate = MenuItemsDelegate;
                if (contextMenuItemsDelegate != null && tappedElement.DataContext != null)
                {
                    var itemViewModel    = tappedElement.DataContext;
                    var contextMenuItems = contextMenuItemsDelegate(itemViewModel);

                    if (contextMenuItems != null)
                    {
                        var menuFlyout = new MenuFlyout();
                        foreach (var contextMenuItem in contextMenuItems)
                        {
                            if (!contextMenuItem.Title.IsNullOrWhiteSpace() && contextMenuItem.Command != null)
                            {
                                var item = new MenuFlyoutItem {
                                    Text = contextMenuItem.Title, Command = contextMenuItem.Command, CommandParameter = itemViewModel
                                };
                                menuFlyout.Items.Add(item);
                            }
                        }

                        if (menuFlyout.Items.Count > 0)
                        {
                            menuFlyout.ShowAt(tappedElement, eventArgs.GetPosition(tappedElement));
                            Flyout.SetAttachedFlyout(tappedElement, menuFlyout);
                            Flyout.ShowAttachedFlyout(tappedElement);

                            // This ensures that nested ListView objects don't try to keep handling this right tap.
                            eventArgs.Handled = true;
                        }
                    }
                }
            }

            return(null);
        }
 public ReadingPage()
 {
     if (this.RequestedTheme != AppGlobal.Settings.BackgroundTheme)
     {
         this.RequestedTheme = AppGlobal.Settings.BackgroundTheme;
     }
     this.InitializeComponent();
     this.navigationHelper               = new NavigationHelper(this);
     this.navigationHelper.LoadState    += this.NavigationHelper_LoadState;
     this.navigationHelper.SaveState    += this.NavigationHelper_SaveState;
     this.navigationHelper.GoBackCommand = new LightNovel.Common.RelayCommand(() => this.GoBack(), () => this.CanGoBack());
     RegisterForShare();
     ScrollSwitch = false;
     DisableAnimationScrollingFlag      = true;
     ContentRegion.SizeChanged         += ContentRegion_SizeChanged;
     IndexRegion.SizeChanged           += IndexRegion_SizeChanged;
     ContentColumns.ColumnsChanged     += ContentColumns_LayoutUpdated;
     ContentScrollViewer.LayoutUpdated += ScrollToPage_ContentColumns_LayoutUpdated;
     ViewModel.PropertyChanged         += ViewModel_PropertyChanged;
     ViewModel.CommentsListLoaded      += ViewModel_CommentsListLoaded;
     Flyout.SetAttachedFlyout(this, ImagePreviewFlyout);
     RefreshThemeColor();
     Windows.UI.ApplicationSettings.SettingsPane.GetForCurrentView().CommandsRequested += App.ApplicationWiseCommands_CommandsRequested;
 }
Beispiel #6
0
 private void FilterHiddenPostsListViewItem_Tapped(object sender, TappedRoutedEventArgs e)
 {
     Flyout.SetAttachedFlyout(FilterButton, this.Resources["FilterHiddenFlyout"] as Flyout);
     Flyout.ShowAttachedFlyout(FilterButton);
 }
Beispiel #7
0
 private void MenuFlyoutSubItem_Tapped(object sender, TappedRoutedEventArgs e)
 {
     Flyout.SetAttachedFlyout(FilterButton, this.Resources["FilterRatingFlyout"] as Flyout);
     Flyout.ShowAttachedFlyout(FilterButton);
 }
Beispiel #8
0
 private void FilterButton_Click(object sender, RoutedEventArgs e)
 {
     Flyout.SetAttachedFlyout(FilterButton, this.Resources["FilterMainFlyout"] as Flyout);
     Flyout.ShowAttachedFlyout(FilterButton);
 }
Beispiel #9
0
 private void FilterReturnItem_Tapped(object sender, TappedRoutedEventArgs e)
 {
     Flyout.SetAttachedFlyout(FilterButton, this.Resources["FilterMainFlyout"] as Flyout);
     Flyout.ShowAttachedFlyout(FilterButton);
 }
Beispiel #10
0
 public void SetFlyout(Chest p)
 {
     Flyout.SetAttachedFlyout(ImageView.ImageSet(p.Item.Path), p.Fl);
 }
Beispiel #11
0
        public void SetFlyout(InventorySlot p)
        {
            Flyout f = new Flyout();

            Flyout.SetAttachedFlyout(ImageView.ImageSet(p.Path), f);
        }