小编Ary*_*rys的帖子

WP SilverLight 8.1 vs WP 8.1(XAML)的优点和缺点

我一直在读Wp8.1(XAML)应用程序是为Windows Phone 8.1创建应用程序的新方法,并且该代码对Windows 8.1桌面应用程序具有高度可重用性.

但是有点担心,因为从联系人(WP8.1 XAML中的ContactManager)执行单个搜索比Silverlight对应的慢.

只需从我的议程中返回所有联系人(240个联系人,包括电子邮件,缩略图等......),我的Lumia 1520需要3秒钟; 与Silverlight代码相同的操作需要0.7秒.

我有点害怕使用WP8.1制作手机应用程序,因为性能对我来说非常重要.使用Lumia 1520的触点,Lumia 535的相同测试分别需要7秒和1.5秒.

是否有关于使用何种项目的推荐?我觉得Silverlight应用程序(显然)专注于Windows Phone并使用所有手机的功能.

我错了?我是否会通过选择Windows手机Silverlight进入弃用之路?

注意:用于执行搜索的代码是MSDN示例中的代码...

WP8.1 XAML(诺基亚Lumia 1520,3秒与缩略图,邮件帐户等获得240个联系人......)

ContactStore agenda = await ContactManager.RequestStoreAsync();
Stopwatch sw = new Stopwatch();
IReadOnlyList<Windows.ApplicationModel.Contacts.Contact> contacts = null;
sw.Start();
contacts = await agenda.FindContactsAsync();
sw.Stop();
txtblock1.Text = sw.ElapsedMilliseconds;
Run Code Online (Sandbox Code Playgroud)

WP Silverlight 8.1(诺基亚Lumia 1520,0.7秒获得240个缩略图,邮件账号等联系人......)

Contacts agenda = new Contacts();
//Stopwatch is declared at class level so its accessible in ListContacts_SearchCompleted Callback
sw.Start();
agenda.SearchCompleted+= ListContacts_SearchCompleted;
agenda.SearchAsync(String.Empty, FilterKind.None, null);
//sw.Stop() and print ElapsedMilliseconds in ListContacts_SearchCompleted callback
Run Code Online (Sandbox Code Playgroud)

编辑:在论坛中创建的帖子有关此https://social.msdn.microsoft.com/forums/windowsdesktop/en-us/1e0accaf-b2f8-4d68-b5ec-dc6af6351633/findcontactsasync-takes-long-time?referrer=http: //social.msdn.microsoft.com/forums/windowsdesktop/en-us/1e0accaf-b2f8-4d68-b5ec-dc6af6351633/findcontactsasync-takes-long-time?referrer=http://social.msdn.microsoft.com/论坛/ windowsdesktop/EN-US/1e0accaf-b2f8-4d68-b5ec-dc6af6351633/findcontactsasync通吃长时间?论坛= …

c# silverlight xaml windows-phone-8.1

15
推荐指数
1
解决办法
797
查看次数

使用[JsonConverter]属性时,我的JsonConverter类中的StackOverflowException

我有一个测试类,我试图序列化:

public class Testing
{
    private string _name;
    private string _firstname = "firstname";
    public string _lastname;
    private DateTime _datenow = DateTime.Now;
    public DateTime _birthdate = DateTime.Now;

    public string Name { get { return _name; } set { _name = value; } }
}
Run Code Online (Sandbox Code Playgroud)

我使用自定义JsonConverter来处理测试类的序列化:

public class TestingConverter : JsonConverter
{
    private Type[] _types = new Type[] { typeof(Testing)};

    /// <summary>
    /// Writes the JSON representation of the object.
    /// </summary>
    /// <param name="writer">The <see cref="JsonWriter"/> to write to.</param> …
Run Code Online (Sandbox Code Playgroud)

.net json.net c#-4.0

7
推荐指数
1
解决办法
2887
查看次数

标签 统计

.net ×1

c# ×1

c#-4.0 ×1

json.net ×1

silverlight ×1

windows-phone-8.1 ×1

xaml ×1