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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T16:12:18+00:00 2026-05-15T16:12:18+00:00

I would like to synchronize two object headers with pointers. For example: I know

  • 0

I would like to synchronize two object headers with pointers.
For example: I know I can’t do this with the current syntax, but I would like something like:

Node node = new Node();
node.Label = "header1";

TabItem tabItem = new TabItem;
*(tabItem.Header) = &(node.Label);

So whenever I change node.Label, tabItem.Header changes as well.

  • 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-15T16:12:19+00:00Added an answer on May 15, 2026 at 4:12 pm

    Edit: added an example

    You should be able to accomplish this using databinding. If Node is a custom object, you will want to either suport INotifyPropertyChange, or implement the Label property as a dependency property. (I’m not sure what the convention is, I would guess that if Node is intrinsically a UI object, then use a dependency property, and if it’s not then implement INotifyPropertyChanged.

    Example:
    The Node object:

    
        public class Node: System.ComponentModel.INotifyPropertyChanged
        {
            public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
            public string Label
            {
                get { return this._Label; }
                set
                {
                    this._Label = value;
                    this.OnPropertyChanged(new System.ComponentModel.PropertyChangedEventArgs("Label"));
                }
            }
            private string _Label;
    
            protected virtual void OnPropertyChanged(System.ComponentModel.PropertyChangedEventArgs propertyChangedEventArgs)
            {
                System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
                if (propertyChanged != null)
                    propertyChanged(this, propertyChangedEventArgs);
            }
        }
    
    

    The code behind your form (this method sets up your databinding in code, you could also set up the databinding in the XAML):

    
        public partial class MainWindow : Window
        {
            public Node TheNode { get; set; }
            public MainWindow()
            {
                InitializeComponent();
                this.TheNode = new Node();
                this.DataContext = this;
                this.Tab1.SetBinding(System.Windows.Controls.TabItem.HeaderProperty, "TheNode.Label");
                this.TheNode.Label = "Test";
            }
        }
    
    

    The XAML for your form

    <Window x:Class="WpfApplication1.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <TabControl>
            <TabItem Name="Tab1"/>
        </TabControl>
    </Grid>
    

    When you databind, WPF will detect that your Node object implements INotifyPropertyChanged, and it will subscribe the PropertyChanged event automatically.
    (notice that in the MainWindow code, I set the binding and then I set the value of the Node.Label — the tab header detects it and updates).

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

Sidebar

Ask A Question

Stats

  • Questions 491k
  • Answers 491k
  • 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 For GlassFish, there is a dedicated page in the FAQ:… May 16, 2026 at 10:17 am
  • Editorial Team
    Editorial Team added an answer The chances are you don't want to display anything in… May 16, 2026 at 10:17 am
  • Editorial Team
    Editorial Team added an answer no. It'll work just fine. May 16, 2026 at 10:17 am

Trending Tags

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

Top Members

Related Questions

I would like to know the best method for layering posts in wordpress 3.0
I would like to know where put monkey patching code like the following in
I would like the following code to work, but have no idea as to
I know that using the synchronize keyword before a method brings synchronization to that
I would like to run some command (e.g. command ) using perl's system() .
I would like to connect to a DB2 database, specifically an iSeries version, using
I would like to slow down a loop so that it loops every 5
I would like to split a text 过公元年?因为无论你如何选择。简体字危及了对古代文学的研究输入! Using on of these three (or
I would like to install several different versions of perl in my home directory.
In my application's form, I have two RichTextBox objects. They will both always have

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.