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

  • SEARCH
  • Home
  • 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 4607870
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T00:45:47+00:00 2026-05-22T00:45:47+00:00

I have a panorama control whose data template is as follows:- <DataTemplate x:Key=DataTemplateCategory> <Grid

  • 0

I have a panorama control whose data template is as follows:-

   <DataTemplate x:Key="DataTemplateCategory">
            <Grid >
                <localControls:PanoramaItem BookmarkedTopics="{Binding Path=BookmarkedTopics,ElementName=root}" Topics="{Binding Topics}"/>
            </Grid>
        </DataTemplate>

The root is the name of the usercontrol in which the panorama is defined. and BookmarkedTopics in Path is DependencyProperty in root (usercontrol) whose definition is as follows:-

  public static readonly DependencyProperty BookmarkedTopicsProperty = DependencyProperty.Register("BookmarkedTopics",
           typeof(ObservableCollection<Topic>), typeof(MainPage), new PropertyMetadata(new ObservableCollection<Topic>()));
        public ObservableCollection<Topic> BookmarkedTopics
        {
            get { return GetValue(BookmarkedTopicsProperty) as ObservableCollection<Topic>; }
            set
            {

                SetValue(BookmarkedTopicsProperty, value);
            }
        }

BookmarkedTopics gets set in MainPage_Loaded and it never null or empty collection (irrelevant to my question but still thought to mention it). BookmarkedTopics is Dependency property in PanoramaItem also whose definition is:-

    public static readonly DependencyProperty BookmarkedTopicsProperty = DependencyProperty.Register("BookmarkedTopics",
       typeof(ObservableCollection<Topic>), typeof(PanoramaItem), new PropertyMetadata(new ObservableCollection<Topic>()));
    public ObservableCollection<Topic> BookmarkedTopics
    {
        get { return GetValue(BookmarkedTopicsProperty) as ObservableCollection<Topic>; }
        set
        {

            SetValue(BookmarkedTopicsProperty, value);
        }
    }

Problem is when the the BookmarkedTopics get set in MainPage_Loaded why is the setter of BookmarkedTopics in PanoramaItem not fired? Any bug that you can see in the code?

Thanks in advance 🙂

  • 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-22T00:45:48+00:00Added an answer on May 22, 2026 at 12:45 am

    When a dependency property value is assigned by a binding or an animation Silverlight uses the SetValue method directly using the appropriate DependencyProperty static field. Hence the setter method of the POCO property is not called.

    If you need code to run when a dependency property is assigned you need to use code like this:-

        public ObservableCollection<Topic> BookmarkedTopics
        {
            get { return GetValue(BookmarkedTopicsProperty) as ObservableCollection<Topic>; }
            set { SetValue(BookmarkedTopicsProperty, value); }
        }
    
        public static readonly DependencyProperty BookmarkedTopicsProperty =
            DependencyProperty.Register(
                "BookmarkedTopics",
                typeof(ObservableCollection<Topic>),
                typeof(MainPage),
                new PropertyMetadata(null, OnBookmarkedTopicsPropertyChanged));
    
        private static void OnBookmarkedTopicsPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            MainPage source = d as MainPage;
            ObservableCollection<Topic> value = e.NewValue as ObservableCollection<Topic>;
    
            // Code here to handle any work when the value has changed
        }
    

    Note also the default value for this dependency property is null. Do not use an instance of a mutable type for a dependency property default because that one instance is then shared by all instances of your class.

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

Sidebar

Related Questions

I have a Panorama Control and inside it is a DataTemplate and inside the
Well basically, I have this bing map control inside my Panorama view, when I
I have a flash panorama that has hotspot links to pop-up windows that contain
I have started using the Windows Phone 7 Panorama & Pivot Controls for a
The Microsoft panorama control is a common method for performing layout and navigation in
For my Windows Phone 7 app, I have a main panorama page which opens
I have a list view, on a panoramic control. I've also created an event
I have problems adding panorama items through code. Here is test xaml that works.
Panorama control is main view in my app. It has 3 PanoramaItems . I
I'm starting to play with the windows phone 7 panorama control. I looked at

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.