Hello,
I have an EditBox that displays the current project path when a project is first opened. The issue is when I open another project, the text in the EditBox does not change to reflect the new path.
internal class ProjectPathEditBox : ArcGIS.Desktop.Framework.Contracts.EditBox
{
public ProjectPathEditBox()
{
string stringURI = Project.Current.URI;
Text = stringURI;
}
}
How do I get the Text value to update when another project is opened? Is using an EditBox the best way to do this?
Thanks.
Hi,
Register project open event in module and then update text box. Not tested but should work.
private Module1()
{
ProjectOpenedEvent.Subscribe(OnProjectOpen);
}
private void OnProjectOpen(ProjectEventArgs args)
{
//Get current project path and update text box
//args.Project.HomeFolderPath
}
-Prashant