ItemTemplateSelector not working on WP8?

3 posts, 0 answers
  1. Daniel
    Daniel avatar
    2 posts
    Member since:
    Apr 2013

    Posted 30 Apr 2013 Link to this post

    Hello,

    i've tried to build a calendar-app using RadCalendar and mark certain days as suggested here: http://www.telerik.com/help/windows-phone/radcalendar-features-specialdays.html

    Problem is, that once the targeted OS is Windows Phone 8 the sample isn't working.
    Screen: http://http//image.faltermayer.net/radcalendar.png

    Saying something like: "Name SelectedDay isn't available in Namespace..."

    Here is the code in the MainPage.xaml
    public class SelectedDay : DataTemplateSelector
            {
                public DataTemplate SpecialTemplate
                {
                    get;
                    set;
                }
     
     
                public override DataTemplate SelectTemplate(object item, DependencyObject container)
                {
                    CalendarButtonContentInfo info = item as CalendarButtonContentInfo;
                    CalendarButton button = container as CalendarButton;
                    if (!button.IsFromCurrentView) return null;
                    if (info.Date == null) return null;
     
                    foreach (var itemCheck in App.ViewModel.SelectedDates)
                    {
                        if (itemCheck.Date == info.Date)
                        {
                            return SpecialTemplate;
                        }
                    }
     
                    return base.SelectTemplate(item, container);
                }
            }       


    However the same code is working as soon as WP7 is the targeted OS. Any ideas whats wrong with my code?
  2. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 02 May 2013 Link to this post

    Hi Daniel,

    The selector is working in WP8. We are not sure what could cause the problem in your case, but you can check our samples solution to see how the special days selector is implemented.

    Check the following examples:
    $Examples_WP/Calendar/WeekendDaySelector.cs
    $Examples_WP/Calendar/SpecialDays.xaml/.cs

    Please let us know if you still experience problems.


    Regards, Valentin.Stoychev
    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. Daniel
    Daniel avatar
    2 posts
    Member since:
    Apr 2013

    Posted 02 May 2013 Link to this post

    Oh, that's embarrasing. I just had to rebuild the solution and it worked.

    But thank you for your help =)
Back to Top