locked
Launching new wpf application from a wpf application RRS feed

  • Question

  • Hi,

    We already have a wpf application which is a kind of huge.

    Now we got a new requirement where we have to plug in one feature. The dicision from the
    architecture team is to have a different desktop application which should be launch
    when user request for the new feature.

    The new desktop appliaction will recieve some parameter from the parent desktop applciation like user name and age.

    The child desktop application will use the name and age and also take some more input
    and calculate some value and return it to the parent applcaition.

    My Questions:

    1. I am not sure how to launch a new wpf dektop application on click of some button on the parent application.
    2. How the value will flow (too & fro) between these applications.

    Can anyone please guide me?

    Thanks.

    Friday, April 8, 2016 5:34 PM

Answers

  • A separate exe?

    That's a crazy bad idea.

    .

    If you want a plug in then that's a dll, not an exe.

    A usercontrol library project.

    .

    As it is, one exe and another are totally separate processes.

    You can start a separate exe using process.start.

    Process.Start("WhoDesignedThis.exe");

    And since it's a totally separate process then you'd need to use something like ms message queue to talk between the two.


    Hope that helps.

    Technet articles: WPF: Layout Lab; All my Technet Articles

    • Proposed as answer by DotNet Wang Friday, April 15, 2016 8:35 AM
    • Marked as answer by Xavier Xie-MSFT Thursday, April 21, 2016 12:31 PM
    Friday, April 8, 2016 7:37 PM
  • >>1. I am not sure how to launch a new wpf dektop application on click of some button on the parent application.

    Starting a new WPF application is the same as starting any new process. You can do this using the Process.Start method where you pass the path of the compiled executable as an argument to the method:

    Process.Start("c:\folder\WpfApplication1.exe");

    You can pass arguments using the ProcessStartInfo class as suggested here: http://stackoverflow.com/questions/10547195/using-process-start-in-a-wpf-application-to-invoke-another-wpf-application

    Note that the new process won't have any connection to the WPF application that started it though. It is just another separate process that lives its own life.

    >>2. How the value will flow (too & fro) between these applications.

    How to communicate between two separate process is a fairly advanced topic that is not related to WPF. Please refer to the following links for some suggestions:
    http://stackoverflow.com/questions/84855/what-is-the-best-choice-for-net-inter-process-communication
    http://stackoverflow.com/questions/528652/what-is-the-simplest-method-of-inter-process-communication-between-2-c-sharp-pro

    If you have any further questions about how to communicate between two separate processes, you should start a new thread in another forum. Which forum depends on the technique you choose to use.

    Hope that helps and good luck.

    Please remember to close your threads by marking helpful posts as answer and then start a new thread if you have a new question. Please don't ask several questions in the same thread.

    • Proposed as answer by DotNet Wang Friday, April 15, 2016 8:35 AM
    • Marked as answer by Xavier Xie-MSFT Thursday, April 21, 2016 12:31 PM
    Saturday, April 9, 2016 6:45 PM

All replies

  • A separate exe?

    That's a crazy bad idea.

    .

    If you want a plug in then that's a dll, not an exe.

    A usercontrol library project.

    .

    As it is, one exe and another are totally separate processes.

    You can start a separate exe using process.start.

    Process.Start("WhoDesignedThis.exe");

    And since it's a totally separate process then you'd need to use something like ms message queue to talk between the two.


    Hope that helps.

    Technet articles: WPF: Layout Lab; All my Technet Articles

    • Proposed as answer by DotNet Wang Friday, April 15, 2016 8:35 AM
    • Marked as answer by Xavier Xie-MSFT Thursday, April 21, 2016 12:31 PM
    Friday, April 8, 2016 7:37 PM
  • >>1. I am not sure how to launch a new wpf dektop application on click of some button on the parent application.

    Starting a new WPF application is the same as starting any new process. You can do this using the Process.Start method where you pass the path of the compiled executable as an argument to the method:

    Process.Start("c:\folder\WpfApplication1.exe");

    You can pass arguments using the ProcessStartInfo class as suggested here: http://stackoverflow.com/questions/10547195/using-process-start-in-a-wpf-application-to-invoke-another-wpf-application

    Note that the new process won't have any connection to the WPF application that started it though. It is just another separate process that lives its own life.

    >>2. How the value will flow (too & fro) between these applications.

    How to communicate between two separate process is a fairly advanced topic that is not related to WPF. Please refer to the following links for some suggestions:
    http://stackoverflow.com/questions/84855/what-is-the-best-choice-for-net-inter-process-communication
    http://stackoverflow.com/questions/528652/what-is-the-simplest-method-of-inter-process-communication-between-2-c-sharp-pro

    If you have any further questions about how to communicate between two separate processes, you should start a new thread in another forum. Which forum depends on the technique you choose to use.

    Hope that helps and good luck.

    Please remember to close your threads by marking helpful posts as answer and then start a new thread if you have a new question. Please don't ask several questions in the same thread.

    • Proposed as answer by DotNet Wang Friday, April 15, 2016 8:35 AM
    • Marked as answer by Xavier Xie-MSFT Thursday, April 21, 2016 12:31 PM
    Saturday, April 9, 2016 6:45 PM