Copyright
이 모든 내용은 Pluralsight에 Kevin Dockx가 올린 'XAML Jumpstart : Getting Started With XAML' 이라는 강의의 8번째 챕터를 듣고 정리한 것입니다(https://app.pluralsight.com/library/courses/xaml-jumpstart/table-of-contents). 강의 원작자분께 게시허가도 받았습니다.
Content
1. Basic Elements, Shapes, Brushes, and Masks
2. Control Basics and Interacting with them
3. Panels and the Layout System
6. Using Resources and Styling Controls
7. Debugging and Analyzing XAML
8. Choosing the Right Tool for the Job
Debugging XAML
Setting breaakpoints in XAML isn't possible (except in Silverlight), but can use the output window to check for data binding errors
Output window를 통해서 대부분의 Data Binding error를 찾아낼 수 있다.
Analyzing XAML
After a while, it can become quite hard to find the source of a UI-related mistake in a XAML document, especially when you start creating custom templates
XAML Spy, develped by Koen Zwikstra, provides a real time view of your app state.From here, we can examine and modify properties of any element on the fly and see the changes reflected immediately in the running app.(www.xamlspy.com)
XAML Tips
How you write your XAML can have a tremendous impact on application performance
1. Minimize element count
eg. Use Background on Grid instead of filling the Grid with a Rectangle to achieve the same, Rectangle uses memory more!
2. Reuse resources
Resources you reuse are only created once
eg. specific brush that you're using throughout your application, create that brush, put it in a resource dictionary, and refer to it through StaticResource rather than setting the brush manually each time you use it. Not only is it a lot easier to change the brush afterwards, but the resource only has to be created once so you get one instance of that brush in memory instead of having multiple instances of that brush in memory.
3. Avoid unnecessary overdraw (specially important!)
Every pixels needs to be drawn, even if it's fully overlaid by another pixel. UWP app that has to run on a low-end ARM device, the maximum amount of overdraw that can take is about 4 pixels, and that's not a lot.
Memory profiing
Performance-related problems often arise in XAML applications, and contrary to what might look obvious, memory profiling is one of the best ways to locate the source of those problems. (You typically do not use a performance profiler to fix these issues because memory profiler is actually one of the best ways to locate the source of those problems. That's because a lot of those performance-related problems actually stem from bad memory management)
Telerik(http://telerik.com/)
JetBrains(http://jetbrains.com/)
Visual studio build in memory profiler
Summary (생략)
출처
이 모든 내용은 Pluralsight에 Kevin Dockx가 올린 'XAML Jumpstart : Getting Started With XAML' 이라는 강의의 8번째 챕터를 듣고 정리한 것입니다(https://app.pluralsight.com/library/courses/xaml-jumpstart/table-of-contents). 제가 정리한 것보다 더 많은 내용과 Demo를 포함하고 있으며 최종 Summary는 생략하겠습니다. Microsoft 지원을 통해 한달간 무료로 Pluralsight의 강의를 들으실 수도 있습니다.
'Programming > XAML' 카테고리의 다른 글
(XAML Layout in Depth) Layout Basics 1 (0) | 2017.12.13 |
---|---|
(XAML)Choosing the Right Tool for the job, (Visual studio vs Blend) (0) | 2017.12.12 |
(XAML)Using Resources and Styling Controls (0) | 2017.12.12 |
(XAML)Working with ItemsControls (0) | 2017.12.11 |
(XAML)Data Binding Essentials (0) | 2017.12.10 |