开发者

Howto overlay a image on grid?

I want to overlay a image on grid. the code like this:

<Grid>
<UniformGrid>
    <control:ImageButton Width="150" Height="150" Image="/MyStyle;component/Resources/Button1.png" Tag="Playlists" Click="Button_Click" />
    <control:ImageButton Width="150" Height="150" Image="/MyStyle;component/Resources/Button2.png" Tag="Now Playing" Click="Button_Click" />
    <control:ImageButton Width="150" Height="150" Image="/MyStyle;component/Resources/Button3.png" Tag="Artists" Click="Button_Click" />
    <control:ImageButton Width="150" Height="150" Image="/MyStyle;component/Resources/Button4.png" Tag="Genius Mixes" Click="Button_Click" />
</UniformGrid>
<Border>
    <Border.Background>
        <ImageBrush ImageSource="/MyStyle;component/Resources/reflect.png" />
    </Border.Background>
</Border>

the question is, the button cannot get any messages, how can solve this problem?

any idea? than开发者_C百科ks.


You need to set IsHitTestVisible to false on your overlay element:

<Border IsHitTestVisible="False">
    <Border.Background>
        <ImageBrush ImageSource="/MyStyle;component/Resources/reflect.png" />
    </Border.Background>
</Border>
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜