Depends on the interface before RichEditBox is displayed



  • I'm working on a simple UWP annex, reflecting the content of the rtf of the document in RichEditBox. Everything on the beam is instant, and here's Windows 10 Mobile before the sight of the content is 5-10 seconds. At that time, the other controls are not in line. As soon as RichEditBox finishes the drawing of the text, it all comes to normal. This is RichEditBox.

    private async void Page_Loaded(object sender, Windows.UI.Xaml.RoutedEventArgs e)
    {
         Rich = new RichEditBox();
         Rich.IsReadOnly = true;
         Rich.IsSpellCheckEnabled = false;
         Rich.IsTextPredictionEnabled = false;
         Rich.IsHitTestVisible = false;
         Rich.BorderThickness = BorderThickness;
    
    vile = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///Assets/" + Convert.ToString(set) + ".rtf"));
     randAccStream = await vile.OpenAsync(FileAccessMode.Read);
     Rich.Document.LoadFromStream(TextSetOptions.FormatRtf, randAccStream);
     Rich.FontFamily = new FontFamily("/Assets/AcademyOSTT.ttf#AcademyOSTT");
     await Task.Delay(5);
     MyStackPanel.Children.Add(Rich);
    

    }

    Dependence comes from the last line. As long as Rich is painted, all other elements remain unavailable.

    How do I solve this problem? I need other control elements to remain in service at the time of loading Rich. Thank you.



  • Dependence is because you're taking the UI flow to drop your RichTextBox. I'm not familiar with UWP, but I'm guessing that just updating on mobile applications doesn't take place so often with big brakes. Whatever I try in your case.

    1. Don't add RichTextBox, and put it in there first and let it live in a tree. If you need converters to rule.
    2. The textding link will be on Binding, if it's heavy, it can be melted by creating its ITextFormatter, which will slowly download the text.



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2