Wpf materialdesign
No edit summary
(Automatically adding template at the end of the page.)
 
(3 intermediate revisions by 2 users not shown)
Line 6: Line 6:
</html>
</html>


'''This is now handled differently and the below text is not valid for versions after 2019-05-07'''
'''This is now handled differently and the text below is invalid for versions after 2019-05-07'''


MDriven use internally, and you can use in MDriven WPF applications, the MaterialDesign styled controls provided by http://materialdesigninxaml.net/
MDriven uses the MaterialDesign styled controls provided by http://materialdesigninxaml.net/ internally, but you can also use them in MDriven WPF applications.
* These Nuget assemblies work very well in providing a visual style based on Google's [https://material.io/ MaterialDesign concept].
We have noticed an elusive problem: growing UIs - every second placed control gets a little bit bigger in a never-ending loop. I have been unable to pinpoint the reason but it looks like if the line under the control is databound to the width of the control, they appear to influence each other in a ping-pong way that gives the effect of a never-ending loop.


These nuget assemblies works very well in providing a visual style based on Googles [https://material.io/ MaterialDesign concept]
In my hunt for a solution (that does not require a replacement of the control templates altogether), I have found that setting the MaxWidth of the control stops the behavior (once the MaxWidth is reached). But this is inconsistent with what we want - we want controls to adapt to the display grid - that is unrestricted by a MaxWidth. I also found that the MaxWidth only needs to be in effect during the main setup pass of the ViewModel-driven UI. After this initial pass, the MaxWidth can be removed.


We have noticed an illusive problem : growing UI's - every second placed controls get a little bit bigger in a never ending loop. I have not been able to pinpoint the exact reason but it looks like if the line under the control is databound to the width of the control and it is as if they influence each other in a ping-pong way that gives the effect of a never ending loop.
Given these findings, we are offering a workaround: Set the MaxWidth to the special value 3.14 (pi) - and if that value is found as MaxWidth, we will remove it and put auto instead after the initialization.
 
In my hunt for a solution (that does not require a replacement of the control templates all together) I have found that setting the MaxWidth of the control stops the behavior (once the MaxWidth is reached). But this is not consistent with what we want - we want controls to adapt to the display grid - and not be restricted by a maxwidth. I also found that the MaxWidth only need to be in effect during the main setup pass of the ViewModel driven UI - after this initial pass the maxwidth can be removed.
 
Given these findings we are offering a workaround: Set the MaxWidth to the special value 3.14 (pi) - and if that value is found as MaxWidth we will remove it and put auto instead after the initialization.
[[Category:WPF]]
[[Category:WPF]]
[[Category:Outdated]]
[[Category:Outdated]]
{{Edited|July|12|2024}}

Latest revision as of 15:50, 10 February 2024

❗🕜 Warning: this article may contain outdated information. Consider before using any descriptions/solutions, but it may still be helpful.

This is now handled differently and the text below is invalid for versions after 2019-05-07

MDriven uses the MaterialDesign styled controls provided by http://materialdesigninxaml.net/ internally, but you can also use them in MDriven WPF applications.

We have noticed an elusive problem: growing UIs - every second placed control gets a little bit bigger in a never-ending loop. I have been unable to pinpoint the reason but it looks like if the line under the control is databound to the width of the control, they appear to influence each other in a ping-pong way that gives the effect of a never-ending loop.

In my hunt for a solution (that does not require a replacement of the control templates altogether), I have found that setting the MaxWidth of the control stops the behavior (once the MaxWidth is reached). But this is inconsistent with what we want - we want controls to adapt to the display grid - that is unrestricted by a MaxWidth. I also found that the MaxWidth only needs to be in effect during the main setup pass of the ViewModel-driven UI. After this initial pass, the MaxWidth can be removed.

Given these findings, we are offering a workaround: Set the MaxWidth to the special value 3.14 (pi) - and if that value is found as MaxWidth, we will remove it and put auto instead after the initialization.

This page was edited 96 days ago on 02/10/2024. What links here