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

Version 1 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"

  • No labels