Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for RichTextBlock #81

Open
juepiezhongren opened this issue Jun 29, 2018 · 15 comments
Open

Support for RichTextBlock #81

juepiezhongren opened this issue Jun 29, 2018 · 15 comments
Labels
difficulty/challenging 🤯 Categorizes an issue for which the difficulty level is reachable with internals understanding epic kind/enhancement New feature or request project/text 🔤 Categorizes an issue or PR as relevant to text (TextBox, PasswordBox, TextBlock, Fonts, …)

Comments

@juepiezhongren
Copy link

No description provided.

@jeromelaban jeromelaban added the kind/enhancement New feature or request label Jul 1, 2018
@jeromelaban
Copy link
Member

jeromelaban commented Nov 26, 2018

Markdown viewer from the windows community toolkit requires this.

@artemious7
Copy link
Contributor

artemious7 commented Nov 8, 2019

I need to arrange UIElements in the same way as text (being able to set TextAlignment to Left, Center, Justify and to select text). In UWP I would use RichTextBlock and InlineUIContainers for this. While it's not there in Uno, can you suggest any workaround, please?

@carldebilly
Copy link
Member

You can simply use the Inlines of a TextBlock... But the enlignment is global to the TextBlock, not specific by Inline... Is it what you want?

@davidjohnoliver
Copy link
Contributor

@artemious7 Not sure to understand your use case very well, but it sounds like you could author a custom Panel to do this.

@YBAZAN
Copy link

YBAZAN commented Aug 19, 2020

I don't know if this issue is still relevant as this because RichTextBlock is implemented, but InlineUIContainer still no.

@davidjohnoliver
Copy link
Contributor

@YBAZAN RichTextBlock isn't implemented yet, but it was incorrectly showing up as implemented because it was missing the appropriate attribute. #3873

@YBAZAN
Copy link

YBAZAN commented Aug 24, 2020

Thank you @davidjohnoliver for the clarification.

So, if I understand correctly, that means that an app using those controls (RichTextBlock, RichEditBox, and other not yet implemented ones) won't run in others platforms than UWP, right ?

If so, do you have any roadmap that could help us to visualize the remaining work ?

@davidjohnoliver
Copy link
Contributor

Strictly speaking, apps using unimplemented APIs will compile and run, but creating those controls will throw a runtime exception (though this can be downgraded to an error message). And obviously the controls won't display anything.

RichTextBlock and RichEditBox don't seem to be planned for the short-term, but if you can upvote (👍 ) the issues, that'll help us prioritize the work.

@YBAZAN
Copy link

YBAZAN commented Aug 24, 2020

I guess it's a huge work to support so many platforms. As the same time, Microsoft continues to work on its framework, so it's like an endless work...

As I look the recent PR, seems to be more bug fixes than new stuff (like implementation of controls for example). It could be a brake in the adoption of Uno for professional projects. And behavior issues may affect less than having parts of the interface not showing at all, especially if no release is planned for those missing controls.

By the way, thank very much for your hard work on this wonderful platform. I really enjoy it !!

@artemious7
Copy link
Contributor

artemious7 commented Aug 24, 2020

I guess it's a huge work to support so many platforms. As the same time, Microsoft continues to work on its framework, so it's like an endless work...

As I look the recent PR, seems to be more bug fixes than new stuff (like implementation of controls for example). It could be a brake in the adoption of Uno for professional projects. And behavior issues may affect less than having parts of the interface not showing at all, especially if no release is planned for those missing controls.

By the way, thank very much for your hard work on this wonderful platform. I really enjoy it !!

We can still do it the good old way: native controls for each platform our app supports. And if we do, we can share results with the community, even contribute to Uno Platform

@agneszitte agneszitte added project/text 🔤 Categorizes an issue or PR as relevant to text (TextBox, PasswordBox, TextBlock, Fonts, …) and removed priority/important-longterm labels Sep 21, 2020
@jeromelaban jeromelaban added the difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. label Feb 15, 2021
@sigmarsson
Copy link

Perhaps RichTextBlock isn't essential if one could implement an HTML based solution with WebView2 -on heads applicable - and your own custom control. I would be personaly leaning much further into an HTML approach.

@MartinZikmund MartinZikmund added difficulty/challenging 🤯 Categorizes an issue for which the difficulty level is reachable with internals understanding and removed difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. labels May 31, 2021
@sharpninja
Copy link

This is really important to me.

@michael-hawker
Copy link

Markdown viewer from the windows community toolkit requires this.

We have a new version folks are working on in WCT Labs, it still uses RichTextBlock. CommunityToolkit/Labs-Windows#480

Perhaps RichTextBlock isn't essential if one could implement an HTML based solution with WebView2 -on heads applicable - and your own custom control. I would be personaly leaning much further into an HTML approach.

We have had success with WASM at least of relatively easily abstracting to use a web library for something we displayed with RichTextBlock on Windows. We did this for our new Sample App in the Windows Community Toolkit where we use the MarkdownTextBlock on Windows on top of RichTextBlock, but then on WASM instead just inject the HTML from Markdig into the page:

https://github.com/CommunityToolkit/Tooling-Windows-Submodule/blob/main/CommunityToolkit.App.Shared/Renderers/Markdown/MarkdownTextBlock.cs

@MartinZikmund MartinZikmund changed the title RichTextBlock is not supported yet Support for RichTextBlock Oct 16, 2023
lukeblevins pushed a commit to lukeblevins/uno that referenced this issue Jan 17, 2024
@ShankarBUS
Copy link

@michael-hawker, I tried to circumvent the unavailability of RichTextBlock in Uno by simply using a TextBlock for rendering Inlines (ParagraphBlock will be rendered into a TextBlock) and when there is a need to render blocks such as quote, table or lists, it will just use either a TextBlock or StackPanel containing TextBlocks based on the inlines. And for InlineCode and Images, it will use a StackPanel with a Border with the code and an Image control respectively (a messy hack tbh).

TextBlock and Inlines are implemented in Uno (AFAIK?) in all supported platforms. This might be a temporary solution for this, till they implement a proper RichTextBlock.

The following code is a modified version of the MarkdownTextBlock in CommunityToolkit.Labs.WinUI:

https://github.com/symptum/Symptum/tree/main/src/Symptum.UI/Markdown

I would love to have Markdown rendering support in Uno. Hope you can consider this as a workaround.

@MartinZikmund
Copy link
Member

@ShankarBUS pretty cool solution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty/challenging 🤯 Categorizes an issue for which the difficulty level is reachable with internals understanding epic kind/enhancement New feature or request project/text 🔤 Categorizes an issue or PR as relevant to text (TextBox, PasswordBox, TextBlock, Fonts, …)
Projects
None yet
Development

No branches or pull requests

13 participants