PowerShell Jedi
 Basic Member Posts:410

 |
| 30 Mar 2009 06:20 AM |
|
He all, I have been looking for a simple example of how press a WPF button and have Powershell Receive the data or processes it. I have seen a WPF calculator demo so I know its possible. |
|
PoSH is a Automation Technology surfaced as a scripting language, not a "spice" ;-)
|
|
|
Marco Shaw (MVP)
 Veteran Member Posts:1647

 |
| 30 Mar 2009 06:38 AM |
|
Read this entire page and comments: http://dougfinke.com/blog/index.php...nt-page-1/ If you incorporate the comments, make sure the first line of the XAML here string is changed to this: That's what I needed to change to make it work. PS I'll be doing a presentation that gives a high overview of .NET in PowerShell on April 1st: http://www.msfttechdays.com/public/...nlist.aspx Search for "powershell". |
|
Marco
*Microsoft MVP - Windows PowerShell
https://mvp.support.microsoft.com/profile/Marco.Shaw
*Co-Author - Sams Windows PowerShell Unleashed 2nd Edition
*Blog - http://marcoshaw.blogspot.com |
|
|
PowerShell Jedi
 Basic Member Posts:410

 |
| 30 Mar 2009 06:59 AM |
|
Thanks |
|
PoSH is a Automation Technology surfaced as a scripting language, not a "spice" ;-)
|
|
|
PowerShell Jedi
 Basic Member Posts:410

 |
| 30 Mar 2009 08:27 AM |
|
I looked at this post including the reply's. The problem is im not well versed in XAML. The example in the reply does create an error in the powershell window which is promising but Honestly I just want some one to give me a code snippet that I can cut & paste and that works. I just want to get the button click event into powershell to be processed successfully. So right now I feel like a mule with a WPF carrot dangling in front of my face that can't actually do anything useful. |
|
PoSH is a Automation Technology surfaced as a scripting language, not a "spice" ;-)
|
|
|
Marco Shaw (MVP)
 Veteran Member Posts:1647

 |
| 30 Mar 2009 08:43 AM |
|
You'll have to wait until after my presentation Wednesday for me to help you with all the steps. Remember that you need to be running in STA mode for WPF to fully work. So run that code from the ISE or Posh v2 console started with the -sta flag. |
|
Marco
*Microsoft MVP - Windows PowerShell
https://mvp.support.microsoft.com/profile/Marco.Shaw
*Co-Author - Sams Windows PowerShell Unleashed 2nd Edition
*Blog - http://marcoshaw.blogspot.com |
|
|
PowerShell Jedi
 Basic Member Posts:410

 |
| 30 Mar 2009 08:51 AM |
|
I understand the -sta stuff I would Like to make a request of you. Please do a example where you press a WPF button and it does something in the console version of Powershell. Preferable in a Runspace. Example: Click a WPF button called "Get-Date" and it runs get-date in the console. or populates a XAML label with the date. This seems like basic. Thanks for your help and I will be the first person to view your Wednesday post. |
|
PoSH is a Automation Technology surfaced as a scripting language, not a "spice" ;-)
|
|
|
PowerShell Jedi
 Basic Member Posts:410

 |
| 01 Apr 2009 03:19 PM |
|
[quote] Posted By marco.shaw on 30 Mar 2009 08:43 AM You'll have to wait until after my presentation Wednesday for me to help you with all the steps. Remember that you need to be running in STA mode for WPF to fully work. So run that code from the ISE or Posh v2 console started with the -sta flag. [/quote] Well I tryed to watch your TechDays WebCast. You'd think M$ would know how to adjust The time for the webcast depending on the time zone of the browser viewing the page. The web site says yous web cast is going on right now... "Wednesday, April 1 5:30 PM - 6:30 PM" *SiGH* |
|
PoSH is a Automation Technology surfaced as a scripting language, not a "spice" ;-)
|
|
|
Marco Shaw (MVP)
 Veteran Member Posts:1647

 |
| 01 Apr 2009 03:25 PM |
|
5.30PM GMT, which started almost 5 hours ago now... Email me directly marco DOT shaw AT gmail DOT com. |
|
Marco
*Microsoft MVP - Windows PowerShell
https://mvp.support.microsoft.com/profile/Marco.Shaw
*Co-Author - Sams Windows PowerShell Unleashed 2nd Edition
*Blog - http://marcoshaw.blogspot.com |
|
|
PowerShell Jedi
 Basic Member Posts:410

 |
| 02 Apr 2009 12:42 PM |
|
AHHHH! I figured out my Problems!!! XAML is Case Sensitive!! Powershell isn't!! When working with XAML you have to be aware of cAse!! I hate problems like that!!!!!
|
|
PoSH is a Automation Technology surfaced as a scripting language, not a "spice" ;-)
|
|
|
EBGreen
 Advanced Member Posts:859

 |
| 03 Apr 2009 06:21 AM |
|
Yes, it can be a pain, but xaml would have to be case sensitive to be well formed xml. |
|
| "Look Ma...no strings!" |
|
|