Esempio n. 1
0
        public ContentsGridPage()
        {
            InitializeComponent();
            InitVisualStates();

            CommandBarManager.SetEvent(AppBarItem.Ok, (s, args) => CommandBarOkSelected())
            .SetEvent(AppBarItem.DeleteMultiple, (s, args) => CommandBarDeleteMultipleSelected())
            .SetEvent(AppBarItem.DownloadMultiple, (s, args) => CommandBarDownloadMultipleSelected())
            .SetEvent(AppBarItem.RotateRight, (s, args) => CommandBarRotateRightSelected())
            .SetEvent(AppBarItem.RotateLeft, (s, args) => CommandBarRotateLeftSelected())
            .SetEvent(AppBarItem.ShowDetailInfo, (s, args) => CommandBarShowDetailInfo())
            .SetEvent(AppBarItem.HideDetailInfo, (s, args) => CommandBarHideDetailInfo())
            .SetEvent(AppBarItem.Resume, (s, args) => CommandBarResumeMovieSelected())
            .SetEvent(AppBarItem.Pause, (s, args) => CommandBarPauseMovieSelected())
            .SetEvent(AppBarItem.Close, (s, args) => CommandBarCloseSelected())
            .SetEvent(AppBarItem.LocalStorage, (s, args) =>
            {
                var tuple = Tuple.Create <string, string>(nameof(StorageType.Local), null);
                Frame.Navigate(typeof(ContentsGridPage), tuple);
            })
            .SetEvent(AppBarItem.RemoteStorage, (s, args) => TopBarRemoteStorage(s as FrameworkElement))
            .SetAccentColor(AppBarItem.RemoteStorage)
            .SetHeartBeat(AppBarItem.RemoteStorage)
            .SetEvent(AppBarItem.CancelSelection, (s, args) =>
            {
                UpdateInnerState(ViewerState.Single);
            });

            PhotoScreen.DetailInfoDisplayStatusUpdated += () => { UpdateAppBar(); };
        }
Esempio n. 2
0
 private void InitializeCommandBar()
 {
     _CommandBarManager.SetEvent(AppBarItem.FNumberSlider, (s, args) => { ToggleVisibility(FnumberSlider); });
     _CommandBarManager.SetEvent(AppBarItem.ShutterSpeedSlider, (s, args) => { ToggleVisibility(SSSlider); });
     _CommandBarManager.SetEvent(AppBarItem.IsoSlider, (s, args) => { ToggleVisibility(ISOSlider); });
     _CommandBarManager.SetEvent(AppBarItem.EvSlider, (s, args) => { ToggleVisibility(EvSlider); });
     _CommandBarManager.SetEvent(AppBarItem.ProgramShiftSlider, (s, args) => { ToggleVisibility(ProgramShiftSlider); });
     _CommandBarManager.SetEvent(AppBarItem.Zoom, (s, args) => { ToggleVisibility(ZoomElements); });
     _CommandBarManager.SetEvent(AppBarItem.CancelTouchAF, (s, args) => { target?.Api?.Camera?.CancelTouchAFAsync().IgnoreExceptions(); });
 }
Esempio n. 3
0
        public AboutPage()
        {
            this.InitializeComponent();

            this.navigationHelper            = new NavigationHelper(this);
            this.navigationHelper.LoadState += this.NavigationHelper_LoadState;
            this.navigationHelper.SaveState += this.NavigationHelper_SaveState;

            CommandBarManager.SetEvent(AppBarItem.WifiSetting, async(s, args) =>
            {
                await Launcher.LaunchUriAsync(new Uri("ms-settings-wifi:"));
            });
        }
Esempio n. 4
0
        public ContentsGridPage()
        {
            this.InitializeComponent();
            InitVisualStates();

            CommandBarManager.SetEvent(AppBarItem.Ok, async(s, args) =>
            {
                DebugUtil.Log(() => "Ok clicked");
                switch (InnerState)
                {
                case ViewerState.Multi:
                    switch (Operator.ContentsCollection.SelectivityFactor)
                    {
                    case SelectivityFactor.Delete:
                        await DeleteSelectedFiles();
                        break;

                    case SelectivityFactor.Download:
                        FetchSelectedImages();
                        break;

                    default:
                        DebugUtil.Log(() => "Nothing to do for current SelectivityFactor: " + Operator.ContentsCollection.SelectivityFactor);
                        break;
                    }
                    UpdateSelectionMode(SelectivityFactor.None);
                    UpdateInnerState(ViewerState.Single);
                    break;

                default:
                    DebugUtil.Log(() => "Nothing to do for current InnerState: " + InnerState);
                    break;
                }
            })
            .SetEvent(AppBarItem.DeleteMultiple, (s, args) =>
            {
                UpdateSelectionMode(SelectivityFactor.Delete);
                UpdateInnerState(ViewerState.Multi);
            })
            .SetEvent(AppBarItem.DownloadMultiple, (s, args) =>
            {
                UpdateSelectionMode(SelectivityFactor.Download);
                UpdateInnerState(ViewerState.Multi);
            })
            .SetEvent(AppBarItem.RotateRight, (s, args) =>
            {
                PhotoScreen.RotateImage(Rotation.Right);
            })
            .SetEvent(AppBarItem.RotateLeft, (s, args) =>
            {
                PhotoScreen.RotateImage(Rotation.Left);
            })
            .SetEvent(AppBarItem.ShowDetailInfo, async(s, args) =>
            {
                PhotoScreen.DetailInfoDisplayed = true;
                await Task.Delay(500);
                UpdateAppBar();
            })
            .SetEvent(AppBarItem.HideDetailInfo, async(s, args) =>
            {
                PhotoScreen.DetailInfoDisplayed = false;
                await Task.Delay(500);
                UpdateAppBar();
            })
            .SetEvent(AppBarItem.Resume, (s, args) =>
            {
                MoviePlayer.Resume();
            })
            .SetEvent(AppBarItem.Pause, (s, args) =>
            {
                MoviePlayer.Pause();
            })
            .SetEvent(AppBarItem.Close, (s, args) =>
            {
                switch (InnerState)
                {
                case ViewerState.StillPlayback:
                    ReleaseDetail();
                    break;

                case ViewerState.MoviePlayback:
                    FinishMoviePlayback();
                    break;
                }
                UpdateInnerState(ViewerState.Single);
            })
            .SetEvent(AppBarItem.LocalStorage, (s, args) =>
            {
                var tuple = Tuple.Create <string, string>(nameof(StorageType.Local), null);
                Frame.Navigate(typeof(ContentsGridPage), tuple);
            })
            .SetEvent(AppBarItem.RemoteStorage, (s, args) =>
            {
                var menuFlyout = CreateRemoteDrivesMenuFlyout();

                switch (menuFlyout.Items.Count)
                {
                case 0:
                    UpdateTopBar();
                    break;

                // case 1:
                // TODO Transit directly
                // break;
                default:
                    FlyoutBase.SetAttachedFlyout(s as FrameworkElement, menuFlyout);
                    FlyoutBase.ShowAttachedFlyout(s as FrameworkElement);
                    break;
                }
            })
            .SetAccentColor(AppBarItem.RemoteStorage)
            .SetHeartBeat(AppBarItem.RemoteStorage)
            .SetEvent(AppBarItem.CancelSelection, (s, args) =>
            {
                UpdateInnerState(ViewerState.Single);
            });

            PhotoScreen.DetailInfoDisplayStatusUpdated += () => { UpdateAppBar(); };
        }