I develop a wpf app and i associated a file type named .fcsc
. The application opens when the file is doubled clicked but it execute a new instance of the app. What i want is that if the app is already running, open the file in that instance not in a new one.
How can i archive that?
This is what i have when a file is open:
if (AppDomain.CurrentDomain.SetupInformation != null
&& AppDomain.CurrentDomain.SetupInformation.ActivationArguments != null
&& AppDomain.CurrentDomain.SetupInformation.ActivationArguments.ActivationData != null &&
AppDomain.CurrentDomain.SetupInformation.ActivationArguments.ActivationData.Any())
{
// is a file association invoke, open the window
InstallPluginWindow installPluginWindows = new InstallPluginWindow(AppDomain.CurrentDomain.SetupInformation.ActivationArguments.ActivationData);
installPluginWindows.Show();
installPluginWindows.Owner = this;
this.Opacity = 0.5;
this.IsEnabled = false;
installPluginWindows.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterOwner;
installPluginWindows.Closed += installPluginWindows_Closed;
}
else
{
NegotiateLogin();
}