Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Styling with a MediaElement
Message
From
11/09/2008 19:46:12
 
 
General information
Forum:
ASP.NET
Category:
Windows Presentation Foundation (WPF)
Environment versions
Environment:
C# 3.0
OS:
Windows XP SP1
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01345785
Message ID:
01346911
Views:
17
>Hi,
>Below are three attempts at setting a WPF window background. The first two work as expected, the third just shows a black background (although the Title property is changed as expected). Anyone know why the third option fails?
>
>    <!--
>    <Window.Background>
>        <VisualBrush>
>            <VisualBrush.Visual>
>                <MediaElement Source="intro.wmv" />
>            </VisualBrush.Visual>
>        </VisualBrush>
>    </Window.Background>
>    <Window.Title>Test 1</Window.Title>
>    -->
>    
>    <!--<Window.Style>
>        <Style TargetType="{x:Type Window}" >
>            <Setter Property="Background">
>                <Setter.Value>
>                    Red
>                </Setter.Value>
>            </Setter>
>        </Style>
>    </Window.Style>
>    -->
>    
><!--
>    <Window.Style>
>        <Style TargetType="{x:Type Window}">
>            <Setter Property="Title" Value="Using Style for Video" />
>            <Setter Property="Background">
>                <Setter.Value>
>                    <VisualBrush>
>                        <VisualBrush.Visual>
>                            <MediaElement Source="intro.wmv"/>
>                        </VisualBrush.Visual>
>                    </VisualBrush>
>                </Setter.Value>
>            </Setter>
>        </Style>
>    </Window.Style>
>-->
>
>TIA,
>Viv
>P.S. Hope this shows up OK - I see nothing when looking at it in preview mode here.....

Third one looks right to me. Did you ever figure it out?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform