Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/Controls/src/Core/ContentConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ static View ConfigureView(View view, ContentPresenter presenter)
return view;
}

static Label ConvertToLabel(string textContent, ContentPresenter presenter)
static ContentLabel ConvertToLabel(string textContent, ContentPresenter presenter)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you include a related tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jsuarezruiz, Tried to add test using Application.Current.Resources, but it breaks the other test cases.

{
var label = new Label
// Use ContentLabel instead of Label to avoid interference from global styles
var label = new ContentLabel
{
Text = textContent
};
Expand Down Expand Up @@ -129,4 +130,7 @@ static bool HasTemplateAncestor(ContentPresenter presenter, Type type)
return false;
}
}

// Internal label type used by ContentPresenter to avoid interference from global Label styles.
class ContentLabel : Label { }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can include a comment here?

Internal label type used by ContentPresenter to avoid interference from global Label styles.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jsuarezruiz, I have added a comment.

}