FrancoisRecisio
Topic Author
Posts: 15
Joined: 06 Nov 2023, 12:07

Define behaviors in code

21 May 2026, 14:55

Hello ! :)

I would like to know if it's possible to access/modify a behavior from the code?
Specifically, I would like to be able to assign it dynamically in the code, based on certain conditions... But I haven't found any documentation on this.
<Border x:Class="xxx">
    <b:Interaction.Behaviors>
        <BackgroundEffectBehavior>
            <BlurEffect Radius="25" />
        </BackgroundEffectBehavior>
    </b:Interaction.Behaviors>
Thanks!
 
User avatar
jsantos
Site Admin
Posts: 4823
Joined: 20 Jan 2012, 17:18
Contact:

Re: Define behaviors in code

22 May 2026, 19:12

Something like this should work
NoesisApp::BehaviorCollection* behaviors = NoesisApp::Interaction::GetBehaviors(border);
behaviors->Add(Noesis::MakePtr<BackgroundEffectBehavior>());
 
FrancoisRecisio
Topic Author
Posts: 15
Joined: 06 Nov 2023, 12:07

Re: Define behaviors in code

25 May 2026, 16:27

Thank you!

Who is online

Users browsing this forum: No registered users and 2 guests