开发者

Howto overlay a image on grid?

开发者 https://www.devze.com 2023-02-18 03:08 出处:网络
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=\"P

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

精彩评论

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