Development from the Fieldhttps://blogs.msdn.microsoft.com/jfox
Covering real-world development scenarios that I experience in the field.Thu, 15 Nov 2012 09:31:00 +0000en-UShourly1Helpful resources for developing Windows Store appshttps://blogs.msdn.microsoft.com/jfox/2012/11/15/helpful-resources-for-developing-windows-store-apps/
https://blogs.msdn.microsoft.com/jfox/2012/11/15/helpful-resources-for-developing-windows-store-apps/#respondThu, 15 Nov 2012 09:31:00 +0000https://blogs.msdn.microsoft.com/jfox/2012/11/15/helpful-resources-for-developing-windows-store-apps/Here are links to some of the resources that I find most useful for developing Windows Store apps. I’ll update this post as I come up with more, but this should get you started.

]]>https://blogs.msdn.microsoft.com/jfox/2012/11/15/helpful-resources-for-developing-windows-store-apps/feed/0Come see me at Tulsa TechFest 2012https://blogs.msdn.microsoft.com/jfox/2012/10/09/come-see-me-at-tulsa-techfest-2012/
https://blogs.msdn.microsoft.com/jfox/2012/10/09/come-see-me-at-tulsa-techfest-2012/#respondTue, 09 Oct 2012 11:22:22 +0000https://blogs.msdn.microsoft.com/jfox/2012/10/09/come-see-me-at-tulsa-techfest-2012/I will be giving a talk on Friday, October 12th at 1:30 PM centered around how you can make your Windows 8 app better.

]]>https://blogs.msdn.microsoft.com/jfox/2012/10/09/come-see-me-at-tulsa-techfest-2012/feed/0Tips & Tricks: AppBar Buttons in XAMLhttps://blogs.msdn.microsoft.com/jfox/2012/10/04/tips-tricks-appbar-buttons-in-xaml/
https://blogs.msdn.microsoft.com/jfox/2012/10/04/tips-tricks-appbar-buttons-in-xaml/#respondThu, 04 Oct 2012 12:58:00 +0000https://blogs.msdn.microsoft.com/jfox/2012/10/04/tips-tricks-appbar-buttons-in-xaml/I have come across several developers that have asked how they get all those nice icons for the AppBar buttons.

For XAML

If you’re building your app using XAML, then the best way is to peruse the StandardStyles.xaml resource dictionary, found in the Common directory, to see if you can find one of the already defined buttons that fit your needs. Simple look through and find the style that will work for you and uncomment that section of XAML. Then, you can assign that style to your Button’s Style property using the “{StaticResource <style name>}” binding.

Example of a play button.

Overriding the text displayed

After you do this, you may notice that you can’t set the name that displays below the icon image.

Actually you can. If you look at the AppBarButtonStyle definition, then you’ll notice that the TextBlock that contains that text is bound to AutomationPropertites.Name. So, simply override that attached property on your button like this.

If anyone has any tips for WinJS developers, please let me know in the comments. Happy to share a link with the community.

]]>https://blogs.msdn.microsoft.com/jfox/2012/10/04/tips-tricks-appbar-buttons-in-xaml/feed/0Windows 8: IsConnectedToInternet?https://blogs.msdn.microsoft.com/jfox/2012/09/10/windows-8-isconnectedtointernet/
https://blogs.msdn.microsoft.com/jfox/2012/09/10/windows-8-isconnectedtointernet/#commentsMon, 10 Sep 2012 14:44:00 +0000https://blogs.msdn.microsoft.com/jfox/2012/09/10/windows-8-isconnectedtointernet/In writing my own app, I found myself wondering, “how to I detect if the machine is actually connected to the internet before I start making all manner of web services calls?”. Well, below is my solution written in C#. Enjoy!

I had a question from a friend a few months ago about the Windows 8 Modern UI replacing WPF and if he should still invest in training for desktop development. I understand where the concern is coming from – WinRT is the new shiny kid on the block and there is a fear of irrelevancy. Stave off your fear, my friends! Desktop is here to stay for the foreseeable future and polishing up the ole WPF skills is never a bad thing. There will be demand for that skillset for years to come as companies still have to build robust desktop apps that just don’t fit into the Modern UI scenario.

There will be codebases that need maintenance, new features to add and just outright new projects that will require desktop development skills like WPF.

Having said that, there is no reason a developer can’t develop for both desktop and Windows Store. Is there? Take those awesome XAML/C#/VB skills and put them to use in an app and make some money!

In modern apps, collecting and storing user credentials has become very prevalent. Especially, if your app is leveraging a service or other type of secure resource that requires the user to provide a login. Providing a good, clean and consistent credential experience is very important, in that it gives the user the feeling that you are handling their credentials with the care and security that they deserve. So, in this topic, I will discuss how to implement credential collection using the CredentialPicker API in your Window 8 app.

Collecting user credentials

In the past, on desktop applications and web pages, collecting user credentials was a mixed bag of user experiences. Some developers used the APIs provided in Windows and some rolled their own dialogs for collecting this information. Since one of the core concepts of Windows 8 development is to provide users with a clean, consistent user experience across applications and devices, it would make sense to extend this principle to credentials.

This brings up the CredentialPicker class. This class provides a configurable async dialog that can be used to collect credentials from the user and return them via a CredentialPickerResults object. Once the user has entered the credentials, you can use this object to pass credentials on to your authentication process and then storage, provided the user has opted to save them.

As you can see, the CredentialPicker API is a very simple way to collect user credentials using a consistent, asynchronous API.

Test the credentials

The next step is very important, but I won’t go in to any detail here. Once the CredentialPicker returns, be sure to validate the credentials before proceeding. If the validation fails, then alert the user gracefully with meaningful, inline errors. Don’t ruin the great login experience you’re creating by mishandling this very important step.

Store the credentials

If the user chose to have you save their credentials, then you’ll want to store the user name and password somewhere in order to leverage them. Luckily, the WinRT APIs contain a class that will help you with this task. Instead of storing this information in a text file or XML file, go ahead and leverage the PasswordVault class in order to store the credentials in the Windows Credential Manager.

Not only does it save you a little bit of coding, but it provides a safe, consistent way to store credentials and retrieve them later. It also has the bonus of being able to sync credentials across devices to the same Windows Live ID. This means that a user can login on one device and then, through the magic of syncing, there are automatically logged in on any other device running Windows 8.