Is there a way to trigger a function from a button template? I would like to trigger the function 'UnFocusAll()' every time the user hovers over a button that uses this control template.
I tried <Setter Property="MouseEnter" Value="UnFocusAll()" /> but that didn't work.
You can't currently trigger code from a template like this (at least I don't know how). You'd have to either subclass to button or add a behavior to it. I just
wrote a blog post on this subject here.
-- bryant
Blog | Twitter _________________
Dont forget to click "Mark as Answer" on the post that helped you.
cdubone
Member
204 Points
260 Posts
trigger function from button template
Sep 30, 2009 10:43 PM | LINK
Is there a way to trigger a function from a button template? I would like to trigger the function 'UnFocusAll()' every time the user hovers over a button that uses this control template.
I tried <Setter Property="MouseEnter" Value="UnFocusAll()" /> but that didn't work.
Is this possible? If so how?
bryant
Star
10113 Points
1662 Posts
Re: trigger function from button template
Sep 30, 2009 11:01 PM | LINK
You can't currently trigger code from a template like this (at least I don't know how). You'd have to either subclass to button or add a behavior to it. I just wrote a blog post on this subject here.
Blog | Twitter
_________________
Dont forget to click "Mark as Answer" on the post that helped you.