I posted this to the forum yesterday but it said something about a moderator and it hasn't shown up.
I'm trying to get code that I start off with in 2005 and the August and September previews of Expression Blend 2, and progressed on to 2008 and the December Preview, to work in 2005 and Expression Blend 1. I'm doing so that other programmers still using those can work with it.
In the transition, XamCarouselListBox has stopped working at run time. It shows the two embedded image controls and their bitmaps just fine at design time, but when I run the program they don't show up at all. Even the navigator control doesn't recognize the existance of the image controls. Nothing shows up even though two image controls have always shown up using this code since I first wrote it. The xaml and code is identical to that with which I first started it working back in October and November.
Below is the MainWindow.xaml.cs****using System;using System.IO;using System.Net;using System.Windows;using System.Windows.Controls;using System.Windows.Data;using System.Windows.Media;using System.Windows.Media.Animation;using System.Windows.Navigation;
namespace OurNameSpace{ public partial class Window1 { public Window1() { this.InitializeComponent();
// Insert code required on object creation below this point.
// Navigate to Start Page frame.Navigate(new GuestPage()); } }}
*****Below is Page0.xaml*****<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" xmlns:igWindows="http://infragistics.com/Windows" x:Class="OurNameSpace.Page0" x:Name="StartPage" WindowTitle="Page" FlowDirection="LeftToRight" Width="Auto" Height="Auto" WindowWidth="640" WindowHeight="480">
<Grid x:Name="LayoutRoot"> <igWindows:XamCarouselListBox Margin="0,0,0,0" x:Name="xamCLBStart" SelectionChanged="xamCLBStart_SelectionChanged" d:LayoutOverrides="Width, Height"> <igWindows:XamCarouselListBox.ViewSettings> <igWindows:CarouselViewSettings IsListContinuous="True" ItemPathPadding="0,0,0,0" ItemSize="170,170" ItemsPerPage="6" IsNavigatorVisible="False" AutoScaleItemContentsToFit="True"/> </igWindows:XamCarouselListBox.ViewSettings> <Image x:Name="imgEvents" Source="Event.bmp"/> <Image x:Name="imgGuestMessages" Source="GuestMessages.bmp"/> </igWindows:XamCarouselListBox> </Grid></Page>*****
Below is Page0.xaml.cs******using System;using System.IO;using System.Net;using System.Windows;using System.Windows.Controls;using System.Windows.Data;using System.Windows.Media;using System.Windows.Media.Animation;using System.Windows.Navigation;
namespace OurNameSpace
{ public partial class Page0 { public Page0() { this.InitializeComponent();
// Insert code required on object creation below this point. this.xamCLBStart.SelectionChanged += new SelectionChangedEventHandler(xamCLBStart_SelectionChanged); }
private void xamCLBStart_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (e.AddedItems.Contains(imgEvents)) { EventsPage page = new EventsPage(); NavigationService.Navigate(page); } else if (e.AddedItems.Contains(imgGuestMessages)) { GuestPage page = new GuestPage(); NavigationService.Navigate(page); } } }}******
Thanks for replying even though it is in the wrong subforum. I just stripped out those tags and the Layout override using it and it didn't change anything. The items are still invisible at runtime. I'm fuzzy on how something that looks like it always has in Blend at design time would be affected by Blend in such away as to change behavior at run time.
Joe Modica "]Have you been using the same version of the controls throughout this process?
Yes. I downloaded the beta but I only installed the help in order to check out what was on the way. This has always been the same version of NetAdvantage for WPF.
I've even rebuilt the Page0 page from scratch using Expression Blend 1 and done the same with the code-behind files using 2005. In doing both I looked at the previous Xaml and Cs as reference. I've even took out the Infragistics3 references in the project and put them back in.
It is the littlest things that trip one, or at least me up, because they are the easiest to overlook. It was the Build Action of the bitmap files. They were Resource in the previous versions and Content in this one. I'm guessing Content worked at design time because the files are in the same directory as all the other source code, but were not being copied to the bin directory, where the program was looking for it at run time.
I didn't use Snoop (or the Mole II I have as the visualizer) because as soon as I saw that the image files as part of the page had null Sources I started looking in the right direction. I should have looked at that first but I've never been tripped up by the Resource/Content difference before. My apologies for your time.
Joe Modica "]One thought -I know you have said that the XAML is the same but...
As far as I can tell they are the same and the design time behavior is the same. If you have any suggestions on how to methodically make sure I've got the same, I'd sincerely follow them.
Joe Modica "]I've noticed that the XAML parser in VS2005 expects Image.Source strings to have a leading '/' (forward slash) while the VS2008 XAML parser does not tolerate them. I notice the XAML you provided does not have a leading slash in front of the string in the Source attribute of your 2 Image elements- is it possible you had them in there originally and then removed them when you went to VS2008?
Putting in the "/" didn't effect anything. I'm at my wits end why something that does the same little carousel dance with the fully visible images when loading the xaml at design time in BOTH 2005 and Blend can't show the same at runtime.
I forgot to mention here (but I did to Support), that I managed to actually click on one of the invisible items by clicking all over the area they were supposed to be in. When I navigate back to Page0, there is an empty image with reflection that does not respond to clicks. Clicking on more empty space activates the other page, and likewise, navigating back shows another empty unresponsive image that can't be selected.