windows-phone-7 interview questions
Top windows-phone-7 frequently asked interview questions
I'm currently creating an application in C# using Visual Studio. I want to create some code so that when a variable has a value of 1 then a certain piece of code is carried out.
I know that I can use an if statement but the problem is that the value will be changed in an asynchronous process so technically the if statement could be ignored before the value has changed.
Is it possible to create an event handler so that when the variable value changes an event is triggered? If so, how can I do this?
It is completely possible that I could have misunderstood how an if statement works! Any help would be much appreciated.
Source: (StackOverflow)
This question is specifically related to a recommended architecture and people's previous experiences for cross-platform WP7, iOS, Android apps developed using C#, Monotouch and Monodroid respectively. I have researched previous questions here, here and here. They provide good answers but not quite what I'm looking for. I have also found this excellent question which does go into the cost benefit so there is some overlap.
I have a requirement to develop a cross-platform iPhone/iPad, WP7 and android app for a health & fitness company, which will integrate with their website. The app requires a small amount of local data storage for offline mode and synchronisation with the website when a network is available. I am a Windows (C#/C++) developer through and through and don't really want to go down the route of three Objective C, Java and C# apps, although I will if I have to. I will also be operating as tech lead and farming out some work to a team on this project.
I would like to know if anyone here has experience with cross-platform development using Monotouch, Monodroid and WP7 and to share their experience on application architecture to re-use as much code as possible. The architecture I am considering is as follows:
My question is as follows:
- Has anyone here tried something like this?
- Are these frameworks (Monotouch, monodroid) worth their salt for this sort of work?
- Can I setup the entire project in Visual Studio 2010 with separate projects (dlls/exe) for the Monotouch, Monodroid and Wp7 target (but shared code using 'Add as Link')?
- What sort of code-reuse can I realistically expect with this (or a similar) architecture? i.e. what strategies / patterns can I use to re-use local data access, webservices, and business logic?
Best regards,
Source: (StackOverflow)
It is most probably a stupid mistake, but can anyone tell me why my icons are showing in Blend, but not in the simulator (and not in VS10, but that's not really an issue)?
Edit - Here is my XAML :
<phone:PhoneApplicationPage.ApplicationBar>
<shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
<shell:ApplicationBarIconButton IconUri="/Images/share.png" Text="Partager"/>
<shell:ApplicationBarIconButton IconUri="/Images/appbar.edit.rest.png" Text="Note"/>
<shell:ApplicationBarIconButton IconUri="/Images/appbar.feature.camera.rest.png" Text="Photos/Vidéos"/>
<shell:ApplicationBarIconButton IconUri="/Images/calendar.png" Text="Rendez-vous"/>
<shell:ApplicationBar.MenuItems>
<shell:ApplicationBarMenuItem Text="MenuItem 1"/>
<shell:ApplicationBarMenuItem Text="MenuItem 2"/>
</shell:ApplicationBar.MenuItems>
</shell:ApplicationBar>
</phone:PhoneApplicationPage.ApplicationBar>
My four .png files are 48x48, transparent .png with black foreground, since the appbar.*.rest.png
files where like that and found in the Microsoft icons folder
Source: (StackOverflow)
This seems like a really, really simple problem, but I can't figure it out. The culprit appears to be WP7's default style. It changes the background color to white when a button is clicked, then back to the button's default background.
The problem I have is I want to change the button's background when the button is clicked. I can't find any possible way to do this.
I've tried setting the background in code, but that does nothing. I think it's being overwritten by the default style.
I've tried using a Property Change behavior in Blend, but that has the exact same result.
I've tried creating a new visual state for the button and setting that on click, but that's a little buggy and has a large overhead for the number of buttons I'm dealing with. Also, it didn't work.
I can set other buttons' background on a click event, just not the button being clicked.
This is such an annoying roadblock! I'm sure this is a one line of code kind of answer. :)
Source: (StackOverflow)
Ideally I need to implement a WP7 control that can be added to any XAML and which displays a dynamic, interactive 3D scene.
Currently I have this implemented via XNA in shared mode, and the UI is rendered on top of the scene using UIElementRenderer
. However this solution is sub-optimal because
The application must render the whole screen because in shared mode, Silverlight does not draw anything by itself.
I couldn't find any way of detecting that a Silverlight control needs to change its presentation, be it due to user interaction or animation. Controls are rendered only when the 3D scene changes because of this, and so they lack the slick look and feel of the native WP7 applications.
So, is there a way of rendering a 3D scene inside one control, and letting Silverlight manage the rest of the UI?
Source: (StackOverflow)
I have added a new XAML page to my WP7 app and I need the application to startup on this new page. How do I do that ?
I cannot find MainPage (which is the current / default start page) referenced anywhere in App.xaml or App.xaml.cs.
Source: (StackOverflow)
I need to prevent the screen from automatically locking itself if the user dont interact with the device for a while.
Is it possible to request some kind of lock to keep the screen on while running my application?
Source: (StackOverflow)
The regular .Net framework contains HttpUtility.UrlEncode in the System.Web Assembly and in Silverlight it appears it was moved to System.Windows.Browser. But in Windows Phone 7 (which I thought was the same as Silverlight) I can't seem to find a proper way to UrlEncode anything. Neither of the previously mentioned assemblies are available in the Windows Phone 7 environment.
Source: (StackOverflow)
I would like to develop for Windows Phone 7 but the lack of database support still blocks me. Has anyone found a good library, stack to use for accessing local database from WinPhone7?
Can you post links/examples of good practices to select/insert data in DB from a WinPhone7 application?
Thanks in advance !
c.
[edited] any updates available?
Source: (StackOverflow)
hey,
I'd like to store the hash of a password on the phone, but I'm not sure how to do it. I can only seem to find encryption methods. What's the best way to hash the password?
thanks
Source: (StackOverflow)
With multi-tasking enabled, can I safely throw away tombstoning when porting my project to Mango?
Source: (StackOverflow)
Is there a way to get a TextBox in Windows Phone 7 to update the Binding as the user types each letter rather than after losing focus?
Like the following WPF TextBox would do:
<TextBox Text="{Binding Path=TextProperty, UpdateSourceTrigger=PropertyChanged}"/>
Source: (StackOverflow)
I have a page with some text boxes for data input. The binding of the text box is set to TwoWay
. The data in my view model only gets updated if the text box loses focus. If I click a button, such as save, and the text box still has the focus, the changes in the text box aren't changed in my view model on the save event.
Is there a way to have the binding save the value of the text box before it loses focus? Or do I need to do something in the save event?
Source: (StackOverflow)