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 6088883
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:02:13+00:00 2026-05-23T12:02:13+00:00

I am following a tutorial on http://msdn.microsoft.com/en-us/wp7trainingcourse_usingbingmapslab_topic3#_Toc271039355 . Source code can be found here:

  • 0

I am following a tutorial on http://msdn.microsoft.com/en-us/wp7trainingcourse_usingbingmapslab_topic3#_Toc271039355.

Source code can be found here: http://az12722.vo.msecnd.net/wp7trainingcourse1-4/labs/usingbingmapslab1-1-0/Source.zip. Select the second project called “Ex2-HandlingPushpins”

This tutorial shows how to place pins on a Bing map by long-pressing a location on the map.
In this tutorial there is a class PushpinCatalog, containing a collection of pushpins (Items). Items is bound to a ListBox control like this:

<Popup x:Name="PushpinPopup" IsOpen="False" Canvas.Top="330" Canvas.Left="45" Opacity="0">
            <ListBox x:Name="ListBoxPushpinCatalog"
                     Width="392" Height="56"
                     Background="{StaticResource ControlBackgroundBrush}"
                     ItemsSource="{Binding Items}"
                     SelectionChanged="ListBoxPushpinCatalog_SelectionChanged">
                <ListBox.ItemsPanel>
                    <ItemsPanelTemplate>
                        <StackPanel Orientation="Horizontal" />
                    </ItemsPanelTemplate>
                </ListBox.ItemsPanel>
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <Image Width="56" Height="56" Source="{Binding Icon}" />
                    </DataTemplate>
                </ListBox.ItemTemplate>
                <ListBox.DataContext>
                    <models:PushpinCatalog />
                </ListBox.DataContext>
            </ListBox>
        </Popup>

And the Items collection is initialized in the constructor of the PushpinCatalog.
My question is, when does the constructor of the PushpinCatalog get called? I tried right-clicking it and selecting “Find all references” in visual studio, but there are none.
If I debug, the call stack shows this:

>   UsingBingMaps.dll!UsingBingMaps.Models.PushpinCatalog.PushpinCatalog() Line 44 + 0x6 bytes  C#
    mscorlib.dll!System.Reflection.RuntimeConstructorInfo.InternalInvoke(System.Reflection.RuntimeConstructorInfo rtci, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, object parameters, System.Globalization.CultureInfo culture, bool isBinderDefault, System.Reflection.Assembly caller, bool verifyAccess, ref System.Threading.StackCrawlMark stackMark) 
    mscorlib.dll!System.Reflection.RuntimeConstructorInfo.InternalInvoke(object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, object[] parameters, System.Globalization.CultureInfo culture, ref System.Threading.StackCrawlMark stackMark) + 0x114 bytes    
    mscorlib.dll!System.Reflection.ConstructorInfo.Invoke(object[] parameters) + 0xa bytes  
    System.Windows.dll!MS.Internal.TypeProxy.GetCreateObjectDelegate.AnonymousMethod__2a() + 0xb bytes  
    System.Windows.dll!MS.Internal.TypeProxy.CreateInstance(uint customTypeId) + 0x12 bytes 
    System.Windows.dll!MS.Internal.FrameworkCallbacks.CreateKnownObject(System.IntPtr nativeRootPeer, uint customTypeId, string initializationString, out System.IntPtr nativePeer, uint isCreatedByParser) + 0x7a bytes    
    [External Code] 
    System.Windows.dll!MS.Internal.XcpImports.Application_LoadComponentNative(System.IntPtr pContext, System.IntPtr pComponent, uint cUriStringLength, string uriString, uint cXamlStrLength, byte* pXamlStr, uint cAssemblyStrLength, string assemblyStr)  
    System.Windows.dll!MS.Internal.XcpImports.Application_LoadComponent(MS.Internal.IManagedPeerBase componentAsDO, string resourceLocator, System.IO.UnmanagedMemoryStream stream, uint numBytesToRead, string assemblyString) + 0x39 bytes    
    System.Windows.dll!System.Windows.Application.LoadComponent(object component, System.Uri resourceLocator) + 0x136 bytes 
    UsingBingMaps.dll!UsingBingMaps.MainPage.InitializeComponent() Line 90 + 0x11 bytes C#
    UsingBingMaps.dll!UsingBingMaps.MainPage.MainPage() Line 51 + 0x6 bytes C#
    mscorlib.dll!System.Reflection.RuntimeConstructorInfo.InternalInvoke(System.Reflection.RuntimeConstructorInfo rtci, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, object parameters, System.Globalization.CultureInfo culture, bool isBinderDefault, System.Reflection.Assembly caller, bool verifyAccess, ref System.Threading.StackCrawlMark stackMark) 
    mscorlib.dll!System.Reflection.RuntimeConstructorInfo.InternalInvoke(object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, object[] parameters, System.Globalization.CultureInfo culture, ref System.Threading.StackCrawlMark stackMark) + 0x114 bytes    
    mscorlib.dll!System.Activator.InternalCreateInstance(System.Type type, bool nonPublic, ref System.Threading.StackCrawlMark stackMark) + 0xf0 bytes  
    mscorlib.dll!System.Activator.CreateInstance(System.Type type) + 0x2 bytes  
    Microsoft.Phone.dll!System.Windows.Navigation.PageResourceContentLoader.BeginLoad_OnUIThread(System.AsyncCallback userCallback, System.Windows.Navigation.PageResourceContentLoader.PageResourceContentLoaderAsyncResult result) + 0xe6 bytes   
    Microsoft.Phone.dll!System.Windows.Navigation.PageResourceContentLoader.BeginLoad.AnonymousMethod__0(object args) + 0x11 bytes  
    mscorlib.dll!System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo rtmi, object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, object parameters, System.Globalization.CultureInfo culture, bool isBinderDefault, System.Reflection.Assembly caller, bool verifyAccess, ref System.Threading.StackCrawlMark stackMark)   
    mscorlib.dll!System.Reflection.RuntimeMethodInfo.InternalInvoke(object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, object[] parameters, System.Globalization.CultureInfo culture, ref System.Threading.StackCrawlMark stackMark) + 0x168 bytes 
    mscorlib.dll!System.Reflection.MethodBase.Invoke(object obj, object[] parameters) + 0xa bytes   
    mscorlib.dll!System.Delegate.DynamicInvokeOne(object[] args) + 0x98 bytes   
    mscorlib.dll!System.MulticastDelegate.DynamicInvokeImpl(object[] args) + 0x8 bytes  
    mscorlib.dll!System.Delegate.DynamicInvoke(object[] args) + 0x2 bytes   
    System.Windows.dll!System.Windows.Threading.DispatcherOperation.Invoke() + 0xc bytes    
    System.Windows.dll!System.Windows.Threading.Dispatcher.Dispatch(System.Windows.Threading.DispatcherPriority priority) + 0x83 bytes  
    System.Windows.dll!System.Windows.Threading.Dispatcher.OnInvoke(object context) + 0x8 bytes 
    System.Windows.dll!System.Windows.Hosting.CallbackCookie.Invoke(object[] args) + 0x19 bytes 
    System.Windows.dll!System.Windows.Hosting.DelegateWrapper.InternalInvoke(object[] args) + 0x2 bytes 
    System.Windows.RuntimeHost.dll!System.Windows.RuntimeHost.ManagedHost.InvokeDelegate(System.IntPtr pHandle, int nParamCount, System.Windows.Hosting.NativeMethods.ScriptParam[] pParams, ref System.Windows.Hosting.NativeMethods.ScriptParam pResult) + 0x5e bytes 
    [External Code] 

I suspect that through databinding of one of the properties of the class, the containing class is somehow automatically initialized, can anyone explain?

  • 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-05-23T12:02:13+00:00Added an answer on May 23, 2026 at 12:02 pm

    The PushpinCatalog class was created during XAML processing.

    <ListBox.DataContext>
        <models:PushpinCatalog /> - PushpinCatalog instance creation
     </ListBox.DataContext>
    

    After it the DataContext property of ListBox has a reference to you PushpinCatalog model instance.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm following this tutorial http://msdn.microsoft.com/en-us/library/bb458038.aspx to create a VsPackage Setup. In the part of
I am completely new to this and am following a tutorial on msdn: http://msdn.microsoft.com/en-us/library/aa645736(v=vs.71).aspx#vcwlkcominteroppart1cclienttutorialanchor2
I'm following the tutorial here http://applicake.com/posts/54-integrating-facebook-connect-with-rails-applications to set up facebook connect. It almost worked,
I am trying to do the following: http://msdn.microsoft.com/en-us/library/dd456857.aspx I created the function in the
I want to draw a String on some shapes following the examples in http://msdn.microsoft.com/en-us/library/aa327572%28v=vs.71%29.aspx
link http://msdn.microsoft.com/en-us/library/ee796239%28v=vs.91%29.aspx#Y3078 the code return this.ObjectContext.SalesOrderHeaders.OrderBy(e=>e.SalesOrderID); note have done and checked everything done till
I am following the following tutorial ( http://www.highoncoding.com/Articles/642_Creating_a_Stock_Widget_in_ASP_NET_MVC_Application.aspx ) on using ajax to render
I'm following a tutorial to set up a skeleton application for tomcat : http://maestric.com/doc/java/spring/setup#build_files
http://www.codinghorror.com/blog/2008/04/setting-up-subversion-on-windows.html I am following this as a guide to install subversion. The tutorial at
Trying the following tutorial http://www.androidsdkforum.com/android-sdk-development/3-oauth-twitter.html i am having trouble understanding callback URL my twitter

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.