WPF/XAML Style/Template Properties Memory Usages

Francis Provencher-Leduc 40 Reputation points
2024-01-29T20:52:37.63+00:00

Hello!

I wonder if without border properties 'BorderThickness & BorderBrush' of a Control Style (ie Button) can help the overall performance when that control is used in large quantities through a list/treeview?

Thanks.

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,784 questions
XAML
XAML
A language based on Extensible Markup Language (XML) that enables developers to specify a hierarchy of objects with a set of properties and logic.
814 questions
0 comments No comments
{count} votes

Accepted answer
  1. Azar 22,870 Reputation points MVP
    2024-01-29T21:10:18.83+00:00

    Hey Francis Provencher-Leduc

    Thats a good question and thanks for posting it on QandA platform

    So omitting the 'BorderThickness' and 'BorderBrush' properties in a WPF control style, such as a Button, can have impacts on performance. removing these properties might not significantly affect memory usage, but it can influence the visual rendering of the control.

    In scenarios where the control is used extensively, like in lists or treeviews, like you mentioned simplifying the visual appearance by excluding unnecessary borders could potentially improve rendering speed

    So answering to the entire question omitting these properties might have a slight positive impact on performance, it's crucial to balance visual appearance with efficiency.

    If this helps kindly accept the answer thanks much.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.