Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8409021
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T23:47:34+00:00 2026-06-09T23:47:34+00:00

I am adding panorama items to panorama controls dynamically, they are adding successfully without

  • 0

I am adding panorama items to panorama controls dynamically, they are adding successfully without any issues

but when i try to add the listbox to panorama item its giving error. I am not able to see the exception also, application automatically closing and I am seeing emulator home screen after that.

Following is my code which I’ve written to create panorama item and list box

lstAnniversaries = new ListBox()
lstAnniversaries.Width = 420;
                        lstAnniversaries.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
                        lstAnniversaries.Foreground = new SolidColorBrush(FacebookQueries.GetColorFromHexString("#000000"));
                        lstAnniversaries.Background = new SolidColorBrush(FacebookQueries.GetColorFromHexString("#ffffff"));
                        lstAnniversaries.Tap += new EventHandler<System.Windows.Input.GestureEventArgs>(lstUpcoming_Tap);
                        lstAnniversaries.ItemTemplate = (DataTemplate)XamlReader.Load(@"<DataTemplate xmlns=""http://schemas.microsoft.com/winfx/2006/xaml/presentation"" xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml"">
<Grid  Height=""100"" Margin=""0,0,0,0"">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width=""90"" />
                <ColumnDefinition Width=""210"" />
                <ColumnDefinition Width=""*"" />
            </Grid.ColumnDefinitions>
            <Image Source=""{Binding ImageSource}"" Height=""90"" Width=""90"" Margin=""0,0,11,0"" />
            <StackPanel Grid.Column=""1"" Margin=""0,10,0,0"">
                <TextBlock Text=""{Binding NameSource}"" Style=""{StaticResource ProfileNameStyleForTextBlock}""  />
                <StackPanel Orientation=""Horizontal"" Margin=""0,-2,0,0"">
                    <TextBlock Text=""{Binding EventName}"" Foreground=""#000000"" Style=""{StaticResource EventNameStyleForTextBlock}""   />
                    <TextBlock Text=""{Binding EventDate}"" Foreground=""{Binding EventColor}"" Style=""{StaticResource EventDateStyleForTextBlock}""  />
                </StackPanel>
            </StackPanel>
            <Button VerticalAlignment=""Center"" Height=""Auto""     Name=""btnAnniversary"" Width=""75"" Margin=""5,0,0,0"" HorizontalAlignment=""Left""     Visibility=""{Binding EllipseStatus}"" Tag=""{Binding BindsDirectlyToSource=True}""     Click=""btnAnniversary_Click"" Canvas.ZIndex=""1"" Grid.Column=""2"">
                <Image  Source=""/GiftGiv;component/Assets/bubble.png"" />
            </Button>
        </Grid>
    </DataTemplate>");
                        pan_anniversaries = new PanoramaItem();
                        pan_anniversaries.HeaderTemplate =     (DataTemplate)XamlReader.Load(@"<DataTemplate     xmlns=""http://schemas.microsoft.com/winfx/2006/xaml/presentation""     xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml""><TextBlock Text=""anniversaries""    FontSize=""54"" Foreground=""Black"" Margin=""-10,0,0,0""></TextBlock></DataTemplate>");

                        Grid grd = new Grid();
                        grd.Children.Add(lstAnniversaries);

                        pan_anniversaries.Content = grd;

                        PanoramaControl.Items.Add(pan_anniversaries);

EDIT:

Output windows Text

A first chance exception of type 'System.InvalidOperationException' occurred in System.Core.dll
A first chance exception of type 'System.InvalidOperationException' occurred in System.Core.dll
Step into: Stepping over method without symbols 'System.Reflection.RuntimeMethodInfo.InternalInvoke'
Step into: Stepping over method without symbols 'System.Reflection.MethodBase.Invoke'
Step into: Stepping over method without symbols 'System.Delegate.DynamicInvokeOne'
Step into: Stepping over method without symbols     'System.MulticastDelegate.DynamicInvokeImpl'
Step into: Stepping over method without symbols 'System.Delegate.DynamicInvoke'
Step into: Stepping over method without symbols     'System.Windows.Threading.DispatcherOperation.Invoke'
Step into: Stepping over method without symbols 'System.Windows.Threading.Dispatcher.Dispatch'
Step into: Stepping over method without symbols 'System.Windows.Threading.Dispatcher.OnInvoke'
Step into: Stepping over method without symbols 'System.Windows.Hosting.CallbackCookie.Invoke'
Step into: Stepping over method without symbols 'System.Windows.Hosting.DelegateWrapper.InternalInvoke'
Step into: Stepping over method without symbols 'System.Windows.RuntimeHost.ManagedHost.InvokeDelegate'
A first chance exception of type 'System.Exception' occurred in System.Windows.dll
A first chance exception of type 'MS.Internal.WrappedException' occurred in     System.Windows.dll
A first chance exception of type 'MS.Internal.WrappedException' occurred in System.Windows.dll
A first chance exception of type 'MS.Internal.WrappedException' occurred in System.Windows.dll
A first chance exception of type 'MS.Internal.WrappedException' occurred in System.Windows.dll
A first chance exception of type 'MS.Internal.WrappedException' occurred in System.Windows.dll
A first chance exception of type 'System.Exception' occurred in System.Windows.dll
A first chance exception of type 'MS.Internal.WrappedException' occurred in System.Windows.dll
A first chance exception of type 'MS.Internal.WrappedException' occurred in System.Windows.dll
A first chance exception of type 'MS.Internal.WrappedException' occurred in System.Windows.dll
A first chance exception of type 'MS.Internal.WrappedException' occurred in System.Windows.dll
A first chance exception of type 'MS.Internal.WrappedException' occurred in System.Windows.dll
The thread '<No Name>' (0xf640c32) has exited with code 0 (0x0).
The thread '<No Name>' (0xf450ca6) has exited with code 0 (0x0).
The thread '<No Name>' (0xf050d2e) has exited with code 0 (0x0).
The thread '<No Name>' (0xf820cda) has exited with code 0 (0x0).
The thread '<No Name>' (0xecb0e52) has exited with code 0 (0x0).
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T23:47:36+00:00Added an answer on June 9, 2026 at 11:47 pm

    Instead of creating DataTemplates in code file, add DataTemplate code in resources section of Page or APP.

    Use following way will resolve the problem as @igrali mentioned in the comments

     lstAnniversaries.ItemTemplate = this.Resources["AnniversariesTemplate"] as DataTemplate;
     lstAnniversaries.Style = this.Resources["EventsListStyle"] as Style; 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For adding an item I use public void add(Object s) { list.add(s); } For
I have problems adding panorama items through code. Here is test xaml that works.
Adding a list item via the SharePoint web service model, any idea how to
Adding Exceptional Handling is a good practise, but I have a doubt, In our
Adding the row one by one in the button click.. (i tried but its
Adding strings localization files in iPhone bundle is very simple and perfectly fine but
Adding files to .hgignore will prevent them from being tracked. But we have some
Adding the items in a checkedListBox : DirectoryInfo dinfo = new DirectoryInfo(@D:\\templates); FileInfo[] Files
Adding Multiple series to the ComboChart with different graph types is straightforward, but I
Adding an image to a UINavigationItem's titleView is pretty trivial, but when I push

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.