xaml debugging application - wpf

I need to debug xaml and i am looking for some application for that .
Need for recommendations.
Snoop not manages to find my application while i am trying use it.
Thanks

I've had great results with Snoop but you might want to check if you are running your app with elevated permissions eg as administrator as this will prevent it showing up in the list of applications inside Snoop - from snoop codeplex page
Why Aren’t My Apps Showing Up in the App Chooser? One question that comes
up all the time is the situation where
the application you are trying to
Snoop, isn't appearing in the
application chooser (i.e. the combo
box that lists the processes you can
Snoop). This is more than likely a
situation where the application you
are trying to Snoop is running
elevated (as Administrator). In order
to Snoop these applications, you will
also need to run Snoop elevated (as
Administrator).
Also if your xaml is Silverlight then it looks like the only options is Silverlight Spy

You can use 'Visual Tree Visualizer' from VS 10 (VS C#/VB.NET) 2010 Express. See: http://msdn.microsoft.com/en-us/library/dd409789.aspx

Related

Why does Inspect.exe hang frequently and inconsistently display AutomationId?

I'm trying to use MS UI Automation to test a WPF application, and am using the Inspect Object tool (inspect.exe) included with the Windows SDK to look up the AutomationId property on certain elements.
Inspect is behaving very strangely for me:
If I close all applications and start the WPF application and Inspect, inspect is able to see the AutomationId property for various UI elements. Elements which do not have an AutomationId simply show two quotation marks denoting an empty string ("").
After I perform a few actions in the WPF application, inspect.exe hangs and I have to kill it and restart it. Even though the machine's CPU and RAM utilization are around 50% or less, I've tried waiting several minutes--possibly close to 20 or 30 mins on a couple occasions--to no avail.
After restarting, inspect.exe can no longer find an AutomationId for any UI element, even those which did have them previously. What's more, the property is completely missing when hovering the mouse over the WPF application--it is no longer listed at all, not even with an empty string value.
If I move the mouse to another screen (specifically, to another computer, using Mouse Without Borders), the AutomationId property reappears with a value of "FormDot"
If I restart only inspect additional times while the WPF application is still running, inspect still behaves the same as after the first restart.
If I restart only the WPF app while inspect is still running, inspect still behaves the same as after its first restart.
If I close both inspect and the WPF app, then start inspect, then start the WPF app, everything works correctly for a while and inspect finds the AutomationId on a few elements in the WPF app...up until the point at which inspect hangs again.
I've tried running inspect both normally and as an administrator as suggested in https://stackoverflow.com/a/7833728/44737, and it behaves the same either way.
What, if anything, am I doing wrong? Am I just too impatient and do I need to wait a really long time instead of assuming inspect is hung? And why does inspect's behavior regarding AutomationId vary?
There are more than one version of Inspect.exe. The latest to my knowledge is the one dated from 2012 that says version 7.2.0.0 in the help/about dialog box.
The old one doesn't have a tree view on the left with all detected automation elements displayed in a tree, so it's easy to check you're using the right one.
The latest one works quite correctly, however, IMHO, the best tool so far to work with UI Automation is Visual UI Automation Verify. It's a .NET program, and he source is available here:
UI Automation Verify (UIA Verify) Test Automation Framework.
Note that although it's a .NET program, it doesn't use the standard .NET automation dlls (more on that here: What's the difference of UISpy.exe and Inspect.exe? (From Microsoft Windows SDK)).
About the AutomationId property, to clarify my initial comment to the question, I meant its usefulness depends on the program that you're trying to automate.
If you own it as a developer, it's clearly interesting. For example, if you're working with WPF, you can use the x:Uid property, it's clearly meant for UI automation. In the Winforms space, it's also quite useful because UI Automation will use the control's AccessibleName by default and revert to the Name as a fallback, for the AutomationId value.
But there are many apps that don't rely on .NET (browsers, native apps, etc.) Usually, for these apps, it's easier to use other properties.
I have been using inspect.exe for a while on a Microsoft Surface Studio PC (running Windows 10), and my experience is that inspect.exe will hang much more frequently (sometimes always) when Windows Updates are pending. When the updates are out of the way, inspect.exe is still somewhat slow, but much more stable.

Behaviours in wpf apps Microsoft expression blend 4

I am using Microsoft expression blend 4 and i want to add a simple button,in a wpf application, which by clicking it(on "Run Project" mode) navigates the user to another existing wpf application in expression blend 4.This can be done by using a method but maybe I used the wrong method or i used the right method the wrong way.To be more specific i dragged on the button(that i want to make the task i mentioned) the "Launch UriOrFile Action" method but i realised(by making experiments with various files on desktop and using internet url's) that i can only link the running wpf application with random files or internet sites and not to another wpf application as i wanted(when i put the path of the wpf application it pops up a window saying"windows explorer has stopped working",something that didnt occured when i put random file's paths or internet sites url's).If anyone understands my problem let me know!thanks!!
Check out Process.Start. Create a command that fires code that calls that method.

windows application user control in wpf

I have created a user control in windows application and used it in wpf.
The user control is in a seperate project and solution than that of wpf.
I have exposed some properties in the user control and tried to use it in a wpf form.
I have used it in the WindowsFormsHost element and also added WindowsFormsIntegration reference.
I am facing the following problems:
I am able to see the user control in the toolbox but it is disabled.
I am able to design the user control in xaml and give values to properties. I am also getting the properties in intellisense but the same is not getting reflected/applied during design as well as run time.
I am not able to see the control in the properties window even after selecting it. I am just able to see WindowsFormsHost in the property window.
I am not able to find any sample project or explanation of this in code project. If there is any then please do let me know.
Also I am able to use this user control in a windows application very easily and it is working fine. Am i missing anything for wpf?
I can give the source code if required but i dont think it will be of much help as i have not done anything fancy.
Is the control project compiled or just added in the solution?
Is the control project compiled as Debug or Release?
What language is the control compiled in?
"Walkthrough: Hosting a Windows Forms Control in WPF"
Possible help:
http://social.msdn.microsoft.com/forums/en-US/wpf/thread/2fd0d9dd-eaa9-494d-8ec4-d896c33732d6

Using WPFPerf to profile a WPF 4.0 application doesn't show me any information

I am trying to use WPFPerf to profile a WPF 4.0 application (I have the latest WPFPerf that should work on WPF 4.0 aps). I start the tool Visual Profiler from WPFPerf, I start my aplication, but after that nothing happens and the element tree from the Visual Profiler is empty. No other error message is shown. Can anyone tell me what am I not doint right?
As an additional information, when I try to analize my .exe assembly or any other assembly from my application, I get a BadFormatException saying that the assembly was build with a newer version of .NET. From the download page http://go.microsoft.com/fwlink/?LinkID=191420
I see that this version of WPFPerf should be ok for my app
TimeZone patch to WPF Performance Profiling Tools for WPF 4 is now available
http://blogs.msdn.com/b/jgoldb/archive/2010/08/24/timezone-patch-to-wpf-performance-profiling-tools-for-wpf-4-is-now-available.aspx
First check to see if its working even with a small blank WPF application. If it is not working with a blank WPF app, then it likely is the patch already mentioned: TimeZone patch to WPF Performance Profiling Tools for WPF 4 is now available
However, in my case that wasn't the issue. Visual Profiler has a bug that causes it not to display the Element tree if it doesn't like some of the characters in its main window title bar.
Through hours of trial and error, I was able to trace the root cause of why it would not work on our application even though it would on a blank WPF application. The reason is that our application has a special character in the title bar text (trademark). If we eliminate the special character from the main window title, the element tree shows fine when the visual profiler is attached. I was able to reproduce this issue in the simple blank WPF application too simply by putting the following property on the main window:
<Window ..... Title="Test Application™" >
Looks like a bug in Visual Profiler that somehow is triggered by special characters. I didn't test for other special characters, but likely it isn't just this one.
So the workaround is to remove the special character while you are profiling until they fix this.

Silverlight 3 - Can I run Out-of-browser inside another application

The new Silverlight 3 beta includes the ability to run Out-of-Browser applications. The demos so far show this only inside a special frame. Does anyone know how I can run Siverlight 3 controls inside a (WPF) application?
No, you can not embed out-of-browser silverlight into WPF. The sllauncher.exe standalone frame has a special handler for the offline://(hostname).(revision)/ url given to it to allow the app to have all the features of out-of-browser mode (like extra keyboard access). Unless you can find a way to embed this app into your app, you won't be able to get out-of-browser; if you know some way to do this the address for this app is:
C:\Program Files\Microsoft Silverlight\3.0.40307.0\sllauncher.exe
As others have said, however, you can embed a silverlight control inside of an html page and that inside a WebBrowser element. Be cautious with this method, however, since there is currently no x64 support for Silverlight and if you absolutely must do this make sure to compile specifically for x86.
I'm guessing (yes, shame on me!) but you can probably put a WPF web browser on your window and navigate to the Silverlight app inside it.
This is a supported scenario; a recent MSDN article stated this scenario was supported, and scenarios like this forced the CLR team to allow multiple CLRs loaded into a single process.
It seems that SLOOB apps run inside a host process (C:\Program Files\Microsoft Silverlight\3.0.40307.0\sllauncher.exe). This hosts and sandboxes the app.
I suspect that it will not be possible to host it yourself - sorry if that's a little close to guessing, but short of running a hosting web browser in your WPF app I can't think of a way around the sandboxing requirement.
HTH
You can host a browser control inside a windows app, and load silverlight inside the browser control. This is how live mesh is going to do it.

Resources