예제 #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);
        }
예제 #2
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());
        }
예제 #3
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"));
            });
        }
예제 #4
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);
        }