WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: stanl on February 06, 2018, 11:56:34 AM

Title: CLR WPF possibilities??
Post by: stanl on February 06, 2018, 11:56:34 AM
Deana created an excellent CLR nugget in the Tech DB that builds and displays a transparent WPF window.  Since VS creates XAML when you draw a WPF window I modified her code to accept xaml  from a file and in the attached the window displays with both a text and button object. 

Currently, like the original script, the window is displayed for 5 seconds then closed. My question is does WB allow accessing the objects, i.e. change the text, or close the window when button clicked.
Title: Re: CLR WPF possibilities??
Post by: td on February 07, 2018, 07:55:44 AM
If you display a form using the ShowDialog method it will terminate on its own when a button is clicked.  You can also access the contents of controls added to a dialog once the dialog is dismissed.  However, responding to events requires delegates so...
Title: Re: CLR WPF possibilities??
Post by: stanl on February 07, 2018, 10:09:53 AM
Quote from: td on February 07, 2018, 07:55:44 AM
However, responding to events requires delegates so...

I was thinking that was the answer just after I posted. I was wrongly assuming that if I gave a 'class' to the window in the xaml it might be possible to run C# code that addressed the class namespace.