问题
Is it possible to inspect the Visual Tree of any UWP application to see how it is rendered, in the same way that you can inspect the visual tree of the app that you're debugging in Visual Studio?
It would be very beneficial to be able to see how the user interface of some applications are comprised.
回答1:
Yes.
- Open Visual Studio with no project open.
- Choose "Debug" from the top menu, and "Attach To Process".
- Press the "Select" button next to the "Attach To" entry field, and choose "Native Code" only.
- Choose your target UWP app and press ok.
At this point your should have an inspectable Live Visual Tree.
Without being able to see the code that helped construct that XAML it might not be as useful as you hope, but it's still occasionally interesting to spark some ideas.
来源:https://stackoverflow.com/questions/54999718/how-to-inspect-the-visual-tree-of-any-uwp-app