Is it possible to set behaviors programmatically Except in Xml

SureshGvlSureshGvl INMember

I am new to this technology,

Is it possible to set behaviors programmatically. without using xml.

thnks.

var lbl = new Label{};

lbl.behavior = .....

something like that

Tagged:

Answers

  • AndrewMobileAndrewMobile ✭✭✭✭ USMember ✭✭✭✭
    edited May 2015

    @SureshGvl
    Sure, any VisualSelement derived class (which includes Label and all other controls) have a Behaviors property which is a collection.
    You just need to call
    lbl.Behaviors.Add(new YourBehaviour());

    I hope this answers your question.

Sign In or Register to comment.