This project is read-only.

Display links in non main tab

Feb 17, 2013 at 4:57 PM
Hi,

First of all, thank you very much for this great library - it makes things much easier and faster.
Currently I'm having a small problem with the Data.xml file: I added a 3rd item to the pivot: credits and I want to display a series of links to 3rd party components I use in my app (YLAD, icons etc).

My "code" looks something like this:
<Item Title="credits" Type="text">
  <Links>
    <Link NavigateUri="http://anarki3000.deviantart.com/" Content="Anarki3000" Label="application logo by " />
    <Link NavigateUri="http://www.syncfusion.com/downloads/metrostudio" Content="Metro Studio, Syncfusion" Label="some application icons from" />
    <Link Label="Your Last About Dialog" Content="Mister Goodcat" NavigateUri="http://ylad.codeplex.com/" />
  </Links>
</Item>
The credits item is displayed in the pivot control, but the list of links is not displayed - I see basically the XAML markup only.
Is it possible to display links in a tab other than the main one?
I went over the documentation a few times, but I didn't manage to find any solution.
Am I missing something or it's currently not possible?

Thank you in advance,
Andrei
Feb 17, 2013 at 5:54 PM
Edited Feb 17, 2013 at 5:59 PM
HI Andrei,

this is absolutely possible, there's just a small oversight in your configuration:

The "type" attribute in your "Item" tag should have a value of "xaml" (in your snippet it's set to "text").

Edit: I also just realized that you're trying to use the (YLAD) "Link" element. You have to use appropriate XAML controls for your own items instead, for example HyperlinkButtons (http://msdn.microsoft.com/en-us/library/windowsphone/design/hh202899(v=vs.105).aspx). A good way is to simply create a user control in your app that contains everything you want to display (as you have design-time support then), and then integrate it in your item, as shown in the "Local and remote Xaml" section of the YLAD documentation.

Cheers,
Peter
Feb 17, 2013 at 6:01 PM
Hi Peter,

Thank you very much for your quick reply. I tried using the XAML type before posting the question here, but using XAML instead of TEXT as type throws an exception:

XamlParseException occurred: No default namespace has been declared. [Line: 1 Position: 2]

which to be honest doesn't tell me much...

Thank you!
Feb 18, 2013 at 7:18 AM
Edited Feb 18, 2013 at 7:19 AM
Ah yes, this is a short stumbling block. Here are the steps in detail:
  1. Create what you want to display as normal user control in your project. This makes it most simple to design it.
  2. In your configuration, set up the item as follows:
<Item Title="tutorial"
      Type="xaml">
  <my:TutorialView xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                   xmlns:my="clr-namespace:MyApp.Views;assembly=MyApp"
                   HorizontalAlignment="Stretch"
                   VerticalAlignment="Top" />
</Item>
Note the "my:"-prefix, and the inline definition of what "my" is: xmlns:my="clr-namespace:MyApp.Views;assembly=MyApp"

You only have to replace the latter parts with your own application assembly name and namespaces.

I have taken this directly from the YLAD docs here.
Feb 18, 2013 at 8:00 AM
Once again, thank you for the quick reply!
The code suggestion you gave above makes sense and I'll manage with the namespace definitions :) I'll try this solution in the evening when I'll be able to work on my project.
Reading the documentation and looking at the default Data.xml file (which has a links collection in the main item) I thought that my initial attempt should do :)

Andrei