Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Styling with a MediaElement
Message
From
08/09/2008 11:57:29
 
 
To
All
General information
Forum:
ASP.NET
Category:
Windows Presentation Foundation (WPF)
Title:
Styling with a MediaElement
Environment versions
Environment:
C# 3.0
OS:
Windows XP SP1
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01345785
Message ID:
01345785
Views:
66
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.....
Next
Reply
Map
View

Click here to load this message in the networking platform