Quantcast
Channel: Managed Extensibility Framework
Viewing all articles
Browse latest Browse all 265

New Post: Why is #if WINDOWS_PHONE_APP directive not working?...

$
0
0
As an result of the directive not available after injection, I had to create a BooleanProperty in my ViewModel and set it during __OnImportsSatisfied__():
 /// <summary>
        /// Called when a part's imports have been satisfied and it is safe to use.
        /// </summary>
        [OnImportsSatisfied]
        public void OnImportsSatisfied()
        {
            // IPartImportsSatisfiedNotification is useful when you want to coordinate doing some work
            // with imported parts independent of when the UI is visible.
            Debug.WriteLine("HubPage OnImportsSatisfied instantiation");

#if WINDOWS_PHONE_APP
            Debug.WriteLine("directive WINDOWS_PHONE_APP is defined...");
            this.ViewModel.Windows_Phone_App = true;
#elif WINDOWS_APP
            Debug.WriteLine("directive WINDOWS_APP is defined...");
            this.ViewModel.Windows_Phone_App = false;
#else
            Debug.WriteLine("Error directive WINDOWS_PHONE_APP/WINDOWS_APP not defined...");
#endif
        }

Viewing all articles
Browse latest Browse all 265

Trending Articles