Part 15: Implementing Type Converters
- Posted: Oct 26, 2012 at 9:29 AM
- 15,713 Views
- 19 Comments
Loading User Information from Channel 9
Something went wrong getting user information from Channel 9
Loading User Information from MSDN
Something went wrong getting user information from MSDN
Loading Visual Studio Achievements
Something went wrong getting the Visual Studio Achievements
Right click “Save as…”
Already have a Channel 9 account? Please sign in
Follow the Discussion
Oops, something didn't work.
What does this mean?
Following an item on Channel 9 allows you to watch for new content and comments that you are interested in. You need to be signed in to Channel 9 to use this feature.What does this mean?
Following an item on Channel 9 allows you to watch for new content and comments that you are interested in and view them all on your notifications page.sign up for email notifications?
please provide us a code which you are written in a flip view so that we can understand the given function properly.
Thanks for this great series, is there a reason that StringBuilder.ApendLine(item) wasn't used? Best wishes
@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!
Thanks for the reply Bob.
It was only a very minor point, eg at 4:50, they could replace the two lines with one.
I'm very new to programming so wasn't sure if I was missing something obvious
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).
Anyway, thanks Bob for your great work.
I downloaded the Labs (http://aka.ms/windows8campinabox) and got the code I needed, so I'm good to go.
@JohnMarsing: Ah, thanks for the explanation and I apologize for the oversight!
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.
@VanceLeeMeurer: Any updates? Despite the Intellisense / blue line, does the code still compile? I'll try to help if I can.
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.
Text="{Binding Ingredients, Converter={StaticResource ListConverter}}" and i m getting blue line here line no. 84
in item detail page line no. is 85 sorry abut that
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.
@aki: @codingquery: I'm assuming you are the same person ... according to this:
http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/d85dc60d-d8c9-4a98-a769-ce7819024196/
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.
i have much of the problem only one error is their i hope u can tell how to solve that also blue line exists over this
d:DataContext="{Binding AllGroups[0], Source={d:DesignInstance Type=data:SampleDataSource, IsDesignTimeCreatable=True}}">
d:DataContext="{Binding AllGroups[0], Source={d:DesignInstance Type=data:SampleDataSource, IsDesignTimeCreatable=True}}">
and the error shown is
Error 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
sorry i have solved much of the problem
@aki: Good to hear ... were you missing a XAML namespace declaration associated with the d: prefix?
I would like to know if i want to add images with each Ingredients what i need to do or how it can be done using type converter. Supposing that we have imagedata in our data"Recipes.txt"
Remove this comment
Remove this thread
close