Skip to content

Remove unnecessary xaml and windows includes. - #403

Merged
Scott Jones (Scottj1s) merged 2 commits into
microsoft:masterfrom
jlaanstra:user/jlaans/remove-xaml
Oct 29, 2019
Merged

Remove unnecessary xaml and windows includes.#403
Scott Jones (Scottj1s) merged 2 commits into
microsoft:masterfrom
jlaanstra:user/jlaans/remove-xaml

Conversation

@jlaanstra

@jlaanstra Johan Laanstra (jlaanstra) commented Oct 27, 2019

Copy link
Copy Markdown
Contributor

Using code from the Windows.UI.Xaml namespace in a viewmodel is considered bad form as the goal of MVVM is to separate view from viewmodel (Windows.UI.Xaml.Data being the exception as the PropertyChanged classes live there). Furthermore, the default templates don't require any classes from that namespace. This makes the code simpler and doesn't by default include the massive Xaml namespace which significantly increases the pch.

Also defines WIN32_LEAN_AND_MEAN;WINRT_LEAN_AND_MEAN; to reduce unnecessary headers from Windows and WinRT.

@kennykerr

Copy link
Copy Markdown
Collaborator

Project templates should also define WINRT_LEAN_AND_MEAN to further reduce build time.

@jlaanstra Johan Laanstra (jlaanstra) changed the title Remove unnecessary xaml includes. Remove unnecessary xaml and windows includes. Oct 29, 2019
@jlaanstra

Copy link
Copy Markdown
Contributor Author

Kenny Kerr (@kennykerr) done.

@Scottj1s

Copy link
Copy Markdown
Member

thanks for the tidy up!

@Scottj1s
Scott Jones (Scottj1s) merged commit 74a0ce8 into microsoft:master Oct 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants