小编Cha*_*ams的帖子


在Windows Phone 8.1中处理UI性能问题的最佳方法

在尝试滚动任何大型TextBlock时,我似乎有一个缓慢的UI ...
在WP 8.1中,最好的方法是什么?

这是我用来说明问题的一个例子,注意当应用程序运行时帧速率下降可怕.
我已经查了一下BackgroundWorker,它似乎不存在于WP 8.1中.

MainPage.xaml中

<Page
    x:Class="HTTPRequest.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:HTTPRequest"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">

    <Grid>
        <ScrollViewer x:Name="scroll" Margin="10,13,0,10" Width="380" MaxZoomFactor="4" VerticalScrollMode="Enabled" HorizontalScrollMode="Disabled" IsTapEnabled="False">
            <TextBlock x:Name="RSSData" TextWrapping="Wrap" Text="Loading..." FontSize="22" VerticalAlignment="Top"/>

        </ScrollViewer>
        <ProgressBar x:Name="prog" Height="16" Margin="101,310,101,0" VerticalAlignment="Top" IsIndeterminate="True"/>

    </Grid>
</Page>
Run Code Online (Sandbox Code Playgroud)

MainPage.xaml.cs中

using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net;
using System.Runtime.InteropServices.WindowsRuntime;
using System.Text;
using System.Threading.Tasks;
using Windows.Data.Xml.Dom;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using …
Run Code Online (Sandbox Code Playgroud)

c# winrt-xaml windows-phone-8.1

4
推荐指数
1
解决办法
589
查看次数

标签 统计

c# ×1

ios7 ×1

javascriptcore ×1

windows-phone-8.1 ×1

winrt-xaml ×1