Skip to content

Conversation

@jlaanstra
Copy link
Contributor

@jlaanstra jlaanstra commented Oct 27, 2019

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
Collaborator

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

@jlaanstra jlaanstra changed the title Remove unnecessary xaml includes. Remove unnecessary xaml and windows includes. Oct 29, 2019
@jlaanstra
Copy link
Contributor Author

@kennykerr done.

@Scottj1s
Copy link
Member

thanks for the tidy up!

@Scottj1s 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