Reputation: 3085
I would like to test the API of WPF
application that is already running.
The application is single window application and its MainWindow
holds object that I would like to fetch (it's public and has public methods and properties
)
Is there a way I can go from Gui or Process to the under layer and fetch exist object?
// Interaction logic for MainWindow.xaml
public partial class MainWindow : Window
{
//this is the object to be fetch
public AppAPI AppAPI { get; private set; } }
public class AppAPI
{
private void IncrementCounter(){...}
public int GetClickCounter(){...}
public void Click(){...}
public void Launch(){...}
}
Upvotes: 1
Views: 250
Reputation: 20451
What you are talking about is inter-process communication in .NET - which is a complex subject and would require a significant re-factoring of your application in order for it to offer such a feature. I think WCF over named pipes would be a good starting point
Upvotes: 2