• News
  • Products
    • aPACK
      Avalonia libraries
    • IPACK
      Compact Framework 2.0/3.5
    • IPACK CF39
      Compact Framework 3.9
    • IDESK
      .NET Framework
  • Services
    • References
  • Support
    • Technical articles
    • Team
  • Company
    • Press releases
    • Open positions
    • Contact us
Banner

WaitingBar - Usage tutorial

Last modified: April 10, 2012

To start using WaitingBar for WP7 follow these steps:

  1. Install Bee Mobile Metropolis to your computer.
  2. Start Visual Studio 2010 and create a new project of type Windows Phone Application. You will find it in Silverlight for Windows Phone category.
  3. Browse to the installation folder on your hard drive.
  4. Read the AddControlsToToolbox.pdf file located in it to find out how to add Metropolis components to Toolbox of your Visual Studio.
  5. Double-click WaitingBar from the Toolbox to make it appear on your page:

    WaitingBar in design-time

    WaitingBar in design-time

Explanation of properties

WaitingBar control inherits from System.Windows.Controls.UserControl object; therefore it contains all its methods and properties. Following is a table of properties which we added. They are split into 3 categories: Appearance, Text and Wheel.

Property Name Property Description
WaitingBar Appearance category Properties which influence the overall appearance of WaitingBar
Fill Specifies the Linear Gradient Brush parameters used to fill the inside of WaitingBar.
RadiusX Specifies the transverse diameter of ellipse which constitutes the corner of WaitingBar.
RadiusY Specifies the conjugate diameter of ellipse which constitutes the corner of WaitingBar.
Stroke Specifies the color of stroke which outlines WaitingBar.
WaitingBar Appearance – Text category Properties which influence the text written over WaitingBar.
Text Gets or sets the text displayed over WaitingBar.
TextColor Gets or sets the color of text displayed by WaitingBar.
TextHorizontalAlignment Gets or sets the horizontal alignment of text. You can align the text to the center, left or right.
TextMargin
TextVerticalAlignment Gets or sets the vertical alignment of text. You can align the text to the center, top or bottom.
WaitingBar Appearance – Wheel Properties which influence the wheel indicator of WaitingBar.
BackgroundVisibility Should the fill of WaitingBar be visible?
WheelBorderColor Color of the outer line drawn around the wheel indicator.
WheelFillColor Color used to fill the inside of the wheel indicator.
WheelHeight This property specifies the diameter of the wheel indicator.
WheelHorizontalAlignment Aligns the wheel indicator in horizontal direction. You can align the wheel indicator to the left, right or center.
WheelIndicator The color which is used to highlight the wheel indicator.
WheelMargin Specifies the amount of pixels between the edge of WaitingBar and wheel indicator.
WheelSpeed Specifies the delay in milliseconds between each generated frame of the animation.
WheelVerticalAlignment Aligns the wheel indicator in vertical direction. You can align the wheel indicator to the top, bottom or center.
WheelWidth Specifies the thickness of the individual bars which make up the wheel indicator.

A simple example

In this chapter we will show you how to set-up WaitingBar in a simple particular scenario. Let’s say your application performs background operations every now and then during which you want to display WaitingBar to the user. Because you are creating the application for your company, why not to put a tiny advertising into your app by showing your company’s logo each time WaitingBar appears. We will use this logo in this tutorial:

You can download it from this web site to follow the tutorial or you can use your own.

  1. Put WaitingBar on your page.
  2. Set its size to 320×135.
  3. Set HorizontalAlignment and VerticalAlignment to Center.
  4. In WaitingBar Appearance category, set RadiusX and RadiusY properties to 40 and set Stroke to Transparent.
  5. In WaitingBar Appearance – Text category set empty string to Text property.
  6. In Background Appearance – Wheel category set the following properties according to this table:
    WheelBorderColor Transparent
    WheelFillColor Yellow
    WheelHeight 22
    WheelHorizontalAlignment Left
    WheelIndicator #FFFFA900
    WheelMargin 10,0,5,0
    WheelSpeed 100
    WheelVerticalAlignment Center
    WheelWidth 6
  7. From the toolbox drag and drop Image GUI element on your page and over WaitingBar.
  8. Set its Source property to your logo image.
  9. Set Stretch property to None.
  10. Set HorizontalAlignment and VerticalAlignment to Center.
  11. Use Margin property to set margins of your Image so that it does not overlap with the wheel indicator. For Bee Mobile logo image we used this value for Margin property: 40,0,0,0

Your page will now look similar to this:

Set Visibility property for WaitingBar and Image to Collapsed. Put a button on your form. The button will server simply as the source of event which will display WaitingBar. However, in your scenario, that event would likely be the start of a lengthy background operation (data download). Finally we will add two methods to our page – Show() and Hide() which will show and hide WaitingBar whenever they are called.

private void Show()
{
  waitingBar1.Show();
  beeLogo.Visibility = System.Windows.Visibility.Visible;
}

private void Hide()
{
  beeLogo.Visibility = System.Windows.Visibility.Collapsed;
  waitingBar1.Hide();
}

// your button click event handler may look like this:
private void vistaButton1_Click(object sender, RoutedEventArgs e)
{
  if (waitingBar1.Visibility == System.Windows.Visibility.Collapsed)
    Show();
  else
    Hide();
  UpdateText();
}

// the UpdateText method is simple:
private void UpdateText()
{
  if (waitingBar1.Visibility == System.Windows.Visibility.Visible)
    vistaButton1.Text = "Hide";
  else
    vistaButton1.Text = "Show";
}

This concludes the tutorial for WaitingBar control. If you have any questions, ideas, suggestions or recommendations about this tutorial, please write us an email to support@beemobile4.net. Thank you.

Free trial Purchase

Private: Metropolis details

Operating system

Support

Usage tutorial Usage tutorial
  • Contact us |
  • Privacy policy |
  • Terms of use |

Copyright ©2008-25 Bee Mobile. All rights reserved

Follow us

  • RSS
  • Facebook
  • Twitter
  • Youtube