Click here to Skip to main content
13,457,851 members
Click here to Skip to main content
Add your own
alternative version


95 bookmarked
Posted 17 Jun 2009


, 25 Jun 2009
Rate this:
Please Sign up or sign in to vote.
An article on how to create a kiosk application that displays photos received via BlueTooth.



This article describe some very basic techniques on how to create a photo kiosk (similar to the Kodak Picture Kiosk).



PhotoBooth uses the default MainView/MainViewModel created by the MVVM Toolkit. Various "sub-views" then gets shown or hidden based on the properties on the MainViewModel!

The MainViewModel has a ObservableCollection of photos. This gets populated by the OBEX listener. We also keep track of the current selected photo (by using CollectionView)

view = (ListCollectionView)CollectionViewSource.GetDefaultView(Photos); 
view.CurrentChanged += delegate 
    SelectedPhoto = (string)view.CurrentItem; 

Marlon has a excellent article on this technique available here. Just remember the IsSynchronizedWithCurrentItem="True".

PhotoBooth has four sub-views:



This is the "Oooo, look at me... I am so pretty" screen to get customers to use the kiosk!



PhotoBrowserView shows all the photos received by the kiosk. The view can also interact with the ViewModel using two commands:

  • Clear - Removes all the photos
  • Checkout - Starts the checkout procedure

This view is only visible if HasPhotos is true.



The PhotoEditView allows editing and sharing of photos (not implemented yet). Basic navigation commands are available on the ViewModel:

  • NextPhoto
  • PreviousPhoto
  • UnselectPhoto

This view is only visible if IsPhotoSelected is true.



Finally, the CheckoutView shows a basket-like view of all the photos you have uploaded; here, you can also select the size of the photo to be printed!

This view is only visible if BusyCheckingOut is true.


  • Bluetooth is an open wireless protocol for exchanging data over short distances from fixed and mobile devices.
  • OBEX (OBject EXchange) is a communications protocol that facilitates the exchange of binary objects between devices.

Our PhotoBooth receives photos via Bluetooth (using the OBEX protocol). We will be using the 32 Feet library from In The Hand.

Tip: If you are developing using a 64-bit OS, also do the following (thank you big red):

Change Project > PhotoBooth Properties > Build > Platform Target: x86 (it defaults to Any CPU).

Here is the code to start the OBEX listener:

private ObexListener listener; 

private void StartObexListener() 
    radio = InTheHand.Net.Bluetooth.BluetoothRadio.PrimaryRadio; 
    if (radio != null) 
        radio.Mode = InTheHand.Net.Bluetooth.RadioMode.Discoverable; 
        listener = new ObexListener(ObexTransport.Bluetooth); 
        dispatcher = Dispatcher.CurrentDispatcher; 
        System.Threading.Thread t = new System.Threading.Thread(
           new System.Threading.ThreadStart(ObexRequestHandler)); 

private void ObexRequestHandler() 
    if (radio == null) 

    while (listener.IsListening) 
            ObexListenerContext olc = listener.GetContext(); 
            ObexListenerRequest olr = olc.Request; 
            string filename = 
              System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal) + 
               "\\" + DateTime.Now.ToString("yyMMddHHmmss") + 
               " " + Uri.UnescapeDataString(olr.RawUrl.TrimStart(new char[] { '/' })); 
            dispatcher.Invoke(new Action(delegate() 
        } catch (Exception ex) 

Two things to notice about this code: we force our Bluetooth radio to Discoverable mode, and we store a reference to the current Dispatcher. This allows us to Invoke back to the correct thread when we receive a photo on our background thread!

Read more here.

PhotoBooth also displays the current status of the Bluetooth radios using tooltips.


Here is the markup:

<Image Source="..\Resources\Images\bluetooth_blue.png">
                <TextBlock Text="{Binding Radio.Name}" FontWeight="Bold"/> 
                <TextBlock Text="{Binding Radio.Manufacturer, StringFormat='Manufacturer: {0}'}" /> 
                <TextBlock Text="{Binding Radio.SoftwareManufacturer, StringFormat='Software: {0}'}" /> 
                <TextBlock Text="{Binding Radio.LocalAddress, StringFormat='Address: {0}'}" /> 
                <TextBlock Text="{Binding Radio.Mode, StringFormat='Mode: {0}'}" /> 

And if no radio is found?



Most kiosks have some very fancy animations to attract the attention of the customers. I unfortunately have no design skills! The only animation that I will be using is the AnimatedWrapPanel. This gives me very basic animation on each new photo received!

            <layout:AnimatedWrapPanel /> 

Read more here.

Kiosk Tips

Most kiosks are a single application system; remember to make your application run full screen and remove the border chrome.


Kiosks usually uses touch screens. It is very common to then hide the cursor.


And, that's it...


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

South Africa South Africa
No Biography provided

You may also be interested in...

Comments and Discussions

Generalwhy on my mobile device radio returns null Pin
Alex Theodorou1-Dec-10 0:05
memberAlex Theodorou1-Dec-10 0:05 
GeneralAnimatingPanelBase Pin
Jianping Yan24-Aug-09 5:27
memberJianping Yan24-Aug-09 5:27 
GeneralNice, well writen, well documented and gorgeous Pin
Raul Mainardi Neto18-Jul-09 16:55
memberRaul Mainardi Neto18-Jul-09 16:55 
GeneralRe: Nice, well writen, well documented and gorgeous Pin
rudigrobler19-Jul-09 23:39
memberrudigrobler19-Jul-09 23:39 
Generalwhy listener.IsListening Pin
Unruled Boy26-Jun-09 2:59
memberUnruled Boy26-Jun-09 2:59 
General64-bit Dev Environment Pin
big red25-Jun-09 18:52
memberbig red25-Jun-09 18:52 
GeneralRe: 64-bit Dev Environment Pin
rudigrobler25-Jun-09 20:27
memberrudigrobler25-Jun-09 20:27 
GeneralThe force is strong Pin
Pete O'Hanlon25-Jun-09 12:20
mvpPete O'Hanlon25-Jun-09 12:20 
GeneralRe: The force is strong Pin
rudigrobler25-Jun-09 20:28
memberrudigrobler25-Jun-09 20:28 
Generalafter run, it is frozen and nothing can be run Pin
Seraph_summer17-Jun-09 9:40
memberSeraph_summer17-Jun-09 9:40 
GeneralRe: after run, it is frozen and nothing can be run Pin
rudigrobler17-Jun-09 9:48
memberrudigrobler17-Jun-09 9:48 
GeneralRe: after run, it is frozen and nothing can be run Pin
Seraph_summer17-Jun-09 10:02
memberSeraph_summer17-Jun-09 10:02 
GeneralRe: after run, it is frozen and nothing can be run Pin
rudigrobler17-Jun-09 23:26
memberrudigrobler17-Jun-09 23:26 
GeneralNot bad my son Pin
Sacha Barber17-Jun-09 4:33
mvpSacha Barber17-Jun-09 4:33 
GeneralRe: Not bad my son Pin
rudigrobler17-Jun-09 5:46
memberrudigrobler17-Jun-09 5:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.180323.1 | Last Updated 26 Jun 2009
Article Copyright 2009 by rudigrobler
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid