I'm not quite sure what I am missing, anyway here's what I need. I have a ViewContent class that has TitleName property. ViewContent.cs
and a public event EventHandler TitleNameChanged; andCode:public string TitleName { get { return titleName; } set { titleName = value; OnTitleNameChanged(EventArgs.Empty); } }
WorkbenchWindow.cs Calling the ViewContent at another class, I have thisCode:protected virtual void OnTitleNameChanged(EventArgs e) { if (TitleNameChanged != null) { TitleNameChanged(this, e); } }
and the OnTitleNameChangedCode:this.content = content; content.Control.Dock = DockStyle.Fill; content.WorkbenchWindow = this; content.TitleNameChanged += new EventHandler(OnTitleNameChanged);
Now I have subclassed the ViewContent and call it SomeView.cs and on the blank constructor I haveCode:void OnTitleNameChanged(object sender, EventArgs e) { if (content == null) { return; } this.Text = content.TitleName; }
But the thing is that the WorkbenchWindow's OnTitleNameChanged is not fired. Would appreciate any help finding why I don't get my event thingy work.Code:public SomeView() : base("New View") { }![]()


Reply With Quote