![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
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.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| 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 Specs![]() |
![]() |
| 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 |