Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > Avalon

'Default' source for an Image

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 01-11-2007   #1 (permalink)
thelemmings@gmail.com
Guest


 

'Default' source for an Image

Hi,
I'm trying to display a default image in an Image control when the
Source property is null.

Unfortunately, a DataTrigger which checks for {x:Null} in the Source
property, and sets another value to Source in the trigger does not
work, as the trigger property and can not be repeated in the trigger
setters:

<Style x:Key="defImageStyle" TargetType="{x:Type Image}">
<Style.Triggers>
<Trigger Property="Source" Value="{x:Null}">
<Setter Property="Source" Value="defaultPicture.jpg"/>
</Trigger>
</Style.Triggers>
</Style>

Is there a way to achieve this in Xaml?

Thanks,
Luc


My System SpecsSystem Spec
Old 01-11-2007   #2 (permalink)
Keith Patrick
Guest


 

Re: 'Default' source for an Image

How about overriding the Template property such that it contains a hidden
default image that's visibilty gets flipped based on the Source trigger?



My System SpecsSystem Spec
Old 01-11-2007   #3 (permalink)
Keith Patrick
Guest


 

Re: 'Default' source for an Image

How about overriding the Template property such that it contains a hidden
default image that's visibilty gets flipped based on the Source trigger?



My System SpecsSystem Spec
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
XamlWriter.Save breaking Image.Source Curtis Avalon 0 11-21-2007 10:31 AM
WPF Image source real size? JN1974 Avalon 3 04-12-2007 08:21 AM
default image editor Demus Vista General 27 03-03-2007 06:32 PM
What's source of default Desktop Background photo OscarVogel Vista General 1 07-10-2006 06:52 PM
TemplateBinding with Image Source Property HolaMan Avalon 2 04-12-2006 10:02 PM


Update your Vista Drivers Update Your Vista Drivers Now!!

Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008