Tagged: Virtual window interactor WPF
- 09/08/2019 at 23:58 #11863
I have a program that can create multiple wpf windows. And i want every one of them to contain a virtual window. Should i declare these variables in every one of the wpf windows?
private Host host = new Host();
private VirtualWindowsAgent virtualWindowsAgent;
Or is it a waste of ressources?
Tobias12/08/2019 at 14:27 #11867
Hi @eyetrackjack and thanks for your query. There is no need to declare for each WPF window instance as we recommend you use a single host + agent per application. Therefore make the declaration within the main method.
Declaring multiple instances may have unpredictable consequences so please refrain from doing so.
Please do let us know if you are having any issues in this regard or if we can provide further information.12/08/2019 at 17:23 #11869
Thank you for the answer.
It is a WPF application and i don’t use a main routine. So, do i declare it in app.xaml.cs and access it like this?
(App.Current as App).Host13/08/2019 at 18:14 #11870
Hi @eyetrackjack, the Main() Entry point should be located within App.Xaml.Cs -> App -> Main():Void which you can find within the Solution Explorer of Visual Studio and is automatically generated whenever a new WPF project is generated in VS. Here you go declare the Host variables. Hopefully should be clear know, please let me know otherwise.13/08/2019 at 20:56 #11874
You must be logged in to reply to this topic.