I want to create a property in a control that will act as a viewer that will be able to connect to another non-visual control to show its current status. In this example let
To have non-UI elements that can be used at design-time in the designer, you can inherit from Component.
using System.ComponentModel;
public interface IHeater
{
int Temperature { get; set; }
}
public class Heater : Component, IHeater
{
public int Temperature
{
get;
set;
}
}
public class HeaterMonitor:Component
{
public IHeater Source { get; set; }
}
Then you can use them in design-mode (in component tray):
And select the source this way: