Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy is my window transparent when using AllowsTransparency="True"
    primarykey
    data
    text
    <p>I'm attempting to make a translusent popup that covers the entire screen using WPF. The idea is to effectively create the light box style effect that we all see regularly when using assorted webpages. The application runs full screen (no option to close, minimise, etc) and replaces the windows shell. Because of this the window needs to stretch to cover the entire of the screen. The desired effect is to have a new window pop up covering the full screen. This window will have a translucent background with some central content that will be completely opaque. Interaction with the central content will be the only way for the user to interact with the application.</p> <p>The problem that I am facing is the when AllowsTransparency is set to False the Window is not transparent, as you would expect. But when I set AllowsTransparency="True" then the window and all its contents (including the central content) is completely transparent. The new window, while invisible is there and is stopping any interaction with they system.</p> <p>Has any one else encountered this problem, of windows not being visible at all when AllowsTransparence="true" is set, or even better found a solution or work around for it? </p> <p>The xaml for the window is:</p> <pre><code>&lt;Window x:Class="Views.BorderedPopupView" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" mc:Ignorable="d" Background="{DynamicResource WindowBackground}" AllowsTransparency="True"&gt; &lt;Window.Resources&gt; &lt;SolidColorBrush x:Key="TranslusentBrush" Opacity="0.1"/&gt; &lt;SolidColorBrush x:Key="WindowBackground" Color="Transparent"/&gt; &lt;/Window.Resources&gt; &lt;Viewbox StretchDirection="Both" Stretch="Fill" Margin="5,0,13,-8" &gt; &lt;Grid Height="768" Width="1024" Background="{StaticResource TranslusentBrush}"&gt; &lt;Grid.ColumnDefinitions&gt; &lt;ColumnDefinition Width="2*"&gt;&lt;/ColumnDefinition&gt; &lt;ColumnDefinition Width="6*"&gt;&lt;/ColumnDefinition&gt; &lt;ColumnDefinition Width="2*"&gt;&lt;/ColumnDefinition&gt; &lt;/Grid.ColumnDefinitions&gt; &lt;Grid.RowDefinitions&gt; &lt;RowDefinition Height="2*"&gt;&lt;/RowDefinition&gt; &lt;RowDefinition Height="6*"&gt;&lt;/RowDefinition&gt; &lt;RowDefinition Height="2*"&gt;&lt;/RowDefinition&gt; &lt;/Grid.RowDefinitions&gt; &lt;Grid Opacity="1" Grid.Row="1" Grid.Column="1"&gt; &lt;ContentControl x:Name="Popup" Grid.Row="1" Grid.Column="1"/&gt; &lt;/Grid&gt; &lt;/Grid&gt; &lt;/Viewbox&gt; &lt;/Window&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload