Example #1
0
 private void OnPairServiceResult(PairServiceResultMessage msg)
 {
     // TODO: Localize
     if (msg.Exception == null)
     {
         FlyoutService.ShowMessage($"{msg.Service.DisplayName} paired successfully.", "\xE73E");
     }
     else
     {
         FlyoutService.ShowMessage($"{msg.Service.DisplayName} failed to pair: {msg.Exception.Message}", "\xE783");
     }
 }
Example #2
0
        private async void ShowConnect(string url, bool isConnect)
        {
            var client = await App.Services.GetServiceAsync <ILiveCampaignClient> ();

            try {
                var cancel  = new CancellationTokenSource(5000);
                var details = await client.GetCampaignDetailsAsync(url, cancel.Token);

                string message = (isConnect)
                                        ? $"Drop to connect to {details.Name}"
                                        : $"Drop to join {details.Name}";

                string glyph = (isConnect)
                                        ? "\xE768"
                                        : "\xE71B";

                FlyoutService.ShowMessage(message, glyph);
            } catch (OperationCanceledException) {
            }
        }
Example #3
0
        private async void OnDragEnter(object sender, DragEventArgs e)
        {
            if (AttemptShowConnect(e))
            {
                return;
            }

            if (e.DataView.AvailableFormats.Contains(StandardDataFormats.StorageItems))
            {
                e.AcceptedOperation = DataPackageOperation.Copy;
                e.DragUIOverride.IsCaptionVisible = false;

                var items = await e.DataView.GetStorageItemsAsync();

                bool many = (items.Count > 1 || items.OfType <IStorageFolder> ().Any());

                // TODO: localize
                string      message = $"Drop to import {((!many) ? items[0].Name : "files")}";
                string      glyph   = (many) ? "\xE8B6" : "\xE8B5";
                IDisposable old     = Interlocked.Exchange(ref this.dragFlyout, FlyoutService.ShowMessage(message, glyph));
                old?.Dispose();
            }
        }