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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T21:55:29+00:00 2026-05-12T21:55:29+00:00

I have a data navigation user control in Silverlight which opens a child window

  • 0

I have a data navigation user control in Silverlight which opens a child window where the user can enter search criteria and when they press ‘Apply’ it’s suppose to update the bound property in the ViewModel (MVVM pattern.)

The links are: SearchDialog <–> DataNavigator <–> MyView <–> MyViewModel

The dependency property in SearchDialog seems to work, when I set its value, it shows up in DataNavigator; however when the dependency property changes, no notification seems to be sent from DataNavigator to MyView/MyViewModel.

SearchDialog derives from ChildWindow:

public string Search
{
 get { return (string)GetValue(SearchProperty); }
 set { SetValue(SearchProperty, value); }
}

public static readonly DependencyProperty SearchProperty =
 DependencyProperty.Register("Search", typeof(string), typeof(SearchDialog),
 new PropertyMetadata(null));

DataNavigator derives from UserControl:

public Binding Search { get; set; }

private void DataNavigator_Loaded(object sender, Windows.RoutedEventArgs e)
{
 if (Search != null)
  this._searchDialog.SetBinding(SearchDialog.SearchProperty, Search);
}

MyView derives from SilverlightFX.UserInterface.Navigation.Page:

<DataNavigator MovePreviousAction="$model.MovePrevious()"
               CurrentIndex="{Binding CurrentIndex, Mode=TwoWay}"
               MoveNextAction="$model.MoveNext()"
               SaveAction="$model.SaveChanges()"
               IsLoading="{Binding IsLoading, Converter={StaticResource VisibilityConverter}}"
               Search="{Binding SearchString, Mode=TwoWay}"/>

MyViewModel derives from ViewModel:

public string SearchString
    {
     get { return this._search; }

  set
  {
   if(value != this._search)
   {
    this._search = value;
    this.RaisePropertyChanged("SearchString");
   }
  }
 }

I’ve been trying for hours to find the problem but haven’t had any success; anyone see the issue? 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-12T21:55:30+00:00Added an answer on May 12, 2026 at 9:55 pm

    Bryant’s solution looks like the right way to go but I still had some problems. I did end up getting this to work using the following approach:

    I added an event to SearchDialog that would fire whenever the search pattern DP changed:

    public string Search
    {
        get { return (string)GetValue(SearchProperty); }
        set { SetValue(SearchProperty, value); }
    }
    
    public static readonly DependencyProperty SearchProperty =
        DependencyProperty.Register("Search", typeof(string), typeof(SearchDialog),
        new PropertyMetadata(null, new PropertyChangedCallback(OnSearchChanged)));
    
    private static void OnSearchChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
    {
        // call to instance method
        ((SearchDialog)d).OnSearchChanged(e);
    }
    
    protected virtual void OnSearchChanged(DependencyPropertyChangedEventArgs e)
    {
        if (SearchChanged != null)
            this.SearchChanged(this, e);
    }
    
    public event DependencyPropertyChangedEventHandler SearchChanged;
    

    After this I just added another DP in the DataNavigator:

    public string Search
    {
        get { return (string)GetValue(SearchProperty); }
        set { SetValue(SearchProperty, value); }
    }
    
    public static readonly Windows.DependencyProperty SearchProperty =
    Windows.DependencyProperty.Register("Search", typeof(string), typeof(DataNavigator),
    new Windows.PropertyMetadata(null));
    

    And then hooked up the Navigator’s DP to the SearchDialog’s DP so that changes to the Search property would be propagated through to the DataNavigator which is then bound to the V & VM.

    // Inside the Loaded Event:
    this._searchDialog.SearchChanged +=
        new System.Windows.DependencyPropertyChangedEventHandler(Search_Changed);
    
    // Handler:
    private void Search_Changed(object sender, System.Windows.DependencyPropertyChangedEventArgs e)
    {
        string search = this._searchDialog.GetValue(SearchDialog.SearchProperty) as string;
        this.Search = search != null ? search.ToString() : null;
    }
    

    The rest of things remain the same as above and I’m getting the effect I was looking for.

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

Sidebar

Ask A Question

Stats

  • Questions 218k
  • Answers 218k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Nope, there are no issues with moving from Team System… May 12, 2026 at 11:35 pm
  • Editorial Team
    Editorial Team added an answer If you can create a struct and put a [DataContract]… May 12, 2026 at 11:35 pm
  • Editorial Team
    Editorial Team added an answer You can use MySQL's DATE() function: WHERE DATE(datetime) = '2009-10-20'… May 12, 2026 at 11:35 pm

Related Questions

I am doing small Silverlight app which will allow users to Create orders. I
I have encountered many web sites and even desktop applications that have a breadcrumb
I'm new to iPhone development, and multiple views (xib or nib) are really confusing
We are beginning the process of moving from Web Forms to MVC for all

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.