简体   繁体   中英

How to use windows-phone exclusive code in a xaml code file (Win-Uiniversal App)

Does anyoneone know how to write windows-phone exclusive code in a xaml code file (universal app)? ex when I want to use another design for my W8.1 app as for my WP8.1 app.

I moved the MainPage.xaml and MainPage.xaml.cs to the ".Shared" folder, and thus I use the same code for both platforms.

so in Mainpage.xaml.cs I could use

#if WINDOWS_PHONE_APP

#endif

but whats the equivalent for the xaml code?

I hope you understand my question Thanks in advance, Christian

There is no equivalent for XAML. You can create a userconteol that is forked between the project types and then reference this usercontrol from the shared xaml

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM