views:

50

answers:

2

I'd like to have 4 buttons one in each corner of a WPF/Silverlight window. But I want the stuff in the grid/window to be "behind" the buttons, as if they float on top.

   <Grid x:Name="ButtonRoot"> 
        <Button VerticalAlignment="Top" HorizontalAlignment="Left" 
          Name="bTopLeft" /> 
        <Button VerticalAlignment="Top" HorizontalAlignment="Right" 
          Name="bTopRight" /> 
        <Button VerticalAlignment="Bottom" HorizontalAlignment="Left" 
          Name="bBottomLeft" /> 
        <Button VerticalAlignment="Bottom" HorizontalAlignment="Right" 
          Name="bBottomRight" />

        <!-- Other junk here --> 
    </Grid> 

The problem is, the buttons will not be "over" things, as the things will "wrap" around the buttons. How do I achieve this effect?

Diagram of how I want it

A: 

this should solve your problem
#bTopLeft { position: absolute; top: 0; left: 0; z-index: 1200; }

TriLLi
create css for each of your button
TriLLi
This is WPF and XAML, not CSS. But thank you anyways. I was explaining how I would do it in html, but I need to do it in xaml.
Rick Ratayczak
+5  A: 

Use two grids, remember whatever is farther down the file will be on top:

<Grid>
    <Grid Background="Green"><!-- put stuff here --></Grid>
    <Grid><!-- this goes on top -->
       <Button Width="50" Height="50" HorizontalAlignment="Left" VerticalAlignment="Top" Content="Button" /><!-- top left button -->
       <!-- etc -->
    </Grid>
</Grid>
Jeff Wilcox