Open juepiezhongren opened 6 years ago
I need to arrange UIElement
s 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 InlineUIContainer
s for this. While it's not there in Uno, can you suggest any workaround, please?
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?
@artemious7 Not sure to understand your use case very well, but it sounds like you could author a custom Panel
to do this.
I don't know if this issue is still relevant as this because RichTextBlock
is implemented, but InlineUIContainer
still no.
@YBAZAN RichTextBlock
isn't implemented yet, but it was incorrectly showing up as implemented because it was missing the appropriate attribute. https://github.com/unoplatform/uno/pull/3873
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 ?
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.
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 !!
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
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.
This is really important to me.
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. https://github.com/CommunityToolkit/Labs-Windows/pull/480
Perhaps
RichTextBlock
isn't essential if one could implement an HTML based solution withWebView2
-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:
@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.
@ShankarBUS pretty cool solution!
Markdown viewer from the windows community toolkit requires this.