예제 #1
0
        public ViewEV()
        {
            InitializeComponent();

            _mmo_appbar = new NewMultimediaAppBarUpdater(VM.Messenger, this, VM.MultimediaList);
            _add = new CommandButtonAdapter(ApplicationBar.Buttons[0] as IApplicationBarIconButton, VM.Add);
        }
예제 #2
0
        public ViewES()
        {
            InitializeComponent();

            _add = new CommandButtonAdapter(ApplicationBar.Buttons[0] as IApplicationBarIconButton, VM.AddEvent);
            _map = new CommandButtonAdapter(ApplicationBar.Buttons[1] as IApplicationBarIconButton, VM.Maps);
        }
예제 #3
0
 private void Page_Loaded(object sender, RoutedEventArgs e)
 {
     if (uploadall == null && VM != null)
     {
         uploadall = new CommandButtonAdapter(ApplicationBar.Buttons[0] as IApplicationBarIconButton, VM.StartUpload);
     }
 }
예제 #4
0
        private void PhoneApplicationPage_Loaded(object sender, RoutedEventArgs e)
        {
            if (!initialized)
            {
                initialized = true;

                saveBtn = new ApplicationBarIconButton()
                {
                    IconUri = new Uri("/Images/appbar.save.rest.png", UriKind.Relative),
                    Text = DiversityResources.Settings_Header_ButtonSave
                };
                ApplicationBar.Buttons.Add(saveBtn);
                toSave = new CommandButtonAdapter(saveBtn, VM.Save);

                refreshBtn = new ApplicationBarIconButton()
                {
                    IconUri = new Uri("/Images/appbar.refresh.rest.png", UriKind.Relative),
                    Text = DiversityResources.Settings_Header_ButtonRefresh
                };
                ApplicationBar.Buttons.Add(refreshBtn);
                toRefresh = new CommandButtonAdapter(refreshBtn, VM.RefreshVocabulary);

                clearBtn = new ApplicationBarIconButton()
                {
                    IconUri = new Uri("/Images/appbar.delete.rest.png", UriKind.Relative),
                    Text = DiversityResources.Settings_Header_ButtonClear,
                };
                ApplicationBar.Buttons.Add(clearBtn);
                toClear = new CommandButtonAdapter(clearBtn, VM.Reset);

                var manageTaxa = new ApplicationBarMenuItem()
                {
                    Text = DiversityResources.Settings_Header_ManageTaxa
                };
                manageTaxa.Click += (s, args) => ManageTaxa_Click();
                ApplicationBar.MenuItems.Add(manageTaxa);

                var uploadData = new ApplicationBarMenuItem()
                {
                    Text = DiversityResources.Settings_Header_UploadData
                };
                uploadData.Click += (s, args) => Upload_Click();
                ApplicationBar.MenuItems.Add(uploadData);

                var downloadData = new ApplicationBarMenuItem()
                {
                    Text = DiversityResources.Settings_Header_DownloadData
                };
                downloadData.Click += (s, args) => Download_Click();
                ApplicationBar.MenuItems.Add(downloadData);

                var importExport = new ApplicationBarMenuItem()
                {
                    Text = DiversityResources.Settings_Menu_ImExport
                };
                importExport.Click += (s, args) => ImportExport();
                ApplicationBar.MenuItems.Add(importExport);
            }
        }
예제 #5
0
        public NewAudio()
        {
            InitializeComponent();

            _record = new CommandButtonAdapter(ApplicationBar.Buttons[0] as IApplicationBarIconButton, VM.Record);
            _playstop = new PlayStopButton(ApplicationBar, VM);
            _savedelete = new SaveDeleteButton(ApplicationBar, VM);
        }
예제 #6
0
 private void Page_Unloaded(object sender, RoutedEventArgs e)
 {
     if (uploadall != null)
     {
         uploadall.Dispose();
         uploadall = null;
     }
 }
예제 #7
0
        public AskGPS()
        {
            InitializeComponent();

            var saveBtn = new ApplicationBarIconButton(new Uri("/Images/appbar.save.rest.png", UriKind.Relative))
                {
                    Text = DiversityResources.Settings_Header_ButtonSave
                };

            Save = new CommandButtonAdapter(saveBtn, VM.Save);

            this.ApplicationBar.Buttons.Add(saveBtn);
        }
        public TaxonManagement() {
            InitializeComponent();

            if (VM != null) {
                var button = ApplicationBar.Buttons[0] as IApplicationBarIconButton;
                ApplicationBar.Buttons.Clear();
                _downloadall = new CommandButtonAdapter(
                    appbar: ApplicationBar,
                    button: button,
                    hideMode: CommandButtonAdapter.Mode.HideButton,
                    command: VM.DownloadAll);

            }
        }
예제 #9
0
        public NewVideo() {
            InitializeComponent();

            _Svc = new VideoService(this.viewfinderRectangle, this.videoPlayer);

            _record = new CommandButtonAdapter(ApplicationBar.Buttons[0] as IApplicationBarIconButton, _Svc.Record);
            _play = new CommandButtonAdapter(ApplicationBar.Buttons[1] as IApplicationBarIconButton, _Svc.Play);
            _stop = new CommandButtonAdapter(ApplicationBar.Buttons[2] as IApplicationBarIconButton, _Svc.Stop);
            _save = new SaveDeleteButton(
                this.ApplicationBar,
                VM);


            VM.VideoService = _Svc as IVideoService;
        }
예제 #10
0
        private void PhoneApplicationPage_Loaded(object sender, RoutedEventArgs e)
        {
            while (this.NavigationService.BackStack.Any())
                this.NavigationService.RemoveBackEntry();

            if (!initialized)
            {
                initialized = true;

                var add =
                    new ApplicationBarIconButton(new Uri("/Images/appbar.add.rest.png", UriKind.RelativeOrAbsolute))
                    {
                        Text = DiversityResources.Home_Header_ButtonAdd
                    };
                ApplicationBar.Buttons.Add(add);
                _add = new CommandButtonAdapter(add, VM.Add);

                var settings =
                    new ApplicationBarIconButton(new Uri("/Images/appbar.feature.settings.rest.png", UriKind.RelativeOrAbsolute))
                    {
                        Text = DiversityResources.Home_Header_ButtonSettings
                    };
                settings.Click += Settings_Click;
                ApplicationBar.Buttons.Add(settings);

                var maps =
                    new ApplicationBarIconButton(new Uri("/Images/appbar.globe.rest.png", UriKind.RelativeOrAbsolute))
                    {
                        Text = DiversityResources.Home_Header_ButtonMaps
                    };
                maps.Click += LoadedMaps_Click;
                ApplicationBar.Buttons.Add(maps);

                var help =
                    new ApplicationBarIconButton(new Uri("/Images/appbar.questionmark.rest.png", UriKind.RelativeOrAbsolute))
                    {
                        Text = DiversityResources.Home_Header_Help
                    };
                help.Click += help_Click;
                ApplicationBar.Buttons.Add(help);
            }
        }
예제 #11
0
        public ImportExport()
        {
            InitializeComponent();
            DownloadButton = new ApplicationBarIconButton()
            {
                IconUri = new Uri("/Images/appbar.download.rest.png", UriKind.Relative),
                Text = DiversityResources.ImportExport_Button_Download
            };
            _Download = new CommandButtonAdapter(DownloadButton, VM.DownloadSnapshot);

            UploadButton = new ApplicationBarIconButton()
            {
                IconUri = new Uri("/Images/appbar.upload.rest.png", UriKind.Relative),
                Text = DiversityResources.ImportExport_Button_Upload
            };
            _Upload = new CommandButtonAdapter(UploadButton, VM.UploadSnapshot);

            TakeButton = new ApplicationBarIconButton()
            {
                IconUri = new Uri("/Images/appbar.add.rest.png", UriKind.Relative),
                Text = DiversityResources.ImportExport_Button_Take
            };
            _Take = new CommandButtonAdapter(TakeButton, VM.TakeSnapshot);

            DeleteButton = new ApplicationBarIconButton()
            {
                IconUri = new Uri("/Images/appbar.delete.rest.png", UriKind.Relative),
                Text = DiversityResources.ImportExport_Button_Delete
            };
            _Delete = new CommandButtonAdapter(DeleteButton, VM.DeleteSnapshot);

            RestoreButton = new ApplicationBarIconButton()
            {
                IconUri = new Uri("/Images/MetroIcons/white/rew.png", UriKind.Relative),
                Text = DiversityResources.ImportExport_Button_Restore
            };
            _Restore = new CommandButtonAdapter(RestoreButton, VM.RestoreSnapshot);

            RefreshButton = new ApplicationBarIconButton()
            {
                IconUri = new Uri("/Images/appbar.sync.rest.png", UriKind.Relative),
                Text = DiversityResources.ImportExport_Button_RefreshRemote
            };
            _Refresh = new CommandButtonAdapter(RefreshButton, VM.RefreshRemote);

            var isBusy =
                VM.WhenAny(x => x.IsBusy, x => x.GetValue())
                    .DistinctUntilChanged()
                    .Publish().RefCount();

            var progressPercent =
                VM.WhenAny(x => x.ProgressFraction, x => x.GetValue());

            isBusy
                .Subscribe(b => this.ApplicationBar.IsVisible = !b);

            var Notifications = App.Kernel.Get<INotificationService>();

            isBusy
                .Where(b => b)
                .Select(_ => progressPercent
                    .Select(p => new ProgressState(p, string.Empty))
                    .TakeUntil(isBusy.Where(b => !b)))
                .Subscribe(Notifications.showProgress);

            VM.WhenAny(x => x.CurrentPivot, x => x.GetValue())
                .Subscribe(UpdateAppBarForPivot);
        }