Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1725
Resolving UltraFormattedTextEditor appearance
posted

I'm sure that this is something simple that I'm missing. What I'm trying to do is to get the appearance data for an UltraFormattedTextEditor.
What I did was the following

Infragistics.Win.AppearanceData appearanceData = new Infragistics.Win.AppearanceData();
Infragistics.Win.AppearancePropFlags renderFlags = Infragistics.Win.AppearancePropFlags.BackColor |
Infragistics.Win.AppearancePropFlags.BackColorAlpha |
Infragistics.Win.AppearancePropFlags.ForeColor |
Infragistics.Win.AppearancePropFlags.BorderColor |
Infragistics.Win.AppearancePropFlags.BorderAlpha;
newNewsItems.ResolveAppearance(ref appearanceData, ref renderFlags);

What I get back is that only the ForeColor appearance is resolved.

If I then set these appearance properties as in

newNewsItems.Appearance.BackColorAlpha = Infragistics.Win.Alpha.Transparent;
newNewsItems.Appearance.BackColor = System.Drawing.Color.Transparent;
newNewsItems.Appearance.BorderColor = System.Drawing.Color.Transparent;
newNewsItems.Appearance.BorderAlpha = Infragistics.Win.Alpha.Transparent;

then I do get the resolved appearance for the control. What I was expecting (trying to do) was to get the appearance data for the control based on the applied style.

I've also tried the following

appearance = new Infragistics.Win.AppearanceData();
Infragistics.Win.AppStyling.UIRole uirole = role.GetRole("UltraFormattedTextEditor");
Infragistics.Win.AppearancePropFlags renderFlags = Infragistics.Win.AppearancePropFlags.AllRender;
uirole.ResolveAppearance(ref appearance, ref renderFlags, Infragistics.Win.AppStyling.RoleState.Normal);

So is there some other role or "thing" in the formatted text editor that I need to be looking at to get the right appearance data?

In the above code (using the uirole,  I also tried looking at the "FormattedTextUIElement" and the "TextSelectionUIElement" that seemed to be in the hierarchy for the editor.

Thanks
Neil