Visualizzazione post con etichetta Windows Store. Mostra tutti i post
Visualizzazione post con etichetta Windows Store. Mostra tutti i post

venerdì 13 settembre 2013

Force binding update for a TextBox


The TextBox control updates the Text binding source only when it looses focus.

When you are writing in a TextBox and you press a button in the ApplicationBar, the focus not changes and your MVVM property doesn't update.

The workaround is to force the binding update like this:
 
var focusedElement = FocusManager.GetFocusedElement();
var focusedTextBox = focusedElement as TextBox;

if (focusedTextBox != null)
{
    var binding = focusedTextBox.GetBindingExpression(TextBox.TextProperty);
    if (binding != null)
        binding.UpdateSource();
}


sabato 7 settembre 2013

Install Nokia Pro Camera with Amber


If you can't download Nokia Pro Camera like me...


Here an easy workaround:
  1. Change your phone region and language to United States
  2. Connect to a WiFi network
  3. Under Settings - WiFi, click on the WiFi network you are connected to
  4. Switch 'Proxy' to on. Now type "117.135.139.179" into "Server/URL". In "Port", type in "8888"
  5. Go to the Store and click on 'Nokia Collection'
  6. Download Nokia Pro Cam
  7. When the download started, turn Proxy off
  8. Set your phone region back to normal, and Restart.

giovedì 22 agosto 2013

Windows Store Apps Succinctly - Free eBook

Some days ago I started to develop an application for Windows Store.
I love to develop in C#, and after some pages in MSDN documentation, I searched for an offline free e-book to read with my tablet.
I found a great resource from Syncfusion:

Windows Store Apps Succinctly

This book is written by John Garland and you can download 185 pages in PDF or Kindle format.

Before starting, please remember: if you are a beginner in development, this ebook is not for you.

Why is it a good choice? Because it's simple and fast to read. It starts from core concepts until you get to the deployment. Then at the end of this book, you are ready to fully develop your first application.

Main Chapters
  1. Core Concepts: the introduction to Windows Store apps, WinRT and the Windows Runtime with a simple "Hello World" sample.
  2. XAML, Controls, and Pages: all you need to know about XAML, from Namespace declarations, to Animations and Data Binding. The chapter shows all essential controls for the user interface and explains how to work with Pages and Frames.
  3. Application Life Cycle and Storage: one of the most important chapters. The Windows Store apps life cycle is not the same as the desktop apps, then you need to understand all steps for the the best user experience. This chapter continues with Data Storage. It explains how to work with Application Data (local, roaming, temporary), User Data (file and folder picker) and Data Storage (files/folder and some useful links to LiveConnect and SQLite). 
  4. Contracts and Extensions: the Windows 8 Charms: search, share, print, app settings, etc.. The chapter ends with handling file types and protocols.
  5. Tiles, Toast, and Notifications: yes..the big feature of Windows Phone, now in Windows 8. If you want to release a great app, you really need a good Live Tile. This chapter covers all types of Tiles and how to schedule the updates. Then it talks about the Toast Notifications and ends with a sample of Push Notification.
  6. Hardware and Sensors: an overview of all sensors (like compass, gyroscope, accelerometer and gps) and how to interact with Camera. The user love those features, then use them in your app.
  7. Deployment: your application is done, let's publish it on Windows Store! Understand the Store prices and accounts; learn how to use the Windows Application Certification Kit; add the trial mode and the In-app purchase; configure the PubCenter and the Ads.

Pro
  • Free! :)
  • Easy and fast to read
  • XAML + C#
  • All development cycle
  • A lot of samples and tips
  • Kindle format
  • Not for development beginners

Cons
  • No NFC samples
  • No gestures samples

Now enjoy your reading... thanks Syncfusion.

FYI another good free resource is Metro Studio: a customizable collection of icon templates.

giovedì 15 agosto 2013

String format in Xaml

When you need to concatenate some strings in a TextBlock you can use the tag like Run.

Silverlight 4 has introduced an useful feature to make this more easy: StringFormat.
Now you can put more informations in a single element.

The code is very simple:
<TextBlock Text="{Binding Username, StringFormat='Hello \{0\}'}" />
<TextBlock Text="{Binding Temperature, StringFormat=\{0\}°}" />

and it works also with numbers and dates:
<TextBlock Text="{Binding Value, StringFormat=\{0:n2\}}" />
<TextBlock Text="{Binding Value, StringFormat=\{0:c2\}}" />
<TextBlock Text="{Binding Date, StringFormat=f}" />

You can check more details in the Kunal's blog