开发者

How to make a special button with click event?

开发者 https://www.devze.com 2023-03-06 17:02 出处:网络
I need to make a special control, that IS from different parts. So the parts are: Image Indicator (like iPhone icon with badge)

I need to make a special control, that IS from different parts. So the parts are:

Image

Indicator (like iPhone icon with badge)

So - standart button is not enough for this case - I have to make my own one.

And? I start from grid and make myCustomControl that inherits UserControl.

All is fine, animation works, but...

How can I fire CLICK event from it? Button has this event, UserControl - has 开发者_如何学Gono.

Only mouseLeftButtonDown, but as I red - using this event - no good.

So, guys, how can I click event for my UserControl?

Or have I inherit myControl from button?

I tried it, but click_event did not show up in event tab (in Expression Blend 4)

What should I do?

Thanks.


If you want your UserControl to raise a Click event, you will have to add it yourself! You can then handle the Click event that the button raises and then raise a Click event from the UserControl.

There are other possibilities - you can host all kinds of content within a button, e.g.

<Button>
    <Image Source="image.png"/>
</Button>

Could you build your control using a Button?

0

精彩评论

暂无评论...
验证码 换一张
取 消