can I add text box beside the title of WPF window

2019-08-06 10:05发布

问题:

We have a requirement where need to change the title which I can't change the existing code. I can write my c# code using the existing namespaces, libraries something like extensibility of the existing application.

My question how Title can be changed from my code with my requirement(existing code already changed the title as per their requirement)

Please suggest any changes

Thanks, Rajesh

回答1:

for (int i = 0; i < Application.Current.Windows.Count; i++)
        {
            var win = Application.Current.Windows[i];
            if (win.Title == "MainWindow")
                win.Title = "LastWindow";
        }

I hope this will help you to give an idea.You can Apply this code anywhere in your View Project.



标签: c# wpf titlebar