locked
How to create overlay ? RRS feed

  • Question

  • Hi,

    i need to have an overlay control above all other controls. Very similar to what ChildWindow does; only difference is that I need to create company very specific dialogs (and in this case ChildWindow doesn't do good). So far I have done this:


            void createOverlayControl()
            {
    
                Border overlay = new Border();
    
                overlay.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
                overlay.VerticalAlignment = System.Windows.VerticalAlignment.Stretch;
                overlay.Background = new SolidColorBrush(Colors.Black);
                overlay.Opacity = 0.5d;
    
                //put overlay on top of all controls, no mather from which UIElement this method was invoked.
    
            }

    Thank you all very much for any kind of help.

    Cheers from Croatia. 

    Friday, December 10, 2010 3:05 AM

Answers

  • Hi,
    if you want to just "
    deactivated" controls, I used for this "Canvas":

    <Grid x:Name="LayoutRoot" >
      <!-- Any code -->
    
       <Canvas x:Name="CanvasProcess" Background="Gray" Opacity="0.3" Visibility="{Binding Path=EstateModal, Mode=OneWay, Converter={StaticResource VisibilityCvt}}" />
    </Grid>



    Friday, December 10, 2010 3:32 AM

All replies

  • Hi,
    if you want to just "
    deactivated" controls, I used for this "Canvas":

    <Grid x:Name="LayoutRoot" >
      <!-- Any code -->
    
       <Canvas x:Name="CanvasProcess" Background="Gray" Opacity="0.3" Visibility="{Binding Path=EstateModal, Mode=OneWay, Converter={StaticResource VisibilityCvt}}" />
    </Grid>



    Friday, December 10, 2010 3:32 AM
  • Try this:

    <Grid x:Name="LayoutRoot">
            <Rectangle HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Opacity="0.5" Fill="#FF8A8A8A"></Rectangle>
    </Grid>


    Friday, December 10, 2010 4:10 AM