Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 2 Next »

Connexion includes a framework which lets you easily plug scheduling functionality into your devices. This framework includes a user interface for configuring schedules, as well as server-side functions to determine when your devices should perform specific functionality.

To enable scheduling, your configuration class should implement the IScheduleConfiguration interface. This interface defines a single property:

namespace Connexion.Core
{
  public interface IScheduleConfiguration
  {
    ScheduleConfig ScheduleConfiguration { get; }
  }
}

Implement it as follows in your configuration class:

  public class MyDeviceConfiguration : NotifyBase, IScheduleConfiguration
  {
    private ScheduleConfig m_ScheduleConfiguration;
    [DataMember]
    public ScheduleConfig ScheduleConfiguration
    {
      get
      {
        if (m_ScheduleConfiguration == null)
        {
          m_ScheduleConfiguration = new ScheduleConfig();
          m_ScheduleConfiguration.PropertyChanged += (o, e) => RaisePropertyChanged(e);
        }
        return m_ScheduleConfiguration;
      }
    }

The next step is to add the user interface component(s) and bind to your configuration class ScheduleConfiguration property. The schedule UI component is defined in the Connexion.ScheduleUi assembly (Connexion.ScheduleUi.dll), so you will need to reference this assembly.

In your device.xaml class, add a reference to the scheduling namespace:

<core:UserControlBase x:Class="mydevice.myDeviceUI"
                      xmlns:scheduleUi="clr-namespace:Connexion.ScheduleUi;assembly=Connexion.ScheduleUi"

There are 2 UI components available:

  • An icon adorner which will launch an ‘edit schedule’ popup window - this can be placed next to textboxes and similar controls to indicate additional scheduling functionality.

    <scheduleUi:SchedulerIcon ScheduleConfiguration="{Binding Config.ScheduleConfiguration}"
                              VerticalAlignment="Center" />
  • A schedule UI which can be placed directly onto your device UI - this can be placed on a separate tab or other large area if you only need a single schedule configuration.

    <Border>
       <scheduleUi:ScheduleControl ScheduleConfiguration="{Binding Config.ScheduleConfig}"
                                   NoSchedulingEnabled="False" />
    </Border>

  • No labels