Microsoft-ui-xaml: Question: [Lights that affects multiple UIElements ]

Created on 27 Jun 2019  路  2Comments  路  Source: microsoft/microsoft-ui-xaml

Hello!
I followed the last Microsoft Build event with interest expecially the parts regarding the fluent design implementation in the soon to be WindowsUI.

I am curious on the implementation details of this light behaviour that effects multiple UIElements at once.
x.
I tried to search in the repo and I found multiple classes lights related but I didn't manage to find where the magic happens.
Can you point me in the right direction or does it happen in the composition layer?
Thank you and nice work this new design framework is awesome!

question

Most helpful comment

Sure, happy to give some details about this! You can find the code for Reveal split between the RevealBrush and the RevealBorderLight.

The short answer is that this takes advantage of the XamlLight support. The RevealBorderLight is created and attached to the Window's root and then it positions the light using a PointerPositionPropertySet.

Then the RevealBorderBrush sets itself as a target of the light using AddTargetBrush so that it gets targeted by the light.

Hope this helps!

All 2 comments

Sure, happy to give some details about this! You can find the code for Reveal split between the RevealBrush and the RevealBorderLight.

The short answer is that this takes advantage of the XamlLight support. The RevealBorderLight is created and attached to the Window's root and then it positions the light using a PointerPositionPropertySet.

Then the RevealBorderBrush sets itself as a target of the light using AddTargetBrush so that it gets targeted by the light.

Hope this helps!

Thank you for the detailed answer.

I didn't think of brushes as something "reactive" in the UI , now it makes sense!

Now all I have left to do is to persuade my team to fade out WPF and go crazy with the lights 馃毃

Was this page helpful?
0 / 5 - 0 ratings