Windows Phone 8 XAML Loading - xaml

I have an app with a pretty big XAML tree on the mainpage, which causes it to load slow (2 seconds to draw the screen), it doesn't even show the WP Toolkit page transition animations.
It doesn't appear to load slow on the emulator, it shows the transations perfectly as well.
On a phone (Lumia 1520) it takes some time to load each page tho. This happens on all pages, even with a smaller xaml tree.
Are there any ways to improve the xaml speed, like would it help to split the xaml items into usercontrols? Any tips are welcome.
Or why it works slower on the device than the emulator (WP8.1 512mb RAM).

Try using Windows Phone Application Analysis tool - you will find out what are the most time consuming tasks while loading the window.
You can find instructions on how to use it here

Related

On opening a tabbed page for the first time, images in listview of content page not loading

I don't know if anyone else has experienced this, i've been looking for examples left, right and centre to no avail.
Anyway, i'm developing an app using Xamarin forms for ios, android and windows phone. The first page of the app is a tabbed page and the first content page consists of a listview with an image (with the source bound to a string with a url) and some labels. I get the data via binding and everything loads correctly except the images. However, when i open a new page and then go back to the tabbed page, the images suddenly appear. I'm testing on a Windows Phone 8.1 at the moment.
Anybody else experienced this? Any work arounds? Any help would be much appreciated.
This might be caused by a known issue that was fixed in 2.2.0-pre1
https://bugzilla.xamarin.com/show_bug.cgi?id=39447
Try updating to that pre-release version and seeing if it resolves your issue.

Why do a .net form and controls not size properly on a given user's machine?

We received a large net desktop application from another agency to implement at our agency. It's messy, but works. It uses a midi form with forms opening inside that, and panels. We compiled and deployed in Visual Studio 2015. It's VB.
All users have Windows 7 64 Pro. For one user, when forms open, the lower portion is cut off. If restored (un maximized), the form shrinks to a tiny window in the upper left of the midi window. If borders are dragged the form will expand, but only a small portion of the form at the upper left will contain anything, as if inside a shrunken panel with scroll bars.
I changed the application so forms have a minimum size that should prevent them from shrinking down, but that doesn't work on her machine. I also changed a couple of panels to "fill" similar to adjacent panels. On other machines the application works excellent, even if display is changed to larger 150%. On the problem machine, the application only works if the display is set to smaller 100% and will not work on medium or larger. The user chooses to have larger.
I can place code on resize events and try to force everything to display correctly, but should not have to do that. The application works correctly everywhere else. Something is different about the problem machine where window metrics are not being computed properly or something similar. All machines are made from the same image and have the same drivers. I cannot see any additional software installed.
I would like to know if anyone else has seen this issue and how it was resolved.

XAML designer in VS2012/Blend not redrawing properly

I have a dev box with Windows 8 + VS2012 Update 2 on top. Ever since I had this system, the XAML designer has been behaving weird (for Win8 and WPF as well): it redraws only every second time.
Meaning that if I place a control, it does not update (the control cannot be seen, but its outline can be, if I hover over it); but if I place another control, or change the zoom level, or do any other action, then it refreshes. When I do a third action, no update; when I do a fourth action, it redraws. And so on, it is 100% repro-able.
Pretty bad for productivity.
I have the latest drivers and updates, I have loads of RAM (16GB) and a discrete Nvidia video card, I restarted umpteen times, the usual fixes do nothing.
A screenshot: http://sdrv.ms/13BJSof
Anyone with similar experience?
OK, I found a solution - my laptop uses nVidia Optimus (it's a Lenovo W520) and that was the source of this error (amongst others, such as being unable to properly "duplicate" my display to a projector). I solved it by simply turning off Optimus in the BIOS and enabling only the Discrete card.

VB.Net automate flash in WebBrowser

I've passed many hours searching the web for a solution to something which seems obvious, but without results.
I need to automate a task in a Flash application running on my intranet.
I can't change the Flash application nor do I have access to the source code.
it's not a Flash movie but an application.
I can't download the swf.
I'm using a WebBrowser in a form. The Flash app is displaying without issues.
So far, I have been able to automate the task (clicking on some buttons, then inputting text and finally saving the results on a server). It works but it's not clean at all because I use hard-coded timers to wait a given action is done and then I click on very specific point at given coordinates in the application.
What I would like to do:
Avoid hard-coded timers. the Flash application takes some time to display all elements on the window (from 20 to 60+ sec). I would like to be able to detect when all elements are loaded. I tried to retrieve the text of the windows handle, but while I can retrieve the Flash hwnd, I can't retrieve the content (through messages).
In brief, instead of waiting 60sec (and not being 100% sure it's enough), if the last element to load in the Flash app has "ABC" written in it, I would like to detect it's displayed so that I can continue the sequence (click on the next button).
I'm using VB.net. Any hints to achieve that would be appreciated.
Lol. I am trying to do the same thing but with no results. You can try to see if there are POST/GET codes that can help you if the application has an online nature. Other than that you can only simulate clicks, because flash can't be easily interacted with. This is why most of the things are going to swap with HTML5 now.

Tips on debugging UI errors in Windows Phone 7

I have a Windows Phone 7 application and I regularly see "weird" UI glitches that take me AGES to debug. It's a range of issues like controls appearing to have extra margin, scrollbars not appearing, animations looking really glitchy, entire page scrolled down, combobox items offset, etc. etc.
I'm happy to admit it might be me - but how to you debug UI errors like this? I know there's Silverlight Spy for the PC Silverlight Apps. Is there anything like this for Windows Phone 7?
Any debugging tips v much appreciated.
I have found that it is a good idea to start with Windows Phone 7 Design Templates, adopt a version control system right from day one of the project and to edit the XAML, use Expression Blend. The Visual Studio is great for writing code, but, to harness the real power of the tools, Expression Blend is the best to style your application.
HTH,
indyfromoz
Here are some tips:
Many people have issues with the emulator due to their graphics card.
Things like slow animations and ui glitches are very common.
Check that your graphics card is Direct X 10.1 at least and that your Driver
Model is WDDM 1.1
Make sure you have the latest drivers.
Windows 7 has less issues with the emulator than Vista
Make sure you have the latest tools, get the RTM release from the website.
In the RTM release, the frame rate counters are displayed by default in a vertical bar on the left, you should monitor these to check for performance issues
Here are a couple of things which I normally do... none of them are real smart, but sharing nevertheless.
Deploy it after every 2-3 controls that you add and ensure things are correctly laying out.
If by chance it doesn't work the way I am expecting it to, I have a parallel Silverlight 3 project running in which I typically paste the XAML and see if it works fine.
After that, I typically check it out as a Silverlight project since even I am not sure of any tools available for Win Phone 7.
I have favorited this question and I hope someone points us to something more interesting.
There's a lot you can checkout with Blend as Indy suggests. This is really good advice.
Regarding some of your specific issues these aren't necessarily glitches. I'll comment on a couple that stand out.
Extra margin - this and padding are built into the metro controls by design. Again, in blend you can dig into this by retemplating the control and changing properties of objects within the control.
The procedure for this is rclick the control, edit template, edit a copy. Then you can look at the different states and objects and change things as suits. While doing this please keep in mind the App Certification Requirements and UI Design Guidelines.
Regarding scrollbars, these are by design hidden until you start scrolling. You can control their availability with Horizontal/VerticalScrollBarVisibility on relevant controls (or on the ScrollViewer embedded in some controls - again retemplate in blend).
Combobox isn't metro themed so is going to struggle in the fitting in department, but there are posts around where people have done work on this. ListPicker is a better fit imo from the Windows Phone Toolkit released with the RTM tools.
If you can't see any obvious causes for the glitches in your code the first thing I would recommend is to actually test your app on a real device. Somethings - particularly animated objects -don't always look exactly the same when you run them on a device.
I thought I had a animation glitch in one of my apps but it only appears in the emulator. When I run on an actual device I don't see it.
Of course this doesn't help you if you can't get a phone to test it on yet, but before you potentially waste hours trying to debug a problem you might not have I would work on the rest of the app until such time as you can test the app on a real phone.
The same goes for anyone creating animations - don't waste time perfecting animations in the emulator. The timings will almost certainly be different on the actual device, so wait till you have one to test on.