Rudi
Rudi

Reputation: 936

High CPU Usage Windows Phone 8 - SystemManaged Function

I'm currently using the Store TestKit on my WP8 App.

I have a Pivot. One PivotItem has several Elements, like a TextBox, which is Binded to my ViewModel (MVVM-Pattern). Anyway, when I click on a TextBox, which is quiet down in the UI, the animation isn't fluid.

The error in the Store TestKit is "Low frame rate due to CPU bound animation" All MY methods are using max. 20% cpu, but this one takes ~80%:

http://www.imgbox.de/users/public/images/5AYadyGRAd.png

(Systemeigene Funktion = System Managed Funktion

Stichprobe = Sample)

How can I lower the value? Since it's not a function created by me, I can't use a Thread. I've seen this post http://www.expressionblend.com/articles/2012/03/23/wp7-performance-tip-translate-transforms/ . It describes my problem, but doesn't give a solution.

This is what a property in my ViewModel looks like:

private string _myval;
public string MyVal
{
    get { return _myval; }
    set
    {
        _myval = value;
        RaisePropertyChanged(() => MyVal);
    }
}

But the property isn't the problem...

Upvotes: 1

Views: 912

Answers (1)

Rudi
Rudi

Reputation: 936

Ok wow, great article by this guy:

http://fiercedesign.wordpress.com/2012/08/14/windows-phone-performance-best-practices/

Read the Topic "Redraw Regions"

If the UI is not smooth/fluid, you have to check which elements are being redrawn every time by the UI. You can do this by going to the App.xaml.cs and enable Redraw Regions

Application.Current.Host.Settings.EnableRedrawRegions = true;

If an area or element is flickering, something is wrong. Try to add

CacheMode="BitmapCache"

to your element.

I had a lot of color flickering in my app. The UI redrew i.e. my TextBlocks, even though I didn't change it. All I had to do was to change all the elements (especially the TextBlocks and the Grids) like this:

<TextBlock CacheMode="BitmapCache"/>

The App is now running fluid.

Upvotes: 1

Related Questions