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

Re: Problems with Switching Images in XAML

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 01-10-2006   #1 (permalink)
Wolf Schmidt [MSFT]
Guest


 

Re: Problems with Switching Images in XAML

Can't put a URI directly into Image.Source (at least not in code). There's an
intermediate practical ImageSource you have to use as well as a URI ctor.
Have to use something like:

CurrentImage.Source=new System.Windows.Media.Imaging.BitmapImage(new
Uri("file://c:\\msdn_masthead_ltr.gif"));

"Jason" wrote:

> Thanks...
>
> I didn't want to go the whole DataBinding route (right now..), as I'm
> learning the ropes as to what WPF can do.. But thanks! I realized my error
> as well, but I'll be taking this info with me.
>
> -J
>
>
>
> "MueMeister" <mue@gmx.de> wrote in message
> news:%23pdAhdD9FHA.3996@TK2MSFTNGP10.phx.gbl...
> > Hi Jason,
> >
> > Don't know whether I got Your problem but it sounds like the Master-Detail
> > scenario?!
> > Beatriz has an helpful article addressing this issue:
> >
> > http://www.beacosta.com/Archive/2005...a_archive.html
> >
> > Perhaps data binding could solve such scenarios in a better way than
> > providing handlers in code.
> > If you provide data binding to update dependencies between different
> > controls You have to declare the DataContext on a level which is parent of
> > the participating controls.
> > DataBinding also allows You to attach Converters which can for example
> > convert a String to an Image.Source.
> >
> > Chris
> >
> > Jason wrote:
> >> Morning...
> >> I'm having some trouble dynamically switching images in XAML, and didn't
> >> know if anyone could help.
> >>
> >> I have a listBox and an Image declared in XAML. I don't think I can use a
> >> trigger on this, since they aren't part of the same control heirarchy
> >> (Meaning, they're part of the same window, but not linked together).. I
> >> was planning on having a C# event handler to handle the listbox
> >> selectedIndexChanged() event and then switch the source. However, it will
> >> not let me put in a new path int the Image.Source property (as in,
> >> putting in a String).
> >>
> >> Does anyone have any suggestions?
> >>
> >>

>
>


My System SpecsSystem Spec
Closed Thread
Update your Vista Drivers Update Your Drivers Now!!

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems while switching users Yoni Vista General 22 07-22-2008 11:50 PM
Is it possible to include XAML files into another XAML file? star-italia .NET General 6 06-12-2008 04:56 AM
Problems switching from broadband back to LAN Misty Vista mail 0 10-20-2007 02:26 AM
Problems with mounted cd images Nate Vista General 5 06-04-2007 10:14 PM
Problems switching wireless and wired network connections SeminolePhil Vista networking & sharing 1 04-06-2007 01:56 PM


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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51