Wintellect Blogs

Under the Hood with Windows Universal Projects

John Garland

23 Apr , 2014  

One of the main themes coming out of the keynotes and content at this year’s //Build 2014 conference was the continued convergence of the Windows Store and Windows Phone development platforms.  One exciting result of the fact that both these platforms now target very similar Windows Runtimes (WinRT and WinPRT, respectively) is the support for the new “Universal Apps” in Visual Studio 2013 Update 2.  (Another exciting result is that the “Programming the Windows Runtime by Example” book that Jeremy Likness and I wrote is even MORE relevant!) 

Projects created using the Universal App templates in Visual Studio include primary projects for each targeted platform as well as a shared project whose content “magically” gets included into each of the head projects.  Currently, only Windows 8.1 and Windows Phone 8.1 primary projects are supported, though apps targeting the Xbox One will one day be included, and Xamarin has indicated they’d be joining the fun soon.

image
A Universal Apps Solution, showing Windows, Windows Phone, and Shared projects

I won’t spend a ton of time discussing the “how-to” aspect of Universal Apps projects – Jeff Prosise has published a series of blog posts that present the basics of working with those projects:

 

I want to focus on the mechanisms working behind-the-scenes that enables these things to work.  How does the Shared content make its way into the app projects in the solution, and why does it behave differently from other sharing mechanisms?  I find that understanding the inner workings of things leads to better decision making when employing them…perhaps that’s why I enjoy reading Jeff Richter’s books.… Read more

,

Wintellect Blogs

Showing the Onscreen Keyboard in Silverlight OOB Applications

John Garland

11 Apr , 2014  

Update – 4/10/2014  Wow!  Quite a lot has happened since I originally posted this.  Certainly one of the biggest changes is the diminished role that Silverlight now plays in both enterprise and consumer applications.  However, I’ve noticed that this particular blog post is still getting some attention, so I figured I’d try to provide some direction that Silverlight developers might be looking for or otherwise be interested in.

  • First and foremost, if you’re looking for resources to help you evaluate or actually execute a move from Silverlight to an alternate technology, check out the Wintellect Silverlight Migration Strategies page which includes Noel Stieglitz’s whitepaper that discusses various options and strategies that are available to you.  I’d also suggest checking out Microsoft’s free e-book “.NET Technology Guide for Business Applications.” 
  • If you’re interested in concepts related to touch for the new Windows Store Apps, check out the book that I co-authored with Jeremy Likness “Programming the Windows Runtime by Example”.  In particular, Chapter 13 (Devices) deals with concepts related to touch interaction.

 

One of the “interesting” things about Silverlight apps running on Windows is that on touch/tablet systems, textboxes in Silverlight do not display a popup button to use for bringing up the Windows onscreen keyboard when they have focus, whereas native applications do.… Read more

Wintellect Blogs

New in Visual Studio 2013–Windows Azure Mobile Services Integration

John Garland

12 Nov , 2013  

As part of the build-up to the official launch of Visual Studio 2013 on Wednesday 11/13, Microsoft has been running a series of guest blog posts, authored by members of the Microsoft MVP community.  I was fortunate enough to have been selected to be one of the authors for the series, and my post was published today.  In it, you can read about the various ways that access to Windows Azure Mobile Services functionality has been integrated into Visual Studio 2013.

The article can be accessed through the Microsoft MVP Award Program Blog, and ultimately appears in its entirety on the Microsoft Press Blog.  If you are at all interested in seeing how Mobile Services can easily be used to enhance your Windows Phone or Windows Store app, check out the article, and feel free to drop me any questions.

 Read more

Wintellect Blogs

Adding Intelligence to the IntelliSense for Windows Azure Mobile Services

John Garland

8 Aug , 2013  

Some of the members of the Visual Studio Windows Azure Tools & Mobile Services teams recently published instructions for “Enabling IntelliSense for Mobile Services JavaScript in Visual Studio.”  Since working with the Windows Azure Mobile Services (WAMS) server-side JavaScript files can be a little bit of a blind experience – debugging happens primarily through strategic placement of console.log statements and frequent examination of the Mobile Services server script reference on MSDN – even the littlest help goes a long way…though I am NOT saying that his IntelliSense support only offers “the littlest help.”

To get started, the JavaScript IntelliSense definition file can be downloaded from this link.  Additionally, there’s a ReadMe document that provides some supporting information available at this link.  The ReadMe file points out that the IntelliSense definition – in its current incarnation – is somewhat limited in its coverage (hey, it’s a start!)

Placing and Referencing the IntelliSense Definition File

The original article references two mechanisms for actually directing Visual Studio to make use of the reference file: adding an explicit reference to the precise path of the definition file on the local file system, and adding a reference to the definition file through the Tools/Options/Text Editor/JavaScript/IntelliSense/References panel in Visual Studio (under “Implicit (Web)”.)  Pros and cons of each approach were outlined, including:

  • Providing the path to the file within the script files themselves is a bit more work, since every script file needs to be modified;
  • Adding the Visual Studio reference results in a “pollution” of the JavaScript IntelliSense since Visual Studio doesn’t discriminate as to whether or not you’re working on Mobile Services scripts in order to choose what definition files to consult.
Read more

Wintellect Blogs

Managing Windows Azure Mobile Services (WAMS) Server Scripts with Microsoft Visual Studio Tools for Git

John Garland

2 Aug , 2013  

Windows Azure Mobile Services (WAMS) has come a long way in a few short months.  At the 2013 Build conference in San Francisco, Microsoft announced more than the service’s General Availability date – it also showed that the service had been integrated into the Visual Studio 2013 Preview in several key places.  These included a “Connected Services Manager” that will augment an existing project to connect with a new or preexisting WAMS instance, an entry for WAMS in the Server Explorer panel that allows viewing and editing the server-side data table business logic scripts (with access to the other WAMS script elements expected to be added over time), and a Push Notification Wizard that facilitates connecting an existing Windows Store app to a WAMS instance.  These features are detailed in this post on the Visual Studio Blog.  The expectation is that these integration points are expected to be enhanced as Visual Studio 2013 is updated to its RTM version.

One of the more recent features added to WAMS itself has been the integration of Git-based source control for the server scripts (as of this writing, this feature is currently in Preview.)  This integration provides several advantages for managing a WAMS service’s scripts.  First, it allows for scripts to be edited locally /offline using desktop file editing tools, including Visual Studio.  Changes can be managed through the local Git repository until they are ready to be synchronized to the server.  What’s more, this arrangement also allows access to some of the WAMS script-related content that is not (presently) available through the WAMS management portal (though access to these files can also be obtained from the command-line management tools.)

To mostly round out the collection of the tools will be discussed here, the Team Foundation Server Power Tools team at Microsoft has released the Visual Studio Tools for Git, which is an extension that allows Visual Studio’s Team Explorer to integrate with Git.  This integration includes using the Team Explorer GUI to manage and connect to local repositories, as well as to track changed elements in a selected repo, and managing branches, commits, and syncs in that repo.  As of this writing, the extension is at version 0.9.5.… Read more

,

Wintellect Blogs

Proceed with Caution – Windows Phone 8 App Lifecycle Events vs Async Methods

John Garland

7 May , 2013  

“We are on the path to Windows and Windows Phone Convergence” (//Build 2012 – How to Leverage your Code Across WP8 and Win8, Slide 6)

I often hear people saying the phrase “Windows 8 Phone” when they are talking/asking about “Windows Phone 8”.  Throughout presentations that I’ve given and other discussions I’ve had over the past several months that covered the topic of Windows Phone 8, I’ve made it a point to emphasize that Windows Phone 8 is NOT a Windows 8 Phone.  By doing so I’m not trying to be a nit-picky jerk, but rather I’m trying to underscore that there are important differences – both obvious and subtle – between the Windows Store App and Windows Phone platforms, and there are some major pitfalls that developers can stumble into if they are not aware of the way that some of the key platform technologies work.  One situation where these nuanced platform differences comes to light is in differences in the proper use of asynchronous operations within the various lifecycle events exposed by these two platforms; specifically the events pertaining to suspension/deactivation and application closing.

Huh?  To put it simply, the APIs available to Windows Store App development include tools that developers can use to safely(*) include asynchronous method calls when their application is being suspended.  The Windows Phone 8 APIs that support Deactivation and Closing do not include these tools, and it can be tricky to notice the problems that can arise.… Read more

Wintellect Blogs

LIDNUG Webinar Presentation Materials

John Garland

24 Jul , 2012  

Many thanks to the participants, organizers, and sponsors of today’s LIDNUG webinar – “Putting the Cloud in Your Pocket Pt1 – Using Windows Azure to Build Cloud-Enabled WP7 Apps.”  I especially appreciate the patience of those who attended as we struggled to do the best we could to resolve the LiveMeeting technical issues that dogged us during the presentation.  For what it is worth, prior to the presentation, the LIDNUG folks made sure we did a technical walkthrough to do everything possible to mitigate the possibility of running into these kinds of glitches…alas, despite our best efforts, the “demo gods” decided to frown upon us today.

As I mentioned during the talk, I have gone ahead and posted the code (along with the slide that were available for download during the talk) here.  As is often the case with talks about this topic, the demo contains keys and other “private” information that is specific to my own Azure account.  With that in mind, I have sanitized/removed the private content from the posted demo code, and included a document “ACS Update Instructions” alongside the code zip file that describes the steps necessary to get yourself up and running with your own Azure subscription.… Read more

,

Wintellect Blogs

Boston Azure Bootcamp Presentation Materials

John Garland

24 Jun , 2012  

I had a tremendous time this weekend presenting alongside Bill Wilder, Michael Collier, John Zablocki, and Jim O’Neil at the Boston Azure Bootcamp event in Cambridge, MA.  The topic once again covered the concepts of using Windows Azure to enhance mobile Windows Phone application and general mobile development considerations, and went beyond my demos to include a hands on lab that most everyone seems to have enjoyed.

As promised, the slide and code content I referred to in my talk can be found here.  I mentioned to a few who asked – there are some values in the lab that are specific to the ACS namespaces I have set up.  I am including in the code file a word doc that indicates how to set up the ACS values for the demo code in question.

Again, many thanks!  I’m looking forward to hearing about how folks are using Azure to add cloud “goodness” to their mobile applications.… Read more

, ,

Wintellect Blogs

CodeStock 2012 Presentation Content

John Garland

17 Jun , 2012  

I would like to thank the attendees of my “Putting the Cloud in Your Pocket – A Guide to Using Windows Azure to Build Cloud-Enabled Windows Phone Apps” talk at the recent Codestock event – especially considering the early hour following the previous night’s fun.  The slide and code content I referred to in my talk can be found here.   Also, many thanks go out to the event organizers – I had a great time traveling down to Tennessee for this event, and hope to maybe do so again in the future.

As can be expected, I removed my custom/personal ACS information from the sample code.  This includes the acsnamespace and realm resources in the AccessControlResources.xaml file within the Phone project, and the SwtSigningKey, realm, and namespace values from the MVC project’s web.config file.  These values can be obtained from a new or existing ACS namespace as follows:

ACS Configuration Values

These values are available in the following locations (Note – this is based on the current Silverlight-based management portal.  Precise locations may shift slightly when this content moves to the newer HTML5-based portal.)

The namespace value is the namespace you indicated when creating the ACS instance.

image

The Realm is specific to the relying party application that has been configured, and can be found on the Relying Party Application page:

image

The symmetric key can be obtained from the Access Control Service management portal, selecting Certificates and Keys, selecting (and/or creating) a Symmetric Key specific to the namespace:

image

image

image

Async CTP

Also, please remember that the code made use of the Async CTP assembly.  This was not strictly required, but was instead put in place to help improve the code flow instead of using Lambdas or complete methods for the various callback functions used when interacting with Azure Storage.  Information about the Async CTP is available here.… Read more

, ,

Wintellect Blogs

Metro XAML Nugget: App Bar AutoMagic

John Garland

29 May , 2012  

You may have noticed that in many places of the Windows 8 Metro UI, as well as many Metro applications where list content can be selected, that making a selection automatically/magically (“automagically”) brings up one or more app bars.  This is consistent with the “Guidelines and checklist for app bars” published in the Metro Style Apps Dev Center:

Do place contextual commands on an app bar and show that bar programmatically.

If you have commands that are specific to the mode of the app, such as the Crop command appearing only when a photo is selected, place those commands on an app bar and show it programmatically while in that context.

If you have commands that can be performed whether content is selected or not, keep those commands on the bar if you have enough room.

Do set the app bar’s dismissal mode to sticky when displaying contextual commands.

If you have contextual commands on an app bar, set the mode to sticky while that context exists and turn off the sticky mode when the context is no longer present (such as when a photo is deselected). In sticky mode, the bar doesn’t automatically hide when the user interacts with the app.

Read more