darthmaule2
Topic Author
Posts: 95
Joined: 23 Oct 2014, 19:54

AllowsTransparency not supported by Window in C#

30 Nov 2020, 20:09

Hello,

It looks like the Window class doesn't support the AllowsTransparency property:
MainWindow.xaml(1): Unknown member Window.AllowsTransparency

I would like to fade out the opacity of my window when it's closing, like this:
<Window x:Class="SystemUpdate.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:SystemUpdate"
        AllowsTransparency="True"
        ResizeMode="NoResize"
        SizeToContent="WidthAndHeight"
        WindowStartupLocation="CenterScreen"
        Initialized="Window_OnInitialized"
        Loaded="Window_OnLoaded"
        Closing="Window_OnClosing"        
        Title="System Update"
        x:Name="TheMainWindow">
    <Window.Triggers>
        <EventTrigger RoutedEvent="local:MainWindow.FadeOutOnClosing">
            <EventTrigger.Actions>
                <BeginStoryboard>
                    <Storyboard x:Name="FadeOutStoryBoard" Completed="FadeOutStoryBoard_OnCompleted">
                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="TheMainWindow">
                            <EasingDoubleKeyFrame KeyTime="0:0:2" Value="0"/>
                        </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                </BeginStoryboard>
            </EventTrigger.Actions>
        </EventTrigger>
    </Window.Triggers>
    ...
    ...
    
Am I missing something here? If not, is this something that could be supported in a future release? If so I can write a ticket for it.

Tags:
 
User avatar
sfernandez
Site Admin
Posts: 2056
Joined: 22 Dec 2011, 19:20

Re: AllowsTransparency not supported by Window in C#

30 Nov 2020, 20:30

Unfortunately Window.AllowsTransparency property is not yet supported, could you please report it in our bugtracker?

Who is online

Users browsing this forum: Bing [Bot] and 0 guests