Exemplo n.º 1
0
        private void SecuritySensor_OnMouseDown(object sender, MouseButtonEventArgs e)
        {
            if (ReadOnly)
            {
                return;
            }

            StateChangedCommand?.Execute(SensorState);
        }
Exemplo n.º 2
0
        private void Sensor_OnMouseDown(object sender, MouseButtonEventArgs e)
        {
            if (OnlyOutput)
            {
                return;
            }

            var state = GetSensorState(SensorStateString);

            if (state == SensorState.Alert)
            {
                SensorStateString = GetSensorStateString(SensorState.Ok);
            }
            else if (state == SensorState.Ok)
            {
                SensorStateString = GetSensorStateString(SensorState.Alert);
            }

            StateChangedCommand?.Execute(GetSensorState(SensorStateString));
        }