dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: Updating an element in another wpf window

  1. #1
    Join Date
    Apr 2011
    Posts
    27

    Updating an element in another wpf window

    Hello,

    If I have the following function in my class.

    Code:
            public string setTextblock1
            {
                set
                {
                    this.textblock1.Text = value;
                }
            }
    And I set it's value before calling ShowDialog for this class then I can see the new selected value.

    However if I call it after the dialog is already open the value does not update. Is there a refresh of some sort I need to do?

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,108

    Re: Updating an element in another wpf window

    You need to put some deep thought into why you need to do this.

    Also, check out the mv-vm design patterns. UI objects should not talk to other UI objects (on the form level). UI objects should only connect to view-model objects (and vm objects connect to each other).

  3. #3
    Join Date
    Apr 2011
    Posts
    27

    Re: Updating an element in another wpf window

    Well the user is selecting to restore a database. A restore Window opens and they restore their new database. The restore window then needs to close and pass the new database name to the main window's search box and refresh the list of databases.

  4. #4
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,108

    Re: Updating an element in another wpf window

    That's great. Have you researched the mv-vm pattern as I've suggested?

  5. #5
    Join Date
    Apr 2011
    Posts
    27

    Re: Updating an element in another wpf window

    Ok, looks like I have a lot of reading ahead of me.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)