Author Topic: CLR WPF possibilities??  (Read 600 times)

stanl

  • Pundit
  • *****
  • Posts: 777
CLR WPF possibilities??
« 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.

td

  • Tech Support
  • *****
  • Posts: 2538
    • WinBatch
Re: CLR WPF possibilities??
« Reply #1 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...
"Success is a lousy teacher. It seduces smart people into thinking they can't lose."
  - Bill Gates


stanl

  • Pundit
  • *****
  • Posts: 777
Re: CLR WPF possibilities??
« Reply #2 on: February 07, 2018, 10:09:53 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.