none
Open View from another project

    Question

  • In my solution there are many projects. For some reason, each project has many Views. Now I have to open a View in project B by click a button in a View in project A.

    I can not find the example online. Thank you.

     
    Tuesday, February 21, 2017 9:53 PM

All replies


  • Hi  ardmore,

    You can try to add a project reference to the project you want to call the other project from. Then, you can visit the View form another project.

    You can also refer the pack URI.

    The following example shows the pack URI for a XAML resource file that is located in the root of the referenced assembly's project folder

    pack://application:,,,/ReferencedAssembly;component/ResourceFile.xaml

    The following links for your reference.

    Pack URIs in WPF:
    https://msdn.microsoft.com/en-us/library/aa970069%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396

    Best Regards,

    Yohann Lu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, February 23, 2017 9:04 AM
  • Hi I need to pass parameters to that View as well when I open the View.

    Edit: I use session to communication the message. What I did was to append the string to the uri. It seems okay. I can open the view by using HtmlWindow.Navigate Method (Uri, String, String).

    But it closed the original window and open the the target window. I want both window opening. 



    • Edited by ardmore Tuesday, February 28, 2017 9:34 PM edit
    Saturday, February 25, 2017 1:20 PM

  • Hi ardmore,

    Maybe you might consider using reflection to open the project B's form

    Reflection (C#):
    https://msdn.microsoft.com/en-us/library/mt656691.aspx?f=255&MSPPError=-2147217396


    Best Regards,

    Yohann Lu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, March 10, 2017 6:41 AM