예제 #1
0
        public App(string environmentalDocumentPath)
        {
            InitializeComponent();

            Global.EnvironmentalDocumentsPath = environmentalDocumentPath;

            _videoConceptPage = new VideoConceptPage();

            MainPage = _videoConceptPage;

            CrossConnectivity.Current.ConnectivityTypeChanged += async(sender, e) =>
            {
                if (!_uploadProcessing &&
                    e.IsConnected &&
                    e.ConnectionTypes.Contains(Plugin.Connectivity.Abstractions.ConnectionType.WiFi))
                {
                    // NOTE: This could be done many ways - it's only done this way to demo the process

                    var hasVideos = (await VideoItemStore.Instance.GetVideoItems()).Count > 0;

                    if (hasVideos)
                    {
                        _uploadProcessing = true;
                        MessagingCenter.Send(this, "UploadVideoRequest");
                    }
                }
            };

            MessagingCenter.Subscribe <VideoUploadResponseMessage>(this, "UploadVideoResponse", (message) =>
            {
                Debug.WriteLine(message.Message);
                _uploadProcessing = false;
            });
        }
예제 #2
0
        public App()
        {
            InitializeComponent();

            MainPage = new VideoConceptPage();
        }