Ejemplo n.º 1
0
        protected override async void OnPointerPressed(PointerRoutedEventArgs e)
        {
            if (ViewModel.With is TLChannel channel && channel.HasBannedRights && channel.BannedRights.IsSendMedia)
            {
                if (channel.BannedRights.IsForever())
                {
                    await TLMessageDialog.ShowAsync(Strings.Android.AttachMediaRestrictedForever, Strings.Android.AppName, Strings.Android.OK);
                }
                else
                {
                    await TLMessageDialog.ShowAsync(string.Format(Strings.Android.AttachMediaRestricted, BindConvert.Current.BannedUntil(channel.BannedRights.UntilDate)), Strings.Android.AppName, Strings.Android.OK);
                }

                return;
            }

            //Start();
            _timer.Stop();
            _timer.Start();

            _pressed = true;
            CapturePointer(e.Pointer);

            base.OnPointerPressed(e);
        }
Ejemplo n.º 2
0
        public static Task <ContentDialogResult> ShowAsync(FormattedText message, string title = null, string primary = null, string secondary = null)
        {
            var dialog = new TLMessageDialog();

            dialog.Title               = title;
            dialog.FormattedMessage    = message;
            dialog.PrimaryButtonText   = primary ?? string.Empty;
            dialog.SecondaryButtonText = secondary ?? string.Empty;

            return(dialog.ShowQueuedAsync());
        }
Ejemplo n.º 3
0
        public static IAsyncOperation <ContentDialogResult> ShowAsync(string message, string title = null, string primary = null, string secondary = null)
        {
            var dialog = new TLMessageDialog();

            dialog.Title               = title;
            dialog.Message             = message;
            dialog.PrimaryButtonText   = primary ?? string.Empty;
            dialog.SecondaryButtonText = secondary ?? string.Empty;

            return(dialog.ShowAsync());
        }
Ejemplo n.º 4
0
        private void OnMediaFailed(MediaPlaybackSession sender, MediaPlayerFailedEventArgs args)
        {
            if (args.Error != MediaPlayerError.SourceNotSupported)
            {
                return;
            }

            this.BeginOnUIThread(async() =>
            {
                var confirm = await TLMessageDialog.ShowAsync("In order to play voice messages you must install Web Media Extensions from the Microsoft Store.", Strings.Resources.AppName, Strings.Resources.OK, Strings.Resources.Cancel);
                if (confirm != ContentDialogResult.Primary)
                {
                    return;
                }

                await Launcher.LaunchUriAsync(new Uri("ms-windows-store://pdp/?PFN=Microsoft.WebMediaExtensions_8wekyb3d8bbwe"));
            });
        }
Ejemplo n.º 5
0
        protected override async void OnPointerPressed(PointerRoutedEventArgs e)
        {
            var channel = ViewModel.With as TLChannel;

            if (channel != null && channel.HasBannedRights && channel.BannedRights.IsSendMedia)
            {
                await TLMessageDialog.ShowAsync("The admins of this group restricted you from posting media content here.", "Warning", "OK");

                return;
            }

            //Start();
            _timer.Stop();
            _timer.Start();

            _pressed = true;
            CapturePointer(e.Pointer);

            base.OnPointerPressed(e);
        }