unable to determinder application indentify of the caller

2 posts, 0 answers
  1. Ken
    Ken avatar
    1 posts
    Member since:
    Oct 2013

    Posted 27 Oct 2013 Link to this post

    hi,

    When I put RadCalendar to a grid then I got a error "unable to determine application identity of the caller", Im sure set the ItemTemplateSelector property to "{StaticResource TheDaySelector}" causes this problem. any idea for solve this problem.

    thank you.

    Ken Nao


    <phone:PhoneApplicationPage
        x:Class="Application1.MainPage"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
        xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
        xmlns:telerikInput="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:Application1"
        mc:Ignorable="d"
        FontFamily="{StaticResource PhoneFontFamilyNormal}"
        FontSize="{StaticResource PhoneFontSizeNormal}"
        Foreground="{StaticResource PhoneForegroundBrush}"
        SupportedOrientations="Portrait" Orientation="Portrait"
        shell:SystemTray.IsVisible="True"
        Loaded="MainPage_Loaded"
        >

        <UserControl.Resources>
            <local:DaySelector x:Key="TheDaySelector">
                 <local:DaySelector.NoTemplate>
                    <DataTemplate>
                        <Grid Margin="5">
                            <Image Source="/Assets/no.png" Width="24" Height="24" VerticalAlignment="Top" HorizontalAlignment="Right" />
                            <TextBlock Text="{Binding Text}" x:Name="TextPresenter" VerticalAlignment="Bottom" HorizontalAlignment="Left"/>
                        </Grid>
                    </DataTemplate>
                </local:DaySelector.NoTemplate>
                <local:DaySelector.SpecialTemplate>
                    <DataTemplate>
                        <Grid Margin="5">
                            <Image Source="/Assets/Yes.png" Width="24" Height="24" VerticalAlignment="Top" HorizontalAlignment="Right" />
                            <TextBlock Text="{Binding Text}" x:Name="TextPresenter" VerticalAlignment="Bottom" HorizontalAlignment="Left"/>
                        </Grid>
                    </DataTemplate>
                </local:DaySelector.SpecialTemplate>
               
                <local:DaySelector.OkTemplate>
                    <DataTemplate>
                        <Grid Margin="5">
                            <Image Source="/Assets/smiley.png" Width="24" Height="24" VerticalAlignment="Top" HorizontalAlignment="Right" />
                            <TextBlock Text="{Binding Text}" x:Name="TextPresenter" VerticalAlignment="Bottom" HorizontalAlignment="Left"/>
                        </Grid>
                    </DataTemplate>
                </local:DaySelector.OkTemplate>
            </local:DaySelector>
        </UserControl.Resources>
        <!--LayoutRoot is the root grid where all page content is placed-->
        <Grid x:Name="LayoutRoot" Background="Transparent">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>

            <!--TitlePanel contains the name of the application and page title-->
            <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
                <TextBlock  
                    Text="{Binding Path=LocalizedResources.ApplicationTitle, Source={StaticResource LocalizedStrings}}"
                    Style="{StaticResource PhoneTextNormalStyle}" Margin="12,0"/>
                <TextBlock Text="{Binding Path=LocalizedResources.CalendarTitle, Source={StaticResource LocalizedStrings}}"  
                           Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
            </StackPanel>
            <!--ContentPanel - place additional content here-->
            <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
                 
                <telerikInput:RadCalendar
                    x:Name="Calendar1"
                    ItemTemplateSelector= "{StaticResource TheDaySelector}"
                    FirstDayOfWeek="Sunday" MonthInfoDisplayMode="Small" Margin="-14,0,-18,0">
                </telerikInput:RadCalendar>
            </Grid>
        </Grid>
    </phone:PhoneApplicationPage>


    StackTrace:
       at System.IO.IsolatedStorage.IsolatedStorage.InitStore(IsolatedStorageScope scope, Type appEvidenceType)
       at System.IO.IsolatedStorage.IsolatedStorageFile.GetStore(IsolatedStorageScope scope, Type applicationEvidenceType)
       at System.IO.IsolatedStorage.IsolatedStorageSettings..ctor(Boolean useSiteSettings)
       at System.IO.IsolatedStorage.IsolatedStorageSettings.get_ApplicationSettings()
       at SafePeriodCalculator.App.get_DaysSetting()
       at SafePeriodCalculator.Template.DaySelector.SelectTemplate(Object item, DependencyObject container)
       at Telerik.Windows.Controls.RadCalendar.ApplyCalendarButtonTemplate(CalendarButton button)
       at Telerik.Windows.Controls.RadCalendar.GenerateCalendarFirstRowElements(DateTime firstDayToDisplay)
       at Telerik.Windows.Controls.RadCalendar.PopulateDays()
       at Telerik.Windows.Controls.RadCalendar.OnApplyTemplate()
       at System.Windows.FrameworkElement.OnApplyTemplate(IntPtr nativeTarget)
  2. Todor
    Admin
    Todor avatar
    778 posts

    Posted 30 Oct 2013 Link to this post

    Hi Ken,

    Thank you for writing.

    Yes, it seems like the issue is caused by the ItemTemplateSelector that you have set to RadCalendar. When the control loads, it selects a template for each of its calendar cells by executing the method SelectTemplate that you have defined in your DaySelector class. You can have a look at this example of the usage of template selectors and review the logic that you have there.

    Don't hesitate to get back to us if you have other questions or you need further assistance.
     
    Regards,
    Todor
    Telerik
    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
Back to Top