Description

In order to make our declarative controls and data binding work smoothly, we look at implicit XAML type converters, type converters added to our project template, then implement our own custom type converter and explain its purpose.

@Navprabhat Singh: Hi, not sure what you're asking for here. You'll need to be more specific / clearer as to what it is you are trying to accomplish.

@Ian: If you could point me to the exact time in the video I could offer a better answer. Off the top of my head / not looking at the video (1) I was following the instructions of the Hands On Labs and (2) why the author of the Lab chose not to use StringBuilder? Speculation, but perhaps the amount of appending didn't warrant it, or they were just keeping everything obvious and simple. You can feel free to use whatever method you prefer. Good luck!

I think what Navprabhat Singh is saying is that in your download code (http://media.ch9.ms/content/WinStoreAppDev_CS.zip) there is no Common\ListConverter.cs at all and the code in ItemDetailPage.xaml doesn't have <FlipView.Template> (see 8:11 in the video). I typed in the ListConverter.cs manually as I could see all the code on the video but not so for the ItemDetailPage.xaml file.

In your download there are folders of the application for chapters 3-5, 9 and 24. There is no CS_15 folder for the lesson in question ("Part 15: Implementing Type Converters"). I looked in the CS_24 folder hoping to find it there but ItemDetailPage.xaml has no reference to <FlipView.Template> and ListConverter.cs isn't there either.

I'm sure it's in the Lab download, I just didn't get around do downloading it (it seems large and was hoping to avoid getting it).

I'm stuck. ItemDetailPage.xaml line 85, the part you deleted to see what would happen is BLUE LINED and I can't get it to go away. I'll try a reboot and if that does not work I'll be giving you tons of detail on what I've tried so far. Thanks for the class.

I'm not sure what it was but only this far along, I deleted the solution and started over. It worked the second time. The one thing I'd say is I can't click on COPY CODE on the web page. I have to highlight the data, right click and get it. Maybe I picked up an invisible internet character somehow? I'm back on track and eager to get through this.

if (global::System.Diagnostics.Debugger.IsAttached) global::System.Diagnostics.Debugger.Break(); i m getting this error how to solve this , the app opens bt when we click on any recipe it opens app.g.i.cs and high lights this line plzz help.

if (global::System.Diagnostics.Debugger.IsAttached) global::System.Diagnostics.Debugger.Break(); i m getting this error how to solve this , the app opens bt when we click on any recipe it opens app.g.i.cs and high lights this line plzz help.

It means you've hit a bug in the code you typed in. Since you didn't land on C# code, I'm going to guess it's a problem with your XAML code. I'm guessing this is related to your other issue with the blue squiggly line under line 85 in your XAML. Since it's dealing with the Type Converter AND this is not a compilation error -- but rather a runtime error, I'm guessing you didn't implement it correctly and when you call it from XAML it breaks. Perhaps you're missing a accessibility modifier like Public? If I were you I would CLOSELY comb through my code. Worst case ... compare ( or even copy the code) from the Windows 8 Lab in a Box / Contoso Cookbook Hands on Lab and paste it into your project ... both the List Converter AND the XAML that calls it to see if it fixes the problem.

I've never hit the error you describe, so outside of helping you debug it, I don't exactly why you're getting it.

and the error shown isError 1 The name "SampleDataSource" does not exist in the namespace "using:mycookbook". C:\Users\aakriti\Documents\Visual Studio 2012\Projects\mycookbook\mycookbook\ItemDetailPage.xaml 26 13 mycookbook

Thanks Bob, all looks good except for in the simulation for 1024 X 768 resolution, where you get about 3 characters on line, you will have the need for the scroll bar on those, but it is not so readable, would be better if we could shrink the left margin or something to give the direction text more room..

Here's an odd error.. I ran the simulator code ok, ran again I got an error, ran again it code ok, ran again got the error of two runs back.. I thought I saw someone insert a photo, but don't see it..

well the code page is ItemsDetailPage.xaml.cs

line # 51 this.DefaultViewModel["Group"] = item.Group;

Error is NullReference was unhandled by user code

Weird, I did not get this error until this video, and we weren't playing with the Group in this lesson, also weird it is not every time.

More info, every time I ran the simulator I closed it, by not only hitting the red square in VS to end the session, but also opposite clicking the simulator in the taskbar and hitting close.. So it was working and not working for run, close, run, close, run, close, run, close.. Now when I leave the simulator running and just end by clicking the little red square in VS, it will work every time...

Would you please provide link or text where I can get FlipView (that lengthy code you copied and pasted). I downloaded stuff at http://aka.ms/windows8campinabox) but could not find the code. And too old to type though love to follow your teaching here and at LearnVisualStudio.net.

At around 2mins in to the video I think there's a bit of a mixup between type converters and value converters. The 2 converters in the project are value converters (IValueConverter) rather than type converters - apologies if I've got that mixed up.