using Telerik.Windows.Core;

6 posts, 0 answers
  1. Jeff
    Jeff avatar
    3 posts
    Member since:
    Jan 2013

    Posted 20 Jan 2013 Link to this post

    First off, I am completely new to programming, so bear with me...

    I am trying to add a Looping List to my project.

    The documentation says I need to add these two usings:

    using Telerik.Windows.Core;
    using Telerik.Windows.Controls.Primitives;

    After I add these dll references, I am not able to use Telerik.Windows.Core;

    When typing in the using directive I get the options .Controls, .Data, and .Media, but not .Core;

    Primitives seems to work ok.

    Any thoughts on this?

    PS:  I am using Visual Studio Express 2012 for Windows Phone.
  2. Deyan
    Admin
    Deyan avatar
    2037 posts

    Posted 22 Jan 2013 Link to this post

    Hello Jeff,

    Thanks for writing.

    To use RadLoopingList you need both assemblies. However, you do not need to add the Core assembly namespace in XAML to define a LoopingList there. You only need the Primitives namespace.

    My advice is to take a look at our Examples application (source available) and at the LoopingList examples specifically. They will easily get you started.

    Greetings,
    Deyan
    the Telerik team
    Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
  3. DevCraft banner
  4. Jeff
    Jeff avatar
    3 posts
    Member since:
    Jan 2013

    Posted 22 Jan 2013 Link to this post

    Do I need to add any usings in the code behind?

    If I understand you correctly, I need to add the Core and Primitives references to the project, but in the code behind and XAML I only need to explicitly need to add Primitives?

    Thanks for your help.

  5. Deyan
    Admin
    Deyan avatar
    2037 posts

    Posted 23 Jan 2013 Link to this post

    Hello Jeff,

    Yes. The RadLoopingList-related logic is defined in the Primitives assembly. All types you directly need to setup the control are there so you need to add namespace references in XAML and C# to this assembly.

    As I said, please refer to our Telerik Samples project for details on how to use the control.

    All the best,
    Deyan
    the Telerik team
    Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
  6. Jeff
    Jeff avatar
    3 posts
    Member since:
    Jan 2013

    Posted 23 Jan 2013 Link to this post

    I'm sorry, but for someone that is new to programming, as I mentioned I am, the samples are terrible. Also, the documentation here: http://www.telerik.com/help/windows-phone/common-introduction.html does not match what's supplied in the samples as far as required usings and such. Please update.

    I think the WP Toolkit has a looping selector, I'll give that a shot.
  7. Deyan
    Admin
    Deyan avatar
    2037 posts

    Posted 24 Jan 2013 Link to this post

    Hello Jeff,

    Thanks for writing back.

    Being new to programming, the easiest way for you to study things and get started with our controls is to take a look at sample code.

    We have a very clear explanation with samples of how RadLoopingList is integrated into a Windows Phone application here:

    http://www.telerik.com/help/windows-phone/radinfinitelistbox-getting-started.html

    As you can see, the help states that you need to reference the following two Telerik assemblies:

    Telerik.Windows.Core.dll
    Telerik.Windows.Controls.Primitives.dll

    After referencing these two assemblies, you will need to add the following prefix in the XAML code of the page you want to have a RadLoopingList instance:

    xmlns:telerikPrimitives="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Primitives"

    In the code sample above the prefix is called telerikPrimitives and points to the Telerik.Windows.Controls namespace defined in the Telerik.Windows.Controls.Primitives assembly. Our base controls are defined in this namespace in the Telerik.Windows.Controls.Primitives.dll assembly so you need to have it in XAML in order to be able to use our controls on your page.

    After doing this, you should be able to define a RadLoopingList instance onto your page:

    <telerikPrimitives:RadLoopingList x:Name="radLoopingList" />

    By setting the x:Name attached property you can access the control instance from the code-behind file via C#.

    To fill the control with data you will need to use an instance of the LoopingListDataSource class. This class is defined in the Telerik.Windows.Controls.Primitives.dll in the Telerik.Windows.Controls namespace.

    Here you can find extensive code samples that demonstrate how the LoopingListDataSource is used:

    http://www.telerik.com/help/windows-phone/radinfinitelistbox-features-infinite-data-source.html

    Based on your questions I believe you are a bit confused what the difference between adding a DLL reference and a using is, so let me give you some explanations. Adding a DLL reference is done via the Solution Explorer in Visual Studio. All DLL references of a project are visible in the References folder. When you add a DLL reference to a project, you immediately gain access to all public types defined in this DLL. You can use these types in C# or XAML by adding usings. Since in a single DLL many namespaces may exist (namespaces are way of grouping classes in a DLL which belong to a common context), you will need to specify which namespace you want to use by creating a using. The using in C# is created the following way:

    using Telerik.Windows.Controls;

    Whereas in XAML it is defined as a prefix:

    xmlns:telerikPrimitives="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Primitives"

    So, in the case of the Telerik.Windows.Core.dll and Telerik.Windows.Controls.Primitives.dll you need both DLLs referenced in your project but since you want to use RadLoopingList and its supporting classes (like LoopingListDataSource) which are defined in the Primitives assembly, you only need to add usings to the namespaces defined in this assembly both in C# and in XAML (via the prefix shown above). The Telerik.Windows.Core.dll assembly contains logic which is used by the Telerik.Windows.Controls.Primitives.dll but not directly by you.

    These are basic Silverlight and .NET principles which you will need to use with the Microsoft's Toolkit controls as well.

    Another point I would like to make is that the Visual Studio code editor will automatically create usings for you when you try to use a type from a given assembly so you do not need to explicitly create them in C#. This, however, doe snot work this way in XAML - the prefixes there should be created by hand as described above.

    So, if this information is not helpful, you can simply open a new support ticket, attach the project you want to have a RadLoopingList instance in and I will integrate the control for you.

    As for our examples, I would kindly like to ask you for feedback if you think we can improve them so that they become more straightforward in terms of explaining how the controls are used.

    Let me know if I can be of further help.

    Greetings,
    Deyan
    the Telerik team
    Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
Back to Top
DevCraft banner