It’s All About Controls (Part 2)

Thanks for reading Part 1 of this multi-part blog post. If you’ve missed, in Part 1, we talked about what has been added (or converged with Windows) in Windows Phone 8.1 SDK. This part will mainly cover the changes that are included in this SDK. These are important changes and you must make a note of it to build stunning apps. Perhaps, later, there will be part 3, in which I’ll cover some 3rd party components, which can be used in Universal apps. Do let me know if you want to cover anything specific.

Panorama Is Now Hub

wp_ss_20140421_0003 wp_ss_20140421_00014

With Windows and Windows Phone convergence, Panorama control from Windows Phone is changed to Hub control. It is similar to Hub control available on Windows and gives effects like Panorama. It also, share the same XAML in both the platforms



StatusBar (SystemTray) Changes

StatusBar or SystemTray is top-most component on page, which shows various details:


In Windows Phone 8 apps, you could show/hide system tray from XAML. For example:


Now, in 8.1 (WinRT) apps you’ll need to use code behind to do it. For example:


Flyouts, Flyouts Everywhere

Flyout is a new control in WP8.1 SDK. As MSDN says, use it to display lightweight UI. Also, unlike a dialog, a flyout can be lightly dismissed by clicking or tapping outside it. You can create a flyout by using following code. And actually add a flyout to any control which is a FrameworkElement.



Command From Your Bar

With WP8.1, you do get your old AppBar.. but also get CommandBar. This command bar shares code with Windows. It also have Primary Commands and Secondary Commands. Which represents main buttons and menu on bottom app-bar in WP app. Whereas, on Windows, they have positions on app-bar as left and right.



Zoom – SemanticZoom

With WP8.1, LongListSelector is gone. However, it is replaced with SemanticZoom – in convergence with Windows. This control actually has two views which are shown in different way according to Zoom In/Out mode. It will be another topic for blog. But to put it into simple words: you’ll see a large list of photos in Grid. But when you *squeeze* it, you’ll see a list. OR vice a versa as you design your view.


With these controls, there are some more changes in controls are added. Like RichTextBLOCK (not Box), WebView (not Browser). But I would love to keep this post short.  

In next series (rather, I’m planning to change the name Smile), I’m going to talk about API changes in Windows Phone 8.1 SDK. Meanwhile, do let me know your feedback and if you want anything more covered here.

Happy Coding

Mayur Tendulkar

It’s All About Controls (Part 1)

Any app, be it a normal desktop app, web app, mobile app or tablet app – requires controls. Right from the Page (yes, page is also a control within a frame) to textbox, button, etc. are all controls and they play a key role in building these apps. With latest update to Windows Phone, there are lots of (and good) updates to controls available in Windows Phone SDK. In this post, we’ll try to cover these updates. As I said, there are lots of updates, we’ll cover them in parts. This is part one.

In-Built Theming Support

While implementing (or forcing) themes in Windows Phone 8 apps, you as a developer had to depend on some third party libraries. One famous library by Jeff, ThemeManager was very helpful. With 8.1, theming is in built into Windows Phone, just like Windows store apps. You can use RequestedTheme property to set the desired theme. Also, you don’t need to restart the app to take theming into the effect.


Icing on the cake: This property is available to all UIElement, that means, you can set it not for just page but also to StackPanel, TextBox, etc. as well & design your UI as you wish.

Head For All

Remember arranging that TextBlock just above the TextBox to give a label to it? Now, you don’t need to juggle with it. Almost every input control like TextBox, DatePicker, TimePicker has a Header property. And apart from it, controls like TextBox also have a PlaceholderText property, which allows you to provide ‘watermark text’ So, now you don’t need Watermark Textbox Control too.


Windows Phone Toolkit – Is In-Built!

From above code sample, you might have guessed that, DatePicker, TimePicker and such controls are newly added to the Windows Phone SDK. Previously available in Windows Phone Toolkit, many controls are now part of SDK. Just see the difference in Windows Phone 8.0 and 8.1 control set and you’ll get the picture Smile

Windows Phone 8.0 Windows Phone 8.1 8.1 Continued…
image image image

So now, for basic controls you’re not required to depend on 3rd party libraries. There are some special cases though and I’ll talk about them in later posts.

In-Built Animations

Animations are very important to give fast & fluid feeling. They also provide feedback. Imagine you click on a button and you don’t feel that it is clicked! Windows Phone has some in built animations by default. But just like controls, Windows Phone Toolkit provided additional animations api for your apps. Now, with this release of SDK, those animations are also available to you, without depending on any libraries. For example some page transitions are available here. And below code can tell you how to use them.


Now, before ending this post, I would like to comment here that you can use this code (which is in Windows Phone app) in your Windows Store apps. Yes. The XAML is almost same for both kind of apps. So, you can share maximum XAML code with these platforms. Which also means, you get theming, animations, controls (DatePicker, TimePicker, etc…) in Windows as well. And you can just copy paste the code or do a file-linking. Below picture (from //build session) can give you more idea Smile


These are all good additions. Now, with these additions there are some changes. For example, Panorama is gone and replaced with Hub control to align with Windows controls. Changes in how you access System Tray, etc. And we’ll talk about these changes in next part.

Till then… Happy Coding.

Mayur Tendulkar

What’s Next For Phone Developer?

If you’re a Windows Phone Developer, by now you might have heard about OR rather, upgraded your phone to Windows Phone 8.1. Microsoft, recently released Windows Phone 8.1 (Codenamed Blue) for Developers. To get these bits on your device, you need to a registered Windows Phone developer and need to install Preview For Developers app on your phone. You can find more information here Once you upgrade the phone, you’ll find lots of resources online to get to know what’s new in Windows Phone 8.1.

Now, as a developer, you’ve the phone to test and build apps for. However, to build applications for this latest version of Windows Phone, you need Visual Studio 2013 Update 2 (currently in RC). You can get these bits from here

As a developer, first, you need to unlock your phone. If you remember, there used to be Phone Registration Tool, which gets installed when you install Windows Phone SDK. Now, this tool is integrated into Visual Studio and you can launch it from Tools menu


When you connect your phone, you can easily developer unlock it to test your applications on it.


Similarly, you can use, App Deployment tool to deploy XAP (or now Appx) to Phone.


New addition to these tools is ‘Windows Phone Power Tools’. And these tools does lot of work for you, right from verifying the app, checking the performance and what not.


Even thought, this release is titled as Windows Phone 8.1, there are so many features that *I* will personally call it Windows Phone 9 Smile

To give you idea about what’s new in this platform and how you can develop apps for it, Microsoft is hosting online events. These are all free online events. So, register now and get the benefits from it.

Building Apps for Windows Phone 8.1 Jump Start (April 29- May 1)
//Learn – Global Community Webcast (April 24)

Happy Coding,

Mayur Tendulkar

One Code To Rule Them All, but Why?

Windows: runs on more than 90% desktops, laptops, netbooks and nowadays it runs on kiosks, smart devices, phones and these days gaming console. However, developers always faced challenge to target all these devices and deliver ONE app, which can run on all these devices. There were differences in APIs, kernel, core services and what not.

When .NET was released, Microsoft tried to solve this problem by introducing .NET Framework on desktop and .NET Compact Framework – a subset of full .NET Framework *modified* for smart devices. Then, there was yet another .NET Framework for yet another class of devices called .NET Micro-Framework. So, developers had three different .NET Frameworks to target different class of devices, yet someone can’t just copy/paste code from one device app to another. Libraries compiled for one device may not work on another (e.g. app compiled for Windows Mobile *may* fail if ran on desktop – as both used to be PEs). But, for someone like me, it was a good start. I could write apps for mobile phones or desktop using the same language that I know i.e. C# or VB.NET.

Later, Microsoft introduced a very nice concept of Portable Class Libraries, which allowed developers to share code between various platforms.


The limitation was, PCLs are binaries which give you ‘least common denominator’ of APIs available across platforms you selected. So, if you select .NET Framework and Windows 8, APIs which common to these two platform will be selected. And, if you wanted to do maximum code-reuse, your best bet is to follow MVVM like patterns, put models/view models in PCL and create app for views. So, the project structure will look like:


PCLs solve some of the issues in best possible way. But when it comes to Windows & Windows Phone, there are lot of similarities like UI, API set, programming model. Here we need some solution which can give maximum code reuse and go beyond PCLs.

Welcome to Universal Apps


Universal Apps allows you to build app with maximum code sharing which can work on Windows and Windows Phone (and Xbox in future). When you create Universal App, template creates 3 projects for you as shown below:


Now, you may say that it looks pretty similar to above mentioned solution which use PCLs.  Yes, it looks same, but there are internal differences:

When you create Universal App, you can share UI, Media, Code, XAML, etc.. using Shared Project. Now, Shared project allow you to share *code* between projects, whereas PCL allow you to share *binary* between projects. That also means, you can’t use #if.. #then compiler switches in PCLs and can’t write (or rather get benefit from) platform specific code. So, it also means that, when you build the project, you don’t get *.Shared.dll or something and it is not *referenced*, rather during build the code will be automatically included from shared project into individual projects. You can spot the difference in icon here.


With Universal App, you can share UI as well. In next screenshot you can see that there is almost no difference in Windows page and Windows Phone page.



Just tell me which one is which and I’ll give you a gift when we’ll meet next time Smile. Now rather I typing here, following slide will speak a lot:


After all this, if you *package* these projects, you get APPX which you can submit to the store.

This is certainly a nice move from Microsoft considering developer audience. For consumers, they can now buy app on desktop and can use it on phone. And for me this is true ‘ONE MICROSOFT’ Smile

There are many new announcements happened at //build/ to follow them and If you want to know more about Windows Phone 8.1 Features, Universal App FAQs, do visit blogs from my friends:


Mayur Tendulkar

Productivity Tools for Windows Phone Developers

Scott has just published a blog post titled Scott Hanselman’s 2014 Ultimate Developer and Power Users Tool List for Windows. This is a most useful list for any developer. Read it here. Thanks a lot Scott.  Smile

I too, have my personal list of tools & NuGet packages which I use regularly while building Windows & Windows Phone apps and I wanted to share them here. Just my 2 cents to above list.

  • Phone Theme Manager
    In your app, you may want force the app to use one theme in particular, irrespective of system theme. OR use some different Accent Colour. A nice NuGet package can do a magic for your app.


  • MVVM Light Framework
    Laurent has built this nice framework to expedite MVVM development. You can build your own framework and start from scratch, but it will be reinventing the wheel. Rather use this framework with Portable Class Libraries and build apps for both Windows & Windows Phone with maximum code reuse. You can read my old post about how to get started.


  • Multilingual App Toolkit
    A useful tool to build multilingual apps for Windows & Windows Phone. You may read my previous blog post about how to use this tool.


  • Syncfusion Metro Studio 2.0
    While developing Windows & Windows Phone apps, you’ll need icons for Application Bar. You can design your own icons using this tool. It allows you to customize the icons and allows allows you to export it as PNG or as a vector data for resolution independent scales.
    An alternative can be: The Noun Project


  • PerfecTile
    You require to design number of icons, images (with different resolution and scale) to attach to your project as logos and other items. Use this tool to generate those images.


  • Windows Phone Power Tools
    These tools are extensions to what Windows Phone SDK provides. e.g below table can give you more details.


  • Windows Phone Emulator Skin Switcher
    This tool just changes the skin of your emulator. Nothing fancy, but cool to showcase different device during presentation Smile

    emulator skin switcher wxga_thumb

  • IsoStoreSpy for Windows Phone
    This cool utility can be used to explore Isolated Storage on Windows Phone and explore what data goes inside the apps.


  • XAML Spy
    As the site says: XAML Spy is the visual runtime inspector for Silverlight, Windows Phone, Windows Store and WPF apps. It provides unprecedented access to all aspects of any running XAML app. Interact with the UI visual tree, monitor events, extract XAML, explore the contents of the package and isolated storage, view statistics and more, much more.


  • Windows Phone Desktop App
    This is for both developers and consumers. You may want to sync your data between machine and Windows Phone device. You can easily plug-in the device and move/sync content. For Windows 8 there is Windows Store app which makes it easy. For Windows 7 you can use this desktop app. Most interesting feature of this app, which I can’t find difficult otherwise, is to sync podcast. Give it a try Smile


  • Zune
    If you’re Windows Phone 7 developer or consumer, you’ll require this tool to sync data between device and your laptop. This is also a great media player and podcast downloader.


These are the basic tools and NuGet packages required for everyday Windows or Windows Phone developer. There are some third-party control sets from vendors like Syncfusion, DevExpress, Telerik, ComponentOne, Mindscape, Infragistics and I’ll talk about them in future posts.

I hope, I’ve covered most of them here. If you’ve any suggestion or you know any tool and want to include here, do let me know.


Mayur Tendulkar

Localized Apps for Windows Phone 8.0

If you want your app to be used by millions, localize it. In countries like India, it is a must have feature. Think about having an app allowing farmers to sell their produce directly to the customers. In such scenario, many farmers don’t know English and are used to, to their native language. It doesn’t make any sense to build an app which can’t communicate and relate with them. Rather, having an app in their own language can help boost the productivity, sale and profit. Lets see how we can build such apps.

Normally, we use resource files to store strings and various resources pertaining to different locals. To help building such resources for different locals, Microsoft has provided Multilingual App Toolkit. Download and install the toolkit from here

Lets start with building a Windows Phone application, which will welcome users in their own language. For the sake of understanding, we’ll keep it simple, one page app. The design will look like the one as shown below:


For this, I’ve modified the code as shown below:image

To have text for both English and Hindi languages, lets first add a text for English in ‘AppResources.resx’ file under ‘Resources’ folder. After adding text, it should look like:


You can add as many resources as you want to have it displayed on the screen.

Now, to enable multilingual features (Hindi in our case), if you’ve installed the toolkit then from ‘Tools’ menu click on Enable Multilingual App Toolkit.


Now to add support for Indian language, right click your project and click on ‘Add translation languages’. This will bring following dialog. Select ‘Hindi’ and click on ‘OK’. Note: You can select as many languages as you want. So, your app can show data to any user in their own language supported by toolkit. :)


It will add another file named ‘AppResources.hi-IN.xlf’ in Resources folder (for each language selected above). Double click that file to open the toolkit. In this dialog, resource file for Hindi, will be already populated with content similar to AppResources file.


On this screen, click on ‘Translate’ > ‘Translate all’. It will automatically translate all the texts which can be translated. If anything fails, you can manually change it.


Now save the file and come back to Visual Studio.

Even though, we’ve added resource strings for English and Hindi, we haven’t bind it to actual text control. Modify the text control with following code:


This code, at runtime, binds the textblock to text in selected language’s resource file.

After this, first, try the app using default language i.e. English. When you run the app in emulator, it will look like:


Here, app shows text ‘Welcome friend’ in English. At this point, change the language and local to Hindi, India to test the app in Hindi language. To do this, go to Settings > Language+Region and change it to India with following setting.


Here, you may need to restart the phone. After restart, deploy the app again and you should see the following screen:


This is just the beginning of multilingual app. You can add as many languages as you want. And not just text, you can add any type of resource (image, icons sound, etc…) in your resource files.

By building multilingual apps, you can reach more users. This means more money and a successful app. Hope this helps.



Mayur Tendulkar

Cross-Platform. Hybrid or Native?

Recently I had to build an app for our company (zevenseas) which can work across all the platforms i.e. Windows Phone, Windows 8, iOS (iPhone, iPad) and Android (Phone and Tablet). I started looking for various options like Titanium, Icenium, PhoneGap & Xamarin. Considering the options I had, I chose two best solutions Icenium and Xamarin. But like many, I was confused about which one to use & when, one being hybrid and other native. So, I used and tested both and here are my findings in this post.

Experimenting with Xamarin – A native solution

I started using Xamarin (build on top of Mono) since February 2013 and I’m loving it. Just think about writing apps for Android/iOS/Mac using the language that you’re using since years – C#. The best feature that I can see which Xamarin provides is one solution to build them all. Just think about having one solution, which has all the required projects & dependencies at one place. Everything in one IDE (Visual Studio), one solution and in one repository, built using one language. This is AWESOME. The other most important feature for me is Portable Class Libraries (PCL). Think about having your Data Access Layer, Business Logic Layer, Models, etc.… into PCL and then referring it into various different applications. Just create UI layers. 100% code re-use. Isn’t it? So, think about project structure like this:


Other awesome feature which I liked about Xamarin is, their releases aligned with release of .NET features, iOS and Android. You can use LINQ, Async/Await, PCL in your cross-platform project. One more thing to mention here, Xamarin provided support for iOS7 as soon as it got released. Pretty amazing.

The challenges with Xamarin

I can see some challenges with Xamarin & yes, those can be addressed. First one is third-party SDKs equivalents and controls. Recently Xamarin is coming up with their components-store and I’m waiting for few SDKs and components to appear in it. Perhaps, this can be a great opportunity for some folks to build and sell their components/controls. For example, I wanted to build mobile app to fetch data from SharePoint. For Windows Phone, there is SharePoint SDK for Windows Phone. Being lazy, I wanted that same SDK as Xamarin component. It is doable. No doubt. But if somebody can provide it to me, or provide solution to migrate these kind of SDKs to Xamarin I’ll be happy. (btw, Xamarin has something called scan my code which analyses the code and tells you how much of it can be reused across platforms).


In case of controls (like Telerik, Infragistics, ComponentOne, Mindscape and Syncfusion), it would be great if I can port/use existing controls (without reinventing the wheel) written in .NET; in my cross-platform solution. I know, it is going to take time, but still.

Second challenge that I found is if I want to build highly touch intensive app like which includes drawing/animations/etc…. manipulating that in C# can be difficult. Same can be achieved with existing JavaScript libraries in Icenium. Although there is MonoGame for game development, works just like Xamarin products and built on top of Mono.

Playing around Icenium – A hybrid solution

I have fair understanding of JavaScript/JQuery and have used JQuery Mobile to build mobile web-apps. So, getting used to Icenium was damn easy. The great thing I loved about Icenium is, I can use same code (UI, DAL, BAL, etc…) for all the platforms. Plus, I can run any simulator and test the app LIVE. When I say live means, just make a change in HTML/CSS/JS, save and the it affects the app in simulator. Too good. Plus these simulators are pretty fast. In case of Android emulator, if I start it, I can easily go for a walk, have a cup of tea and still emulator is booting-up on my machine. I’ve ‘one of the best machine’ – thanks to zevenseas.  (P.S. Xamarin has nothing to do with Android emulator. It uses Android’s native emulator i.e. AVD etc.…, which by default slow. You can try Intel HAXM & Intel Atom based Android images in this case)


Being hybrid app platform, I can use all existing JavaScript libraries including Jquery mobile, Kendo UI or what not. The list is endless. This is LEGEN—wait for it DARY… The challenge with Xamarin (third-party libraries) can be solved here. Other feature which I liked the most is, you can build the app and run or test it on Android or iOS device without developer account. It uses something called Icenium Ion. Because *i think* provisioning profiles is pathetic with Apple. Microsoft and Google are way better in this case. However, remember that at the end you need developer account to publish the app. You can delay this, but can’t skip.


The challenges with Icenium

I found some challenges when dealing with Icenium. First, if you already have your existing logic in C# (in case of Xamarin, PCL is the best solution), then porting it to hybrid app (JS) can be time consuming affair. You may need to re-write. But this re-write can help you to use that code across platforms. Second, the simulators are not active simulators and has some limitations. Which means, you can’t use hardware buttons like back/home/menu etc… on Android/iOS. Keyboard inputs work from real keyboard connected to development machine. You also can’t test most of the Cardova plug-ins.

Apart from these challenges, I found both Icenium and Xamarin good options to build cross-platform solutions. So, the question is when to use what?

  Icenium Xamarin
Use existing C# Knowledge and code
Incl. Async/Await, LINQ, PCL, etc…
Use existing JS knowledge and code
Inc. Jquery, JQMobile, KendoUI, etc…
(Windows Phone/8, Android/iOS/Mac/Desktop/XBOX)
Android & iOS

Edit: I just found that Icenium as IDE allows you to build apps for Android, iOS. However, the same code can be used to build for Blackberry and Windows Phone externally i.e. like using Visual Studio to build XAP (Windows Phone package). Using respective build process. Thanks to Lohith for pointing out my mistake.

When it comes to documentation and support, both of these solutions are good. Xamarin uses default .NET APIs which you already know. In case if you’re looking for platform specific API, while going through Xamarin docs, you can navigate to Apple or Android documentation. Basically, Xamarin has one-to-one API mappings/bindings (just for example, it may be different. I don’t know internals). So, it makes life easier. Icenium on the other hand, is all JavaScript. You may need to check with each JS library vendor for documentation. Support is good as both the solutions have active forums and twitter handles to ask questions.

I will not talk about performance. I haven’t built similar kind of application using these two solutions to check performance. Hence, I can’t comment on this point.

So far I’m loving both of these solutions to build cross-platform applications and I’ve my own reasons to choose right-one at right-time. Do you? Do let me know if you need any further information.


Mayur Tendulkar