.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

AutomationPeers and IWindowProvider

Posted By:      Posted Date: September 23, 2010    Points: 0   Category :WPF

I am testing several WPF controls and I'm running into some issues when Invoking a button.  Once said button is invoked the program hits the next line of code before the thread actually finishes executing so when I'm doing an assert the execution of the button has yet to happen and gets called later down the line.  I know IWindowProvider supports WaitForInputIdle (since this invoke is launched as Dispatcher.Input) but I'm not sure how to implement it as there are no derived types that support IWindowProvider.  Any suggestions or ideas how I can wait for this thread to complete?  I am putting this controls on a window that is created and grabbing the AutomationPeers that I want to test through a recursive function.

            Control control = contentProvider.GetContentControl(refreshFieldsActionDef);

            Window window = new Window() {Content = control};

            AutomationPeer rootPeer = UIElementAutomationPeer.CreatePeerForElement(control);

View Complete Post

More Related Resource Links

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend