Closed HppZ closed 2 years ago
@codendone
@HppZ is this a Winui3 or Winui2 (or both) issue?
UWP
发件人: Stephen L Peters @.> 发送时间: Friday, September 17, 2021 8:24:03 AM 收件人: microsoft/microsoft-ui-xaml @.> 抄送: HppZ @.>; Mention @.> 主题: Re: [microsoft/microsoft-ui-xaml] RichEditBox theme bug (#5893)
@HppZhttps://github.com/HppZ is this a Winui3 or Winui2 (or both) issue?
― You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/microsoft/microsoft-ui-xaml/issues/5893#issuecomment-921353557, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AC5XNDSGBK7CWD3GN2GZMU3UCKDCHANCNFSM5EEZVRUQ. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
system xaml control
发件人: Hao Xiaoyan @.> 发送时间: Friday, September 17, 2021 9:32:31 AM 收件人: microsoft/microsoft-ui-xaml @.>; microsoft/microsoft-ui-xaml @.> 抄送: Mention @.> 主题: Re: [microsoft/microsoft-ui-xaml] RichEditBox theme bug (#5893)
UWP
发件人: Stephen L Peters @.> 发送时间: Friday, September 17, 2021 8:24:03 AM 收件人: microsoft/microsoft-ui-xaml @.> 抄送: HppZ @.>; Mention @.> 主题: Re: [microsoft/microsoft-ui-xaml] RichEditBox theme bug (#5893)
@HppZhttps://github.com/HppZ is this a Winui3 or Winui2 (or both) issue?
― You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/microsoft/microsoft-ui-xaml/issues/5893#issuecomment-921353557, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AC5XNDSGBK7CWD3GN2GZMU3UCKDCHANCNFSM5EEZVRUQ. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
Hi The issue is not with the control but the sample you have shared.
private void RichEdit_Loaded(object sender, RoutedEventArgs e)
{
var range = this.Document.GetRange(int.MaxValue, int.MaxValue);
//range.CharacterFormat.ForegroundColor = Colors.Aqua;
range.SetText(TextSetOptions.None, "@123");
}
You are changing the Foreground color on Load.
@msft-github-bot Close the issue.
why you comment out //range.CharacterFormat.ForegroundColor = Colors.Aqua;
?
This is causing the issue, on Load you are setting the foreground color to Aqua.
I need to set the Color.
I want to keep the Color no matter what the RequestedTheme is.
Set the color in xaml.
<local:RichEdit Width="100" Height="50" Margin="0,100,0,0" Foreground="Aqua" />
Set the color in xaml.
<local:RichEdit Width="100" Height="50" Margin="0,100,0,0" Foreground="Aqua" />
I want to set different Color on different TextRange in RichEditBox, so this is not enough.
Can you share an example of the result you want.
in dark theme, the Color lost.
do you think this is bug? @aqibbanday
The Foreground property of RTB is overriding the ForegroundColor of CharacterFormat
The Foreground property of RTB is overriding the ForegroundColor of CharacterFormat
how to solve it?
i think this works Foreground="{x:Null}"
The Foreground property of RTB is overriding the ForegroundColor of CharacterFormat
but why RTB has this behavior?
I have fixed this issue in my repo, i can merge the changes, if you give me the access.
I have fixed this issue in my repo, i can merge the changes, if you give me the access.
invited
The Foreground property of RTB is overriding the ForegroundColor of CharacterFormat
but why RTB has this behavior?
Foreground is linked to Theme changes and ForegroundColor property gets its color from Foreground property, that's the behaviour.
Check the comit , i have also addressed the issue with range color.
thanks.
so the point is: Foreground="{x:Null}"
, right?
Yes.
Thanks.
I don't think this is a good design, so reopen this issue.
I don't think this is a good design, so reopen this issue.
There is lots of back and forth on this issue. It sounds like it resulted in an bug in the provided sample code itself, which has since been patched. I'm not sure which part is being pointed to as not a good design. This issue also isn't following the standard issue template, so we're missing some issue on context. I'm going to re-close this issue. Please open a new issue with a proposal for the design that you think is appropriate (that describes the problem in context and fills out the issue template).
before switch theme: after: switch back to light:
the Text color lost.