Windows Phone 8.1 Silverlight and XAML

£可爱£侵袭症+ 提交于 2019-12-20 02:12:20

问题


Is there any way I can add XAML controls to my WP 8.1 Silverlight app? I'd like to use progress rings and toggle switches but it seems like Silverlight doesn't have them. How can I add them?

Adding a "using Windows.UI.Xaml.Controls" reference doesn't work by the way.


回答1:


Windows.UI.Xaml.Controls is Windows Phone 8.1 Runtime only (or better known as Universal App). If you don't like the controls already in Silverlight, Microsoft has release a extended control kit all "Windows Phone Toolkit". You can get it using NuGet by right clicking the References -> Manage NuGet Packages -> Search "Toolkit" and select the one by Microsoft.

Add the namespace to your XAML and you're ready to go.

<phone:PhoneApplicationPage xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit">

The Windows Phone Toolkit's CodePlex Project Page


List of All Toolkit Control's in the Toolbox




回答2:


Unfortunately, at this time you can't mix Silverlight and WinRT controls. And I doubt it will ever be possible, as Microsoft is likely to move towards ditching Silverlight.



来源:https://stackoverflow.com/questions/25703114/windows-phone-8-1-silverlight-and-xaml

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!